Commit e1c347ca authored by Charles L. Dorian's avatar Charles L. Dorian Committed by Russ Cox

8g: fix 386 floating point stack bug

Also fixes issue 310 comment 5 error.
Fixes #310.

R=rsc
https://golang.org/cl/163042
parent a0f742d3
...@@ -254,7 +254,9 @@ regopt(Prog *p) ...@@ -254,7 +254,9 @@ regopt(Prog *p)
*/ */
case AFMOVDP: case AFMOVDP:
case AFMOVFP: case AFMOVFP:
case AFMOVLP:
case AFMOVVP: case AFMOVVP:
case AFMOVWP:
case ACALL: case ACALL:
for(z=0; z<BITS; z++) for(z=0; z<BITS; z++)
addrs.b[z] |= bit.b[z]; addrs.b[z] |= bit.b[z];
......
...@@ -1289,10 +1289,12 @@ gmove(Node *f, Node *t) ...@@ -1289,10 +1289,12 @@ gmove(Node *f, Node *t)
if(t->op == OREGISTER) if(t->op == OREGISTER)
goto hardmem; goto hardmem;
nodreg(&r1, types[ft], D_F0); nodreg(&r1, types[ft], D_F0);
if(ft == TFLOAT32 && f->op != OREGISTER) if(f->op != OREGISTER) {
gins(AFMOVF, f, &r1); if(ft == TFLOAT32)
else gins(AFMOVF, f, &r1);
gins(AFMOVD, f, &r1); else
gins(AFMOVD, f, &r1);
}
// set round to zero mode during conversion // set round to zero mode during conversion
tempalloc(&t1, types[TUINT16]); tempalloc(&t1, types[TUINT16]);
......
...@@ -306,8 +306,9 @@ regopt(Prog *firstp) ...@@ -306,8 +306,9 @@ regopt(Prog *firstp)
*/ */
case AFMOVDP: case AFMOVDP:
case AFMOVFP: case AFMOVFP:
case AFMOVVP:
case AFMOVLP: case AFMOVLP:
case AFMOVVP:
case AFMOVWP:
case ACALL: case ACALL:
for(z=0; z<BITS; z++) for(z=0; z<BITS; z++)
addrs.b[z] |= bit.b[z]; addrs.b[z] |= bit.b[z];
......
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