aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/optim/set-uimm2.c
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-11-09 23:53:45 +0100
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-11-09 23:53:45 +0100
commit98469166098170fc67d3eb043656c3e79190b31f (patch)
treed38b631f527a85e7393867b3381230271c12194f /validation/optim/set-uimm2.c
parent55d44f307c12fe0241d0a12e1dfe0320a54510af (diff)
parentc60237251a55984b1fcf6302d25650d35533dc2a (diff)
downloadsparse-dev-98469166098170fc67d3eb043656c3e79190b31f.tar.gz
Merge branch 'optim-cmp' into next
* simplify & canonicalize compares
Diffstat (limited to 'validation/optim/set-uimm2.c')
-rw-r--r--validation/optim/set-uimm2.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/validation/optim/set-uimm2.c b/validation/optim/set-uimm2.c
new file mode 100644
index 00000000..9138ae72
--- /dev/null
+++ b/validation/optim/set-uimm2.c
@@ -0,0 +1,12 @@
+static _Bool setlt_umax(unsigned int a) { return (a < ~0) == (a != ~0); }
+static _Bool setle_umax(unsigned int a) { return (a <= ~1) == (a != ~0); }
+static _Bool setge_umax(unsigned int a) { return (a >= ~0) == (a == ~0); }
+static _Bool setgt_umax(unsigned int a) { return (a > ~1) == (a == ~0); }
+
+/*
+ * check-name: set-uimm2
+ * check-command: test-linearize $file
+ *
+ * check-output-ignore
+ * check-output-returns: 1
+ */