Constant propagation for vector SGT/UGE/UGT

Constant rounding (and fixed vec128 rounding only doing x)
This commit is contained in:
Dr. Chat
2016-07-25 11:57:14 -05:00
parent 91be5f979e
commit a72f1d949f
3 changed files with 166 additions and 2 deletions

View File

@@ -607,6 +607,27 @@ bool ConstantPropagationPass::Run(HIRBuilder* builder) {
i->Remove();
}
break;
case OPCODE_VECTOR_COMPARE_SGE:
if (i->src1.value->IsConstant() && i->src2.value->IsConstant()) {
v->set_from(i->src1.value);
v->VectorCompareSGE(i->src2.value, hir::TypeName(i->flags));
i->Remove();
}
break;
case OPCODE_VECTOR_COMPARE_UGT:
if (i->src1.value->IsConstant() && i->src2.value->IsConstant()) {
v->set_from(i->src1.value);
v->VectorCompareUGT(i->src2.value, hir::TypeName(i->flags));
i->Remove();
}
break;
case OPCODE_VECTOR_COMPARE_UGE:
if (i->src1.value->IsConstant() && i->src2.value->IsConstant()) {
v->set_from(i->src1.value);
v->VectorCompareUGE(i->src2.value, hir::TypeName(i->flags));
i->Remove();
}
break;
case OPCODE_VECTOR_CONVERT_F2I:
if (i->src1.value->IsConstant()) {
v->set_zero(VEC128_TYPE);