summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorJustin Holewinski <jholewinski@nvidia.com>2013-08-06 14:13:34 +0000
committerJustin Holewinski <jholewinski@nvidia.com>2013-08-06 14:13:34 +0000
commitdebe686f05d383b4cc8b8cf0760423195152a5bd (patch)
tree2033b63170ed4f0b40a104b5277fd276b2adbfa4 /llvm/test
parent871ec93909cca61ea80a1642401c05ed63b11ff3 (diff)
downloadbcm5719-llvm-debe686f05d383b4cc8b8cf0760423195152a5bd.tar.gz
bcm5719-llvm-debe686f05d383b4cc8b8cf0760423195152a5bd.zip
[NVPTX] Add missing patterns for i1 [s,u]int_to_fp
llvm-svn: 187800
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/CodeGen/NVPTX/i1-int-to-fp.ll37
1 files changed, 37 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/NVPTX/i1-int-to-fp.ll b/llvm/test/CodeGen/NVPTX/i1-int-to-fp.ll
new file mode 100644
index 00000000000..3979179399e
--- /dev/null
+++ b/llvm/test/CodeGen/NVPTX/i1-int-to-fp.ll
@@ -0,0 +1,37 @@
+; RUN: llc < %s -march=nvptx -mcpu=sm_20 | FileCheck %s
+
+; CHECK-LABEL: foo
+; CHECK: setp
+; CHECK: selp
+; CHECK: cvt.rn.f32.u32
+define float @foo(i1 %a) {
+ %ret = uitofp i1 %a to float
+ ret float %ret
+}
+
+; CHECK-LABEL: foo2
+; CHECK: setp
+; CHECK: selp
+; CHECK: cvt.rn.f32.s32
+define float @foo2(i1 %a) {
+ %ret = sitofp i1 %a to float
+ ret float %ret
+}
+
+; CHECK-LABEL: foo3
+; CHECK: setp
+; CHECK: selp
+; CHECK: cvt.rn.f64.u32
+define double @foo3(i1 %a) {
+ %ret = uitofp i1 %a to double
+ ret double %ret
+}
+
+; CHECK-LABEL: foo4
+; CHECK: setp
+; CHECK: selp
+; CHECK: cvt.rn.f64.s32
+define double @foo4(i1 %a) {
+ %ret = sitofp i1 %a to double
+ ret double %ret
+}
OpenPOWER on IntegriCloud