Value::MulHi and constant propagation for OPCODE_MUL_HI. Could maybe be reworked?

This commit is contained in:
gibbed
2015-05-13 16:13:06 -05:00
parent 9714018fbb
commit bb947c6819
3 changed files with 31 additions and 0 deletions

View File

@@ -354,6 +354,13 @@ bool ConstantPropagationPass::Run(HIRBuilder* builder) {
i->Remove();
}
break;
case OPCODE_MUL_HI:
if (i->src1.value->IsConstant() && i->src2.value->IsConstant()) {
v->set_from(i->src1.value);
v->MulHi(i->src2.value, (i->flags & ARITHMETIC_UNSIGNED) != 0);
i->Remove();
}
break;
case OPCODE_DIV:
if (i->src1.value->IsConstant() && i->src2.value->IsConstant()) {
v->set_from(i->src1.value);