OPCODE_IS_NAN
This commit is contained in:
@@ -300,6 +300,20 @@ bool ConstantPropagationPass::Run(HIRBuilder* builder) {
|
||||
i->Remove();
|
||||
}
|
||||
break;
|
||||
case OPCODE_IS_NAN:
|
||||
if (i->src1.value->IsConstant()) {
|
||||
if (i->src1.value->type == FLOAT32_TYPE &&
|
||||
isnan(i->src1.value->constant.f32)) {
|
||||
v->set_constant(uint8_t(1));
|
||||
} else if (i->src1.value->type == FLOAT64_TYPE &&
|
||||
isnan(i->src1.value->constant.f64)) {
|
||||
v->set_constant(uint8_t(1));
|
||||
} else {
|
||||
v->set_constant(uint8_t(0));
|
||||
}
|
||||
i->Remove();
|
||||
}
|
||||
break;
|
||||
|
||||
// TODO(benvanik): compares
|
||||
case OPCODE_COMPARE_EQ:
|
||||
|
||||
Reference in New Issue
Block a user