summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2013-07-12 18:14:56 +0000
committerTom Stellard <thomas.stellard@amd.com>2013-07-12 18:14:56 +0000
commit7512c0803cdce7713c81dbbaee17b65abdc8b9b1 (patch)
tree86370cfdce033c66fabde9bb50a83cc37df9e6a4 /llvm/test
parent2d17f67651967de5394dd3161c7b0bf804e7edb5 (diff)
downloadbcm5719-llvm-7512c0803cdce7713c81dbbaee17b65abdc8b9b1.tar.gz
bcm5719-llvm-7512c0803cdce7713c81dbbaee17b65abdc8b9b1.zip
R600/SI: Add initial double precision support for SI
Patch by: Niels Ole Salscheider Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 186177
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/CodeGen/R600/fadd64.ll13
-rw-r--r--llvm/test/CodeGen/R600/fdiv64.ll14
-rw-r--r--llvm/test/CodeGen/R600/fmul64.ll13
-rw-r--r--llvm/test/CodeGen/R600/load64.ll20
4 files changed, 60 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/R600/fadd64.ll b/llvm/test/CodeGen/R600/fadd64.ll
new file mode 100644
index 00000000000..130302f634f
--- /dev/null
+++ b/llvm/test/CodeGen/R600/fadd64.ll
@@ -0,0 +1,13 @@
+; RUN: llc < %s -march=r600 -mcpu=tahiti | FileCheck %s
+
+; CHECK: @fadd_f64
+; CHECK: V_ADD_F64 {{VGPR[0-9]+_VGPR[0-9]+, VGPR[0-9]+_VGPR[0-9]+, VGPR[0-9]+_VGPR[0-9]+}}
+
+define void @fadd_f64(double addrspace(1)* %out, double addrspace(1)* %in1,
+ double addrspace(1)* %in2) {
+ %r0 = load double addrspace(1)* %in1
+ %r1 = load double addrspace(1)* %in2
+ %r2 = fadd double %r0, %r1
+ store double %r2, double addrspace(1)* %out
+ ret void
+}
diff --git a/llvm/test/CodeGen/R600/fdiv64.ll b/llvm/test/CodeGen/R600/fdiv64.ll
new file mode 100644
index 00000000000..76c5ca37697
--- /dev/null
+++ b/llvm/test/CodeGen/R600/fdiv64.ll
@@ -0,0 +1,14 @@
+; RUN: llc < %s -march=r600 -mcpu=tahiti | FileCheck %s
+
+; CHECK: @fdiv_f64
+; CHECK: V_RCP_F64_e32 {{VGPR[0-9]+_VGPR[0-9]+}}
+; CHECK: V_MUL_F64 {{VGPR[0-9]+_VGPR[0-9]+, VGPR[0-9]+_VGPR[0-9]+, VGPR[0-9]+_VGPR[0-9]+}}
+
+define void @fdiv_f64(double addrspace(1)* %out, double addrspace(1)* %in1,
+ double addrspace(1)* %in2) {
+ %r0 = load double addrspace(1)* %in1
+ %r1 = load double addrspace(1)* %in2
+ %r2 = fdiv double %r0, %r1
+ store double %r2, double addrspace(1)* %out
+ ret void
+}
diff --git a/llvm/test/CodeGen/R600/fmul64.ll b/llvm/test/CodeGen/R600/fmul64.ll
new file mode 100644
index 00000000000..8a57d4a86b3
--- /dev/null
+++ b/llvm/test/CodeGen/R600/fmul64.ll
@@ -0,0 +1,13 @@
+; RUN: llc < %s -march=r600 -mcpu=tahiti | FileCheck %s
+
+; CHECK: @fmul_f64
+; CHECK: V_MUL_F64 {{VGPR[0-9]+_VGPR[0-9]+, VGPR[0-9]+_VGPR[0-9]+, VGPR[0-9]+_VGPR[0-9]+}}
+
+define void @fmul_f64(double addrspace(1)* %out, double addrspace(1)* %in1,
+ double addrspace(1)* %in2) {
+ %r0 = load double addrspace(1)* %in1
+ %r1 = load double addrspace(1)* %in2
+ %r2 = fmul double %r0, %r1
+ store double %r2, double addrspace(1)* %out
+ ret void
+}
diff --git a/llvm/test/CodeGen/R600/load64.ll b/llvm/test/CodeGen/R600/load64.ll
new file mode 100644
index 00000000000..3b4a8f8f3b0
--- /dev/null
+++ b/llvm/test/CodeGen/R600/load64.ll
@@ -0,0 +1,20 @@
+; RUN: llc < %s -march=r600 -mcpu=tahiti | FileCheck %s
+
+; load a f64 value from the global address space.
+; CHECK: @load_f64
+; CHECK: BUFFER_LOAD_DWORDX2 VGPR{{[0-9]+}}
+define void @load_f64(double addrspace(1)* %out, double addrspace(1)* %in) {
+entry:
+ %0 = load double addrspace(1)* %in
+ store double %0, double addrspace(1)* %out
+ ret void
+}
+
+; Load a f64 value from the constant address space.
+; CHECK: @load_const_addrspace_f64
+; CHECK: S_LOAD_DWORDX2 SGPR{{[0-9]+}}
+define void @load_const_addrspace_f64(double addrspace(1)* %out, double addrspace(2)* %in) {
+ %1 = load double addrspace(2)* %in
+ store double %1, double addrspace(1)* %out
+ ret void
+}
OpenPOWER on IntegriCloud