diff options
author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2021-01-31 23:17:24 +0100 |
---|---|---|
committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2021-03-10 22:42:45 +0100 |
commit | eb4cdd21b7d0cedbbeff7f70e24473706ccce5a6 (patch) | |
tree | 85c89a68df73271a21e5ec6fe56c88bb22e402b2 | |
parent | a0709118c62cffdecc2ec34c624884287ef3c088 (diff) | |
download | sparse-eb4cdd21b7d0cedbbeff7f70e24473706ccce5a6.tar.gz |
simplify (x | M) cmpu C
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r-- | simplify.c | 16 | ||||
-rw-r--r-- | validation/optim/cmpu-or0.c | 1 |
2 files changed, 16 insertions, 1 deletions
@@ -1324,6 +1324,22 @@ static int simplify_compare_constant(struct instruction *insn, long long value) if ((value & bits) != bits) return replace_with_value(insn, 1); break; + case OP_SET_B: + if (bits >= value) + return replace_with_value(insn, 0); + break; + case OP_SET_BE: + if (bits > value) + return replace_with_value(insn, 0); + break; + case OP_SET_AE: + if (bits > value) + return replace_with_value(insn, 1); + break; + case OP_SET_A: + if (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)) { diff --git a/validation/optim/cmpu-or0.c b/validation/optim/cmpu-or0.c index 77360d3f..e97e9180 100644 --- a/validation/optim/cmpu-or0.c +++ b/validation/optim/cmpu-or0.c @@ -12,7 +12,6 @@ int cmpu_ior_gt_lt(int a) { return ((a | MASK) > (MASK - 1)) EQ(1); } /* * check-name: cmpu-or0 * check-command: test-linearize -Wno-decl $file - * check-known-to-fail * * check-output-ignore * check-output-returns: 1 |