Floating point promotion was broken since the IR float change. Fix.
This commit is contained in:
parent
36cddd6afb
commit
38de688c5a
|
@ -41,14 +41,12 @@ static void promote(struct ir* ir)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case IR_PHI:
|
case IR_PHI:
|
||||||
if (!array_appendu(&promotable, ir))
|
{
|
||||||
{
|
int i;
|
||||||
if (ir->left)
|
for (i=0; i<ir->u.phivalue.count; i++)
|
||||||
promote(ir->left);
|
array_appendu(&promotable, ir->u.phivalue.item[i].right);
|
||||||
if (ir->right)
|
|
||||||
promote(ir->right);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -328,17 +328,21 @@ PATTERNS
|
||||||
emit "la %out, $value"
|
emit "la %out, $value"
|
||||||
cost 8;
|
cost 8;
|
||||||
|
|
||||||
out:(int)reg = value:CONSTF4
|
|
||||||
emit "lfs %out, address-containing-$value"
|
|
||||||
cost 8;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* FPU operations */
|
/* FPU operations */
|
||||||
|
|
||||||
|
out:(float)reg = value:CONSTF4
|
||||||
|
emit "lfs %out, address-containing-$value"
|
||||||
|
cost 8;
|
||||||
|
|
||||||
out:(float)reg = ADDF4(left:(float)reg, right:(float)reg)
|
out:(float)reg = ADDF4(left:(float)reg, right:(float)reg)
|
||||||
emit "fadds %out, %left, %right"
|
emit "fadds %out, %left, %right"
|
||||||
cost 4;
|
cost 4;
|
||||||
|
|
||||||
|
out:(float)reg = SUBF4(left:(float)reg, right:(float)reg)
|
||||||
|
emit "fsubs %out, %left, %right"
|
||||||
|
cost 4;
|
||||||
|
|
||||||
|
|
||||||
/* vim: set sw=4 ts=4 expandtab : */
|
/* vim: set sw=4 ts=4 expandtab : */
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue