summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorJustin Holewinski <justin.holewinski@gmail.com>2011-04-28 00:19:51 +0000
committerJustin Holewinski <justin.holewinski@gmail.com>2011-04-28 00:19:51 +0000
commit18e6ac83ea4649765d14a2d2f012fcd8611a798c (patch)
tree53d0ec3e5ba8db6e890069cf48b745acbcfb5573 /llvm/test
parent638f0eb116aa01c9ce1ec25fc82cedc3726a6eb0 (diff)
downloadbcm5719-llvm-18e6ac83ea4649765d14a2d2f012fcd8611a798c.tar.gz
bcm5719-llvm-18e6ac83ea4649765d14a2d2f012fcd8611a798c.zip
PTX: support for bitwise operations on predicates
- selection of bitwise preds (AND, OR, XOR) - new bitwise.ll test Patch by Dan Bailey llvm-svn: 130353
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/CodeGen/PTX/bitwise.ll24
1 files changed, 24 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/PTX/bitwise.ll b/llvm/test/CodeGen/PTX/bitwise.ll
new file mode 100644
index 00000000000..dbc77e53330
--- /dev/null
+++ b/llvm/test/CodeGen/PTX/bitwise.ll
@@ -0,0 +1,24 @@
+; RUN: llc < %s -march=ptx32 | FileCheck %s
+
+; preds
+
+define ptx_device i32 @t1_and_preds(i1 %x, i1 %y) {
+; CHECK: and.pred p0, p1, p2
+ %c = and i1 %x, %y
+ %d = zext i1 %c to i32
+ ret i32 %d
+}
+
+define ptx_device i32 @t1_or_preds(i1 %x, i1 %y) {
+; CHECK: or.pred p0, p1, p2
+ %a = or i1 %x, %y
+ %b = zext i1 %a to i32
+ ret i32 %b
+}
+
+define ptx_device i32 @t1_xor_preds(i1 %x, i1 %y) {
+; CHECK: xor.pred p0, p1, p2
+ %a = xor i1 %x, %y
+ %b = zext i1 %a to i32
+ ret i32 %b
+}
OpenPOWER on IntegriCloud