Commit c2364b58 authored by Austin Clements's avatar Austin Clements

[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://golang.org/cl/161540043
parent cb4f5e19
...@@ -490,74 +490,74 @@ addstacksplit(Link *ctxt, LSym *cursym) ...@@ -490,74 +490,74 @@ addstacksplit(Link *ctxt, LSym *cursym)
// It is a liblink NOP, not a Power64 NOP: it encodes to 0 instruction bytes. // It is a liblink NOP, not a Power64 NOP: it encodes to 0 instruction bytes.
p = appendp(ctxt, p); q = appendp(ctxt, q);
p->as = AMOVD; q->as = AMOVD;
p->from.type = D_OREG; q->from.type = D_OREG;
p->from.reg = REGG; q->from.reg = REGG;
p->from.offset = 4*ctxt->arch->ptrsize; // G.panic q->from.offset = 4*ctxt->arch->ptrsize; // G.panic
p->to.type = D_REG; q->to.type = D_REG;
p->to.reg = 3; q->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;
p = appendp(ctxt, p); q = appendp(ctxt, q);
p->as = AMOVD; q->as = ACMP;
p->from.type = D_OREG; q->from.type = D_REG;
p->from.reg = 3; q->from.reg = 0;
p->from.offset = 0; // Panic.argp q->to.type = D_REG;
p->to.type = D_REG; q->to.reg = 3;
p->to.reg = 4;
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); q = appendp(ctxt, q);
p->as = AADD; q->as = AADD;
p->from.type = D_CONST; q->from.type = D_CONST;
p->from.offset = autosize+8; q->from.offset = autosize+8;
p->reg = REGSP; q->reg = REGSP;
p->to.type = D_REG; q->to.type = D_REG;
p->to.reg = 5; q->to.reg = 5;
p = appendp(ctxt, p); q = appendp(ctxt, q);
p->as = ACMP; q->as = ACMP;
p->from.type = D_REG; q->from.type = D_REG;
p->from.reg = 4; q->from.reg = 4;
p->to.type = D_REG; q->to.type = D_REG;
p->to.reg = 5; q->to.reg = 5;
p = appendp(ctxt, p); q = appendp(ctxt, q);
p->as = ABNE; q->as = ABNE;
p->to.type = D_BRANCH; q->to.type = D_BRANCH;
p2 = p; p2 = q;
p = appendp(ctxt, p); q = appendp(ctxt, q);
p->as = AADD; q->as = AADD;
p->from.type = D_CONST; q->from.type = D_CONST;
p->from.offset = 8; q->from.offset = 8;
p->reg = REGSP; q->reg = REGSP;
p->to.type = D_REG; q->to.type = D_REG;
p->to.reg = 6; q->to.reg = 6;
p = appendp(ctxt, p); q = appendp(ctxt, q);
p->as = AMOVD; q->as = AMOVD;
p->from.type = D_REG; q->from.type = D_REG;
p->from.reg = 6; q->from.reg = 6;
p->to.type = D_OREG; q->to.type = D_OREG;
p->to.reg = 3; q->to.reg = 3;
p->to.offset = 0; // Panic.argp q->to.offset = 0; // Panic.argp
p = appendp(ctxt, p); q = appendp(ctxt, q);
p->as = ANOP; q->as = ANOP;
p1->pcond = p; p1->pcond = q;
p2->pcond = p; p2->pcond = q;
} }
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment