summaryrefslogtreecommitdiff
path: root/test/CodeGen/PowerPC/i1-to-double.ll
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2014-03-05 22:14:00 +0000
committerHal Finkel <hfinkel@anl.gov>2014-03-05 22:14:00 +0000
commitf698d7775a96afd6385b0f9b9c66646df8feb88a (patch)
tree6b03605550f2748441a869df4a0a8bef941aa190 /test/CodeGen/PowerPC/i1-to-double.ll
parentaf0cc459bf5fdce42f723e575ae8c320752ac3e1 (diff)
With PPC CR bit registers, handle int_to_fp on older cores
On cores without fpcvt support, we cannot promote int_to_fp i1 operations, because there is nothing to promote them to. The most straightforward implementation of this uses a select to choose between the two possible resulting floating-point values (and that's what is done here). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203015 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/PowerPC/i1-to-double.ll')
-rw-r--r--test/CodeGen/PowerPC/i1-to-double.ll21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/CodeGen/PowerPC/i1-to-double.ll b/test/CodeGen/PowerPC/i1-to-double.ll
new file mode 100644
index 00000000000..e3d9fc2ab22
--- /dev/null
+++ b/test/CodeGen/PowerPC/i1-to-double.ll
@@ -0,0 +1,21 @@
+; RUN: llc -march=ppc32 -mcpu=ppc32 -mtriple=powerpc-unknown-linux-gnu < %s | FileCheck %s
+define double @test(i1 %X) {
+ %Y = uitofp i1 %X to double
+ ret double %Y
+}
+
+; CHECK-LABEL: @test
+
+; CHECK: andi. {{[0-9]+}}, 3, 1
+; CHECK: bc 12, 1,
+
+; CHECK: li 3, .LCP[[L1:[A-Z0-9_]+]]@l
+; CHECK: addis 3, 3, .LCP[[L1]]@ha
+; CHECK: lfs 1, 0(3)
+; CHECK: blr
+
+; CHECK: li 3, .LCP[[L2:[A-Z0-9_]+]]@l
+; CHECK: addis 3, 3, .LCP[[L2]]@ha
+; CHECK: lfs 1, 0(3)
+; CHECK: blr
+