summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNiels Ole Salscheider <niels_ole@salscheider-online.de>2013-08-08 16:06:08 +0000
committerNiels Ole Salscheider <niels_ole@salscheider-online.de>2013-08-08 16:06:08 +0000
commit7114e2e7cff35364230795123d9049b96098725e (patch)
tree28260c27461f2df929fcedddd053d2eebaed4c48 /test
parent91955e78e718b4a7d2272ce476e29774f6ac84ea (diff)
downloadllvm-7114e2e7cff35364230795123d9049b96098725e.tar.gz
llvm-7114e2e7cff35364230795123d9049b96098725e.tar.bz2
llvm-7114e2e7cff35364230795123d9049b96098725e.tar.xz
R600/SI: Implement sint<->fp64 conversions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187987 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/R600/fp64_to_sint.ll9
-rw-r--r--test/CodeGen/R600/sint_to_fp64.ll9
2 files changed, 18 insertions, 0 deletions
diff --git a/test/CodeGen/R600/fp64_to_sint.ll b/test/CodeGen/R600/fp64_to_sint.ll
new file mode 100644
index 0000000000..42f9f3403a
--- /dev/null
+++ b/test/CodeGen/R600/fp64_to_sint.ll
@@ -0,0 +1,9 @@
+; RUN: llc < %s -march=r600 -mcpu=SI | FileCheck %s --check-prefix=CHECK
+
+; CHECK: @fp64_to_sint
+; CHECK: V_CVT_I32_F64_e32
+define void @fp64_to_sint(i32 addrspace(1)* %out, double %in) {
+ %result = fptosi double %in to i32
+ store i32 %result, i32 addrspace(1)* %out
+ ret void
+}
diff --git a/test/CodeGen/R600/sint_to_fp64.ll b/test/CodeGen/R600/sint_to_fp64.ll
new file mode 100644
index 0000000000..37f67c94d2
--- /dev/null
+++ b/test/CodeGen/R600/sint_to_fp64.ll
@@ -0,0 +1,9 @@
+; RUN: llc < %s -march=r600 -mcpu=SI | FileCheck %s --check-prefix=CHECK
+
+; CHECK: @sint_to_fp64
+; CHECK: V_CVT_F64_I32_e32
+define void @sint_to_fp64(double addrspace(1)* %out, i32 %in) {
+ %result = sitofp i32 %in to double
+ store double %result, double addrspace(1)* %out
+ ret void
+}