summaryrefslogtreecommitdiff
path: root/src/cmd/gc/subr.c
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2009-05-27 23:55:14 -0700
committerRuss Cox <rsc@golang.org>2009-05-27 23:55:14 -0700
commitf6f70933698bcfaa2f7fbed24dcc75784d80d5bb (patch)
tree7ec702ad1c80def016cbfd23ccaebc0fdbdf134a /src/cmd/gc/subr.c
parent7d3403fdf5d248c36b407fe33fd5408105d89e2b (diff)
downloadgolang-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.c27
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;
+}
+