aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/backend/cmp-ops.c
diff options
authorPekka Enberg <penberg@kernel.org>2011-11-22 21:41:12 +0200
committerPekka Enberg <penberg@kernel.org>2011-11-22 22:06:37 +0200
commitce2aacc7ce377c9871e8a5c362d2c7c0aae8ebd6 (patch)
tree8618eebd86d2fa12fd55730fb95d198732017017 /validation/backend/cmp-ops.c
parent58f7c712b643db22fe46ecfb9fa39a93a57ddfa9 (diff)
downloadsparse-dev-ce2aacc7ce377c9871e8a5c362d2c7c0aae8ebd6.tar.gz
sparse, llvm: FP comparison op code generation
This patch implements code generation for floating point versions of OP_BINCMP. Acked-by: Linus Torvalds <torvalds@linux-foundation.org> Cc: Christopher Li <sparse@chrisli.org> Cc: Jeff Garzik <jgarzik@redhat.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
Diffstat (limited to 'validation/backend/cmp-ops.c')
-rw-r--r--validation/backend/cmp-ops.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/validation/backend/cmp-ops.c b/validation/backend/cmp-ops.c
index 7bbc81ce..a5f736d7 100644
--- a/validation/backend/cmp-ops.c
+++ b/validation/backend/cmp-ops.c
@@ -48,6 +48,36 @@ static int setae(unsigned int x, unsigned int y)
return x >= y;
}
+static int setfe(float x, float y)
+{
+ return x == y;
+}
+
+static int setfne(float x, float y)
+{
+ return x != y;
+}
+
+static int setfl(float x, float y)
+{
+ return x < y;
+}
+
+static int setfg(float x, float y)
+{
+ return x > y;
+}
+
+static int setfle(float x, float y)
+{
+ return x <= y;
+}
+
+static int setfge(float x, float y)
+{
+ return x >= y;
+}
+
/*
* check-name: Comparison operator code generation
* check-command: ./sparsec -c $file -o tmp.o