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