Constant Propagation for OPCODE_VECTOR_ADD
This commit is contained in:
@@ -622,6 +622,16 @@ bool ConstantPropagationPass::Run(HIRBuilder* builder) {
|
||||
i->Remove();
|
||||
}
|
||||
break;
|
||||
case OPCODE_VECTOR_ADD:
|
||||
if (i->src1.value->IsConstant() && i->src2.value->IsConstant()) {
|
||||
v->set_from(i->src1.value);
|
||||
uint32_t arith_flags = i->flags >> 8;
|
||||
v->VectorAdd(i->src2.value, hir::TypeName(i->flags & 0xFF),
|
||||
!!(arith_flags & ARITHMETIC_UNSIGNED),
|
||||
!!(arith_flags & ARITHMETIC_SATURATE));
|
||||
i->Remove();
|
||||
}
|
||||
break;
|
||||
case OPCODE_VECTOR_SUB:
|
||||
if (i->src1.value->IsConstant() && i->src2.value->IsConstant()) {
|
||||
v->set_from(i->src1.value);
|
||||
|
||||
Reference in New Issue
Block a user