aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/simplify.c
diff options
context:
space:
mode:
Diffstat (limited to 'simplify.c')
-rw-r--r--simplify.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/simplify.c b/simplify.c
index 6c11018e..b46e08c3 100644
--- a/simplify.c
+++ b/simplify.c
@@ -1263,6 +1263,14 @@ static int simplify_compare_constant(struct instruction *insn, long long value)
break;
bits = def->src2->value;
switch (insn->opcode) {
+ case OP_SET_EQ:
+ if ((value & bits) != value)
+ return replace_with_value(insn, 0);
+ break;
+ case OP_SET_NE:
+ if ((value & bits) != value)
+ return replace_with_value(insn, 1);
+ break;
case OP_SET_LE:
value = sign_extend(value, def->size);
if (bits & sign_bit(def->size))