summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorJustin Holewinski <justin.holewinski@gmail.com>2011-03-10 16:57:18 +0000
committerJustin Holewinski <justin.holewinski@gmail.com>2011-03-10 16:57:18 +0000
commit72ff7e4fa916da914aed907389d6db00af68daee (patch)
treef9fd7a1faccb625d9d90334cc90a610b5ccc1ed5 /llvm/test
parentea5a137e558f36602616268ede35dcfeb92aa3e3 (diff)
downloadbcm5719-llvm-72ff7e4fa916da914aed907389d6db00af68daee.tar.gz
bcm5719-llvm-72ff7e4fa916da914aed907389d6db00af68daee.zip
PTX: Add preliminary support for floating-point divide and multiply-and-add
llvm-svn: 127410
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/CodeGen/PTX/fdiv-sm10.ll15
-rw-r--r--llvm/test/CodeGen/PTX/fdiv-sm13.ll15
-rw-r--r--llvm/test/CodeGen/PTX/mad.ll17
3 files changed, 47 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/PTX/fdiv-sm10.ll b/llvm/test/CodeGen/PTX/fdiv-sm10.ll
new file mode 100644
index 00000000000..42f615d0c8d
--- /dev/null
+++ b/llvm/test/CodeGen/PTX/fdiv-sm10.ll
@@ -0,0 +1,15 @@
+; RUN: llc < %s -march=ptx -mattr=+sm10 | FileCheck %s
+
+define ptx_device float @t1_f32(float %x, float %y) {
+; CHECK: div.approx.f32 f0, f1, f2;
+; CHECK-NEXT: ret;
+ %a = fdiv float %x, %y
+ ret float %a
+}
+
+define ptx_device double @t1_f64(double %x, double %y) {
+; CHECK: div.f64 fd0, fd1, fd2;
+; CHECK-NEXT: ret;
+ %a = fdiv double %x, %y
+ ret double %a
+}
diff --git a/llvm/test/CodeGen/PTX/fdiv-sm13.ll b/llvm/test/CodeGen/PTX/fdiv-sm13.ll
new file mode 100644
index 00000000000..eb20f787639
--- /dev/null
+++ b/llvm/test/CodeGen/PTX/fdiv-sm13.ll
@@ -0,0 +1,15 @@
+; RUN: llc < %s -march=ptx -mattr=+sm13 | FileCheck %s
+
+define ptx_device float @t1_f32(float %x, float %y) {
+; CHECK: div.approx.f32 f0, f1, f2;
+; CHECK-NEXT: ret;
+ %a = fdiv float %x, %y
+ ret float %a
+}
+
+define ptx_device double @t1_f64(double %x, double %y) {
+; CHECK: div.rn.f64 fd0, fd1, fd2;
+; CHECK-NEXT: ret;
+ %a = fdiv double %x, %y
+ ret double %a
+}
diff --git a/llvm/test/CodeGen/PTX/mad.ll b/llvm/test/CodeGen/PTX/mad.ll
new file mode 100644
index 00000000000..56c77eb48ef
--- /dev/null
+++ b/llvm/test/CodeGen/PTX/mad.ll
@@ -0,0 +1,17 @@
+; RUN: llc < %s -march=ptx | FileCheck %s
+
+define ptx_device float @t1_f32(float %x, float %y, float %z) {
+; CHECK: mad.rn.f32 f0, f1, f2, f3;
+; CHECK-NEXT: ret;
+ %a = fmul float %x, %y
+ %b = fadd float %a, %z
+ ret float %b
+}
+
+define ptx_device double @t1_f64(double %x, double %y, double %z) {
+; CHECK: mad.rn.f64 fd0, fd1, fd2, fd3;
+; CHECK-NEXT: ret;
+ %a = fmul double %x, %y
+ %b = fadd double %a, %z
+ ret double %b
+}
OpenPOWER on IntegriCloud