diff options
| author | Pekka Enberg <penberg@kernel.org> | 2011-11-22 19:33:19 +0200 |
|---|---|---|
| committer | Pekka Enberg <penberg@kernel.org> | 2011-11-22 22:06:02 +0200 |
| commit | b08efe9f3e4513b3418dce040340e9fffa42bc15 (patch) | |
| tree | 41c7e135351c4519b203967e131e414f4a1bb8c1 /validation/backend/cmp-ops.c | |
| parent | d3e0567c425b6334e4ae71d5067ded447b5a9d75 (diff) | |
| download | sparse-dev-b08efe9f3e4513b3418dce040340e9fffa42bc15.tar.gz | |
sparse, llvm: More comparison ops code generation
This patch implements LLVM code generation for OP_SET_LE, OP_SET_GE, OP_SET_BE,
and OP_SET_AE.
Cc: Christopher Li <sparse@chrisli.org>
Cc: Jeff Garzik <jgarzik@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
Diffstat (limited to 'validation/backend/cmp-ops.c')
| -rw-r--r-- | validation/backend/cmp-ops.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/validation/backend/cmp-ops.c b/validation/backend/cmp-ops.c index b1ad2275..7bbc81ce 100644 --- a/validation/backend/cmp-ops.c +++ b/validation/backend/cmp-ops.c @@ -18,6 +18,16 @@ static int setg(int x, int y) return x > y; } +static int setle(int x, int y) +{ + return x <= y; +} + +static int setge(int x, int y) +{ + return x >= y; +} + static int setb(unsigned int x, unsigned int y) { return x < y; @@ -28,6 +38,16 @@ static int seta(unsigned int x, unsigned int y) return x > y; } +static int setbe(unsigned int x, unsigned int y) +{ + return x <= y; +} + +static int setae(unsigned int x, unsigned int y) +{ + return x >= y; +} + /* * check-name: Comparison operator code generation * check-command: ./sparsec -c $file -o tmp.o |
