[PATCH 4/9] simplify (x & M) cmpu C

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 simplify.c                   | 16 ++++++++++++++++
 validation/optim/cmpu-and0.c |  1 -
 2 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/simplify.c b/simplify.c
index 90b0c5ba0127..ee29c9619bdc 100644
--- a/simplify.c
+++ b/simplify.c
@@ -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)
diff --git a/validation/optim/cmpu-and0.c b/validation/optim/cmpu-and0.c
index 253212941779..927b9fb65f52 100644
--- a/validation/optim/cmpu-and0.c
+++ b/validation/optim/cmpu-and0.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
-- 
2.30.0




[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux