@@ -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))
@@ -4,7 +4,6 @@ int cmpe_and_ne(int a) { return ((a & 0xff00) != 0xff01) + 0; }
/*
* check-name: cmpe-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 | 8 ++++++++ validation/optim/cmpe-and0.c | 1 - 2 files changed, 8 insertions(+), 1 deletion(-)