[PATCH 2/2] R600/SI: add sin-fold test case

Grigori Goronzy greg at chown.ath.cx
Thu Jul 17 14:50:05 PDT 2014


---
 test/CodeGen/R600/llvm.sin-fold.ll | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 test/CodeGen/R600/llvm.sin-fold.ll

diff --git a/test/CodeGen/R600/llvm.sin-fold.ll b/test/CodeGen/R600/llvm.sin-fold.ll
new file mode 100644
index 0000000..72d3e45
--- /dev/null
+++ b/test/CodeGen/R600/llvm.sin-fold.ll
@@ -0,0 +1,19 @@
+;RUN: llc < %s -march=r600 -enable-unsafe-fp-math -mcpu=SI | FileCheck %s -check-prefix=SI -check-prefix=FUNC
+
+;FUNC-LABEL: test
+;SI: 4.774
+;SI: V_MUL_F32
+;SI: V_FRACT_F32
+;SI: V_SIN_F32
+;SI-NOT: V_SIN_F32
+
+define void @test(float addrspace(1)* %out, float %x) #1 {
+   %y = fmul float 3.0, %x
+   %sin = call float @llvm.sin.f32(float %y)
+   store float %sin, float addrspace(1)* %out
+   ret void
+}
+
+declare float @llvm.sin.f32(float) readnone
+
+attributes #0 = { "ShaderType"="0" }
-- 
1.8.3.2




More information about the llvm-commits mailing list