Commit e642503d authored by Russ Cox's avatar Russ Cox

6l, 8l: fix -K implementation

R=ken2
CC=golang-dev
https://golang.org/cl/2313041
parent 1edfb4cc
...@@ -716,6 +716,11 @@ dostkoff(void) ...@@ -716,6 +716,11 @@ dostkoff(void)
p->as = AINT; p->as = AINT;
p->from.type = D_CONST; p->from.type = D_CONST;
p->from.offset = 3; p->from.offset = 3;
p = appendp(p);
p->as = ANOP;
q1->pcond = p;
q1 = P;
} }
if(autoffset < StackBig) { // do we need to call morestack? if(autoffset < StackBig) { // do we need to call morestack?
...@@ -725,10 +730,6 @@ dostkoff(void) ...@@ -725,10 +730,6 @@ dostkoff(void)
p->as = ACMPQ; p->as = ACMPQ;
p->from.type = D_SP; p->from.type = D_SP;
p->to.type = D_INDIR+D_CX; p->to.type = D_INDIR+D_CX;
if(q1) {
q1->pcond = p;
q1 = P;
}
} else { } else {
// large stack // large stack
p = appendp(p); p = appendp(p);
...@@ -736,10 +737,6 @@ dostkoff(void) ...@@ -736,10 +737,6 @@ dostkoff(void)
p->from.type = D_INDIR+D_SP; p->from.type = D_INDIR+D_SP;
p->from.offset = -(autoffset-StackSmall); p->from.offset = -(autoffset-StackSmall);
p->to.type = D_AX; p->to.type = D_AX;
if(q1) {
q1->pcond = p;
q1 = P;
}
p = appendp(p); p = appendp(p);
p->as = ACMPQ; p->as = ACMPQ;
...@@ -769,20 +766,12 @@ dostkoff(void) ...@@ -769,20 +766,12 @@ dostkoff(void)
p->to.type = D_BRANCH; p->to.type = D_BRANCH;
p->pcond = pmorestack[0]; p->pcond = pmorestack[0];
p->to.sym = symmorestack[0]; p->to.sym = symmorestack[0];
if(q1) {
q1->pcond = p;
q1 = P;
}
} else } else
if(moreconst1 != 0 && moreconst2 == 0) { if(moreconst1 != 0 && moreconst2 == 0) {
p->as = AMOVL; p->as = AMOVL;
p->from.type = D_CONST; p->from.type = D_CONST;
p->from.offset = moreconst1; p->from.offset = moreconst1;
p->to.type = D_AX; p->to.type = D_AX;
if(q1) {
q1->pcond = p;
q1 = P;
}
p = appendp(p); p = appendp(p);
p->as = ACALL; p->as = ACALL;
...@@ -796,20 +785,12 @@ dostkoff(void) ...@@ -796,20 +785,12 @@ dostkoff(void)
p->to.type = D_BRANCH; p->to.type = D_BRANCH;
p->pcond = pmorestack[i]; p->pcond = pmorestack[i];
p->to.sym = symmorestack[i]; p->to.sym = symmorestack[i];
if(q1) {
q1->pcond = p;
q1 = P;
}
} else } else
if(moreconst1 == 0 && moreconst2 != 0) { if(moreconst1 == 0 && moreconst2 != 0) {
p->as = AMOVL; p->as = AMOVL;
p->from.type = D_CONST; p->from.type = D_CONST;
p->from.offset = moreconst2; p->from.offset = moreconst2;
p->to.type = D_AX; p->to.type = D_AX;
if(q1) {
q1->pcond = p;
q1 = P;
}
p = appendp(p); p = appendp(p);
p->as = ACALL; p->as = ACALL;
...@@ -822,10 +803,6 @@ dostkoff(void) ...@@ -822,10 +803,6 @@ dostkoff(void)
p->from.offset = (uint64)moreconst2 << 32; p->from.offset = (uint64)moreconst2 << 32;
p->from.offset |= moreconst1; p->from.offset |= moreconst1;
p->to.type = D_AX; p->to.type = D_AX;
if(q1) {
q1->pcond = p;
q1 = P;
}
p = appendp(p); p = appendp(p);
p->as = ACALL; p->as = ACALL;
......
...@@ -701,6 +701,10 @@ dostkoff(void) ...@@ -701,6 +701,10 @@ dostkoff(void)
p->as = AINT; p->as = AINT;
p->from.type = D_CONST; p->from.type = D_CONST;
p->from.offset = 3; p->from.offset = 3;
p = appendp(p);
p->as = ANOP;
q1->pcond = p;
} }
if(autoffset < StackBig) { // do we need to call morestack if(autoffset < StackBig) { // do we need to call morestack
...@@ -710,10 +714,6 @@ dostkoff(void) ...@@ -710,10 +714,6 @@ dostkoff(void)
p->as = ACMPL; p->as = ACMPL;
p->from.type = D_SP; p->from.type = D_SP;
p->to.type = D_INDIR+D_CX; p->to.type = D_INDIR+D_CX;
if(q1) {
q1->pcond = p;
q1 = P;
}
} else { } else {
// large stack // large stack
p = appendp(p); p = appendp(p);
...@@ -721,10 +721,6 @@ dostkoff(void) ...@@ -721,10 +721,6 @@ dostkoff(void)
p->from.type = D_INDIR+D_SP; p->from.type = D_INDIR+D_SP;
p->from.offset = -(autoffset-StackSmall); p->from.offset = -(autoffset-StackSmall);
p->to.type = D_AX; p->to.type = D_AX;
if(q1) {
q1->pcond = p;
q1 = P;
}
p = appendp(p); p = appendp(p);
p->as = ACMPL; p->as = ACMPL;
......
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