summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2014-10-28 10:14:19 -0400
committerAustin Clements <austin@google.com>2014-10-28 10:14:19 -0400
commit8777610f3b35969d2f52acc32056ea08549b0ba1 (patch)
treebb376546d0a93a9ecc3f3d3d6933066009dda97b
parentc9d3f794a30d01abe9da84bfc2be7b5303421043 (diff)
downloadgo-8777610f3b35969d2f52acc32056ea08549b0ba1.tar.gz
[dev.power64] liblink: emit wrapper code in correct place
The wrapper code was being emitted before the stack reservation, rather than after. LGTM=rsc R=rsc, dave CC=golang-codereviews https://codereview.appspot.com/161540043
-rw-r--r--src/liblink/obj9.c126
1 files changed, 63 insertions, 63 deletions
diff --git a/src/liblink/obj9.c b/src/liblink/obj9.c
index 3db08c545..0bae64d0b 100644
--- a/src/liblink/obj9.c
+++ b/src/liblink/obj9.c
@@ -490,74 +490,74 @@ addstacksplit(Link *ctxt, LSym *cursym)
// It is a liblink NOP, not a Power64 NOP: it encodes to 0 instruction bytes.
- p = appendp(ctxt, p);
- p->as = AMOVD;
- p->from.type = D_OREG;
- p->from.reg = REGG;
- p->from.offset = 4*ctxt->arch->ptrsize; // G.panic
- p->to.type = D_REG;
- p->to.reg = 3;
-
- p = appendp(ctxt, p);
- p->as = ACMP;
- p->from.type = D_REG;
- p->from.reg = 0;
- p->to.type = D_REG;
- p->to.reg = 3;
-
- p = appendp(ctxt, p);
- p->as = ABEQ;
- p->to.type = D_BRANCH;
- p1 = p;
+ q = appendp(ctxt, q);
+ q->as = AMOVD;
+ q->from.type = D_OREG;
+ q->from.reg = REGG;
+ q->from.offset = 4*ctxt->arch->ptrsize; // G.panic
+ q->to.type = D_REG;
+ q->to.reg = 3;
- p = appendp(ctxt, p);
- p->as = AMOVD;
- p->from.type = D_OREG;
- p->from.reg = 3;
- p->from.offset = 0; // Panic.argp
- p->to.type = D_REG;
- p->to.reg = 4;
+ q = appendp(ctxt, q);
+ q->as = ACMP;
+ q->from.type = D_REG;
+ q->from.reg = 0;
+ q->to.type = D_REG;
+ q->to.reg = 3;
+
+ q = appendp(ctxt, q);
+ q->as = ABEQ;
+ q->to.type = D_BRANCH;
+ p1 = q;
+
+ q = appendp(ctxt, q);
+ q->as = AMOVD;
+ q->from.type = D_OREG;
+ q->from.reg = 3;
+ q->from.offset = 0; // Panic.argp
+ q->to.type = D_REG;
+ q->to.reg = 4;
- p = appendp(ctxt, p);
- p->as = AADD;
- p->from.type = D_CONST;
- p->from.offset = autosize+8;
- p->reg = REGSP;
- p->to.type = D_REG;
- p->to.reg = 5;
+ q = appendp(ctxt, q);
+ q->as = AADD;
+ q->from.type = D_CONST;
+ q->from.offset = autosize+8;
+ q->reg = REGSP;
+ q->to.type = D_REG;
+ q->to.reg = 5;
- p = appendp(ctxt, p);
- p->as = ACMP;
- p->from.type = D_REG;
- p->from.reg = 4;
- p->to.type = D_REG;
- p->to.reg = 5;
+ q = appendp(ctxt, q);
+ q->as = ACMP;
+ q->from.type = D_REG;
+ q->from.reg = 4;
+ q->to.type = D_REG;
+ q->to.reg = 5;
- p = appendp(ctxt, p);
- p->as = ABNE;
- p->to.type = D_BRANCH;
- p2 = p;
+ q = appendp(ctxt, q);
+ q->as = ABNE;
+ q->to.type = D_BRANCH;
+ p2 = q;
- p = appendp(ctxt, p);
- p->as = AADD;
- p->from.type = D_CONST;
- p->from.offset = 8;
- p->reg = REGSP;
- p->to.type = D_REG;
- p->to.reg = 6;
-
- p = appendp(ctxt, p);
- p->as = AMOVD;
- p->from.type = D_REG;
- p->from.reg = 6;
- p->to.type = D_OREG;
- p->to.reg = 3;
- p->to.offset = 0; // Panic.argp
-
- p = appendp(ctxt, p);
- p->as = ANOP;
- p1->pcond = p;
- p2->pcond = p;
+ q = appendp(ctxt, q);
+ q->as = AADD;
+ q->from.type = D_CONST;
+ q->from.offset = 8;
+ q->reg = REGSP;
+ q->to.type = D_REG;
+ q->to.reg = 6;
+
+ q = appendp(ctxt, q);
+ q->as = AMOVD;
+ q->from.type = D_REG;
+ q->from.reg = 6;
+ q->to.type = D_OREG;
+ q->to.reg = 3;
+ q->to.offset = 0; // Panic.argp
+
+ q = appendp(ctxt, q);
+ q->as = ANOP;
+ p1->pcond = q;
+ p2->pcond = q;
}
break;