@@ -1281,6 +1281,22 @@ static int simplify_compare_constant(struct instruction *insn, long long value)
if (value >= (long long)bits)
return replace_with_value(insn, 0);
break;
+ case OP_SET_B:
+ if (value > bits)
+ return replace_with_value(insn, 1);
+ break;
+ case OP_SET_BE:
+ if (value >= bits)
+ return replace_with_value(insn, 1);
+ break;
+ case OP_SET_AE:
+ if (value > bits)
+ return replace_with_value(insn, 0);
+ break;
+ case OP_SET_A:
+ if (value >= bits)
+ return replace_with_value(insn, 0);
+ break;
}
break;
case OP_SEXT: // sext(x) cmp C --> x cmp trunc(C)
@@ -11,7 +11,6 @@ int cmps_and_gtu_eq(int a) { return ((a & MASK) > (MASK + 0)) + 1; }
/*
* check-name: cmpu-and0
* check-command: test-linearize -Wno-decl $file
- * check-known-to-fail
*
* check-output-ignore
* check-output-returns: 1
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com> --- simplify.c | 16 ++++++++++++++++ validation/optim/cmpu-and0.c | 1 - 2 files changed, 16 insertions(+), 1 deletion(-)