OPCODE_RECIP

This commit is contained in:
Dr. Chat
2016-06-26 13:03:42 -05:00
parent 212cd6ee3d
commit f2ad6b8cb8
9 changed files with 68 additions and 3 deletions

View File

@@ -487,7 +487,13 @@ bool ConstantPropagationPass::Run(HIRBuilder* builder) {
i->Remove();
}
break;
case OPCODE_RECIP:
if (i->src1.value->IsConstant()) {
v->set_from(i->src1.value);
v->Recip();
i->Remove();
}
break;
case OPCODE_AND:
if (i->src1.value->IsConstant() && i->src2.value->IsConstant()) {
v->set_from(i->src1.value);