mirror of
https://github.com/golang/go
synced 2024-11-22 02:54:39 -07:00
replace original float instruction with jump to make branches
to float instructions work correctly. R=rsc CC=golang-dev https://golang.org/cl/870044
This commit is contained in:
parent
b26a7a2b88
commit
29c6c09f71
@ -8,7 +8,7 @@
|
|||||||
void
|
void
|
||||||
softfloat()
|
softfloat()
|
||||||
{
|
{
|
||||||
Prog *p, *prev, *psfloat;
|
Prog *p, *next, *psfloat;
|
||||||
Sym *symsfloat;
|
Sym *symsfloat;
|
||||||
int wasfloat;
|
int wasfloat;
|
||||||
|
|
||||||
@ -26,7 +26,6 @@ softfloat()
|
|||||||
|
|
||||||
wasfloat = 0;
|
wasfloat = 0;
|
||||||
p = firstp;
|
p = firstp;
|
||||||
prev = P;
|
|
||||||
for(p = firstp; p != P; p = p->link) {
|
for(p = firstp; p != P; p = p->link) {
|
||||||
switch(p->as) {
|
switch(p->as) {
|
||||||
case AMOVWD:
|
case AMOVWD:
|
||||||
@ -50,21 +49,23 @@ softfloat()
|
|||||||
if (psfloat == P)
|
if (psfloat == P)
|
||||||
diag("floats used with _sfloat not defined");
|
diag("floats used with _sfloat not defined");
|
||||||
if (!wasfloat) {
|
if (!wasfloat) {
|
||||||
if (prev == P)
|
next = prg();
|
||||||
diag("float instruction without predecessor TEXT");
|
*next = *p;
|
||||||
|
|
||||||
// BL _sfloat(SB)
|
// BL _sfloat(SB)
|
||||||
prev = appendp(prev);
|
*p = zprg;
|
||||||
prev->as = ABL;
|
p->link = next;
|
||||||
prev->to.type = D_BRANCH;
|
p->as = ABL;
|
||||||
prev->to.sym = symsfloat;
|
p->to.type = D_BRANCH;
|
||||||
prev->cond = psfloat;
|
p->to.sym = symsfloat;
|
||||||
|
p->cond = psfloat;
|
||||||
|
|
||||||
|
p = next;
|
||||||
wasfloat = 1;
|
wasfloat = 1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
wasfloat = 0;
|
wasfloat = 0;
|
||||||
}
|
}
|
||||||
prev = p;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user