summaryrefslogtreecommitdiff
path: root/src/liblink
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-08-13 18:32:54 -0400
committerRuss Cox <rsc@golang.org>2014-08-13 18:32:54 -0400
commite456ae86a6951a4c367019c2387cf4c9615f132a (patch)
treeb06db2b59c44036fa10ef8ea0f46bd1a42000624 /src/liblink
parentf14ac88830638f1031ed0339d4db6e7e635385e6 (diff)
downloadgo-e456ae86a6951a4c367019c2387cf4c9615f132a.tar.gz
[dev.power64] liblink: fix handling of $nnn(reg)
LGTM=minux R=minux CC=golang-codereviews https://codereview.appspot.com/126180043
Diffstat (limited to 'src/liblink')
-rw-r--r--src/liblink/asm9.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/liblink/asm9.c b/src/liblink/asm9.c
index f1889a92c..352fba915 100644
--- a/src/liblink/asm9.c
+++ b/src/liblink/asm9.c
@@ -677,6 +677,11 @@ aclass(Link *ctxt, Addr *a)
switch(a->name) {
case D_NONE:
ctxt->instoffset = a->offset;
+ if(a->reg != NREG) {
+ if(-BIG <= ctxt->instoffset && ctxt->instoffset <= BIG)
+ return C_SACON;
+ return C_LACON;
+ }
consize:
if(ctxt->instoffset >= 0) {
if(ctxt->instoffset == 0)
@@ -769,6 +774,7 @@ oplook(Link *ctxt, Prog *p)
a2 = C_NONE;
if(p->reg != NREG)
a2 = C_REG;
+//print("oplook %P %d %d %d %d\n", p, a1, a2, a3, a4);
r = p->as;
o = oprange[r].start;
if(o == 0)
@@ -1423,6 +1429,7 @@ asmout(Link *ctxt, Prog *p, Optab *o, int32 *out)
o4 = 0;
o5 = 0;
+//print("%P => case %d\n", p, o->type);
switch(o->type) {
default:
ctxt->diag("unknown type %d", o->type);