1
0
mirror of https://github.com/golang/go synced 2024-11-21 21:54:40 -07:00

arm reg bug MOVW into bool variable

R=r
CC=golang-dev
https://golang.org/cl/4034042
This commit is contained in:
Ken Thompson 2011-01-15 16:55:47 -08:00
parent 7b4495c041
commit 2c35e548bb

View File

@ -137,18 +137,16 @@ regopt(Prog *firstp)
uint32 vreg;
Bits bit;
return;
if(first == 0) {
fmtinstall('Q', Qconv);
}
first++;
if(debug['K']) {
if(first != 20)
if(first != 2)
return;
// debug['R'] = 2;
// debug['P'] = 2;
debug['R'] = 2;
debug['P'] = 2;
print("optimizing %S\n", curfn->nname->sym);
}
@ -480,7 +478,7 @@ brk:
* peep-hole on basic block
*/
if(!debug['R'] || debug['P']) {
peep();
// peep();
}
/*
@ -562,20 +560,24 @@ addmove(Reg *r, int bn, int rn, int f)
default:
print("What is this %E\n", v->etype);
case TINT8:
p1->as = AMOVB;
break;
case TBOOL:
case TUINT8:
p1->as = AMOVBU;
break;
case TINT16:
p1->as = AMOVH;
break;
case TUINT16:
p1->as = AMOVHU;
break;
case TINT32:
case TUINT32:
case TPTR32:
case TBOOL:
p1->as = AMOVW;
break;
case TINT8:
case TUINT8:
p1->as = AMOVB;
break;
case TINT16:
case TUINT16:
p1->as = AMOVH;
break;
case TFLOAT32:
p1->as = AMOVF;
break;
@ -599,7 +601,7 @@ addmove(Reg *r, int bn, int rn, int f)
a->type = D_FREG;
a->reg = rn-NREG;
}
if(v->etype == TUINT8)
if(v->etype == TUINT8 || v->etype == TBOOL)
p1->as = AMOVBU;
if(v->etype == TUINT16)
p1->as = AMOVHU;