aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/R600/fmad.ll
diff options
context:
space:
mode:
authorVincent Lejeune <vljn@ovi.com>2013-02-18 14:11:28 +0000
committerVincent Lejeune <vljn@ovi.com>2013-02-18 14:11:28 +0000
commite3111964a0902bc38440980b0915b189f829c395 (patch)
tree336a643e8a9a838c7847a364fe47de03aebb80c4 /test/CodeGen/R600/fmad.ll
parentbbbef49118809c6a8d424a9434a70c0fdc3a66d5 (diff)
downloadexternal_llvm-e3111964a0902bc38440980b0915b189f829c395.zip
external_llvm-e3111964a0902bc38440980b0915b189f829c395.tar.gz
external_llvm-e3111964a0902bc38440980b0915b189f829c395.tar.bz2
R600/SI: Use MULADD_IEEE/V_MAD_F32 instruction for mad pattern
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175446 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/R600/fmad.ll')
-rw-r--r--test/CodeGen/R600/fmad.ll19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/CodeGen/R600/fmad.ll b/test/CodeGen/R600/fmad.ll
new file mode 100644
index 0000000..a3d4d0f
--- /dev/null
+++ b/test/CodeGen/R600/fmad.ll
@@ -0,0 +1,19 @@
+;RUN: llc < %s -march=r600 -mcpu=redwood | FileCheck %s
+
+;CHECK: MULADD_IEEE T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW], T[0-9]+\.[XYZW], T[0-9]+\.[XYZW]}}
+
+define void @test() {
+ %r0 = call float @llvm.R600.load.input(i32 0)
+ %r1 = call float @llvm.R600.load.input(i32 1)
+ %r2 = call float @llvm.R600.load.input(i32 2)
+ %r3 = fmul float %r0, %r1
+ %r4 = fadd float %r3, %r2
+ call void @llvm.AMDGPU.store.output(float %r4, i32 0)
+ ret void
+}
+
+declare float @llvm.R600.load.input(i32) readnone
+
+declare void @llvm.AMDGPU.store.output(float, i32)
+
+declare float @fabs(float ) readnone