mirror of
https://github.com/danog/ir.git
synced 2024-11-30 04:39:43 +01:00
Only unsigned MOD may be converted into AND
This commit is contained in:
parent
e235a33679
commit
1089699f2c
@ -1428,7 +1428,9 @@ binop_fp:
|
||||
op2_insn = &ctx->ir_base[insn->op2];
|
||||
if (IR_IS_CONST_REF(insn->op1)) {
|
||||
// const
|
||||
} else if (IR_IS_POWER_OF_TWO(op2_insn->val.u64) && IR_IS_UNSIGNED_32BIT(op2_insn->val.u64 - 1)) {
|
||||
} else if (IR_IS_TYPE_UNSIGNED(insn->type)
|
||||
&& IR_IS_POWER_OF_TWO(op2_insn->val.u64)
|
||||
&& IR_IS_UNSIGNED_32BIT(op2_insn->val.u64 - 1)) {
|
||||
return IR_MOD_PWR2; // and op1, op2_insn->val.u64-1
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user