1
0
mirror of https://github.com/golang/go synced 2024-11-20 06:44:40 -07:00

8g: fix 386 floating point stack bug

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

R=rsc
https://golang.org/cl/163042
This commit is contained in:
Charles L. Dorian 2009-12-01 15:53:50 -08:00 committed by Russ Cox
parent a0f742d343
commit e1c347ca59
3 changed files with 10 additions and 5 deletions

View File

@ -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];

4
src/cmd/8g/gsubr.c Executable file → Normal file
View File

@ -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) {
if(ft == TFLOAT32)
gins(AFMOVF, f, &r1); gins(AFMOVF, f, &r1);
else else
gins(AFMOVD, f, &r1); 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]);

View File

@ -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];