aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
-rw-r--r--simplify.c12
-rw-r--r--validation/optim/cmp-sext-uimm.c1
2 files changed, 12 insertions, 1 deletions
diff --git a/simplify.c b/simplify.c
index a5991869..8a8b39b8 100644
--- a/simplify.c
+++ b/simplify.c
@@ -1149,6 +1149,18 @@ static int simplify_compare_constant(struct instruction *insn, long long value)
return replace_pseudo(insn, &insn->src1, def->src);
}
switch (insn->opcode) {
+ case OP_SET_BE:
+ if (value >= sign_bit(osize)) {
+ replace_binop_value(insn, OP_SET_GE, 0);
+ return replace_pseudo(insn, &insn->src1, def->src);
+ }
+ break;
+ case OP_SET_A:
+ if (value >= sign_bit(osize)) {
+ replace_binop_value(insn, OP_SET_LT, 0);
+ return replace_pseudo(insn, &insn->src1, def->src);
+ }
+ break;
case OP_SET_LT: case OP_SET_LE:
if (value >= sign_bit(osize))
return replace_with_value(insn, 1);
diff --git a/validation/optim/cmp-sext-uimm.c b/validation/optim/cmp-sext-uimm.c
index cc89a806..05da042f 100644
--- a/validation/optim/cmp-sext-uimm.c
+++ b/validation/optim/cmp-sext-uimm.c
@@ -19,7 +19,6 @@ int sext_gtu_m3(int x) { return (sext(x) > (NEG - 3)) == (x < 0); }
/*
* check-name: cmp-sext-uimm
* check-command: test-linearize -Wno-decl $file
- * check-known-to-fail
*
* check-output-ignore
* check-output-returns: 1