aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/simplify.c
diff options
context:
space:
mode:
Diffstat (limited to 'simplify.c')
-rw-r--r--simplify.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/simplify.c b/simplify.c
index ee29c961..6c11018e 100644
--- a/simplify.c
+++ b/simplify.c
@@ -1271,6 +1271,8 @@ static int simplify_compare_constant(struct instruction *insn, long long value)
return replace_with_value(insn, 0);
if (value >= (long long)bits)
return replace_with_value(insn, 1);
+ if (value == 0)
+ return replace_opcode(insn, OP_SET_EQ);
break;
case OP_SET_GT:
value = sign_extend(value, def->size);
@@ -1280,6 +1282,8 @@ static int simplify_compare_constant(struct instruction *insn, long long value)
return replace_with_value(insn, 1);
if (value >= (long long)bits)
return replace_with_value(insn, 0);
+ if (value == 0)
+ return replace_opcode(insn, OP_SET_NE);
break;
case OP_SET_B:
if (value > bits)