diff options
author | Russ Cox <rsc@golang.org> | 2009-05-27 23:55:14 -0700 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2009-05-27 23:55:14 -0700 |
commit | f6f70933698bcfaa2f7fbed24dcc75784d80d5bb (patch) | |
tree | 7ec702ad1c80def016cbfd23ccaebc0fdbdf134a /src/cmd/gc/subr.c | |
parent | 7d3403fdf5d248c36b407fe33fd5408105d89e2b (diff) | |
download | golang-f6f70933698bcfaa2f7fbed24dcc75784d80d5bb.tar.gz |
clean up gmove:
* conversions all in one place.
* no separate load, store phases;
direct memory addressing when possible
(this is the x86 after all!).
avoids extra registers, extra MOVQs.
* fixes int32 -> uint64 bug
(was zero-extending)
R=ken
OCL=29482
CL=29484
Diffstat (limited to 'src/cmd/gc/subr.c')
-rw-r--r-- | src/cmd/gc/subr.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/cmd/gc/subr.c b/src/cmd/gc/subr.c index de32c8e6d..dcaa11a00 100644 --- a/src/cmd/gc/subr.c +++ b/src/cmd/gc/subr.c @@ -671,7 +671,6 @@ opnames[] = [OCOMPOS] = "COMPOS", [OCOMPSLICE] = "COMPSLICE", [OCOM] = "COM", - [OCONST] = "CONST", [OCONTINUE] = "CONTINUE", [OCONV] = "CONV", [ODCLARG] = "DCLARG", @@ -3015,3 +3014,29 @@ runifacechecks(void) } lineno = lno; } + +/* + * even simpler simtype; get rid of ptr, bool. + * assuming that the front end has rejected + * all the invalid conversions (like ptr -> bool) + */ +int +simsimtype(Type *t) +{ + int et; + + et = simtype[t->etype]; + switch(et) { + case TPTR32: + et = TUINT32; + break; + case TPTR64: + et = TUINT64; + break; + case TBOOL: + et = TUINT8; + break; + } + return et; +} + |