1 ; RUN: llc -march=r600 -mcpu=redwood < %s | FileCheck -check-prefix=EG -check-prefix=FUNC %s
2 ; RUN: llc -march=amdgcn -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
8 ; EG: SIN * T{{[0-9]+\.[XYZW], PV\.[XYZW]}}
15 define amdgpu_kernel void @sin_f32(float addrspace(1)* %out, float %x) #1 {
16 %sin = call float @llvm.sin.f32(float %x)
17 store float %sin, float addrspace(1)* %out
21 ; FUNC-LABEL: {{^}}safe_sin_3x_f32:
27 define amdgpu_kernel void @safe_sin_3x_f32(float addrspace(1)* %out, float %x) #1 {
28 %y = fmul float 3.0, %x
29 %sin = call float @llvm.sin.f32(float %y)
30 store float %sin, float addrspace(1)* %out
34 ; FUNC-LABEL: {{^}}unsafe_sin_3x_f32:
41 define amdgpu_kernel void @unsafe_sin_3x_f32(float addrspace(1)* %out, float %x) #2 {
42 %y = fmul float 3.0, %x
43 %sin = call float @llvm.sin.f32(float %y)
44 store float %sin, float addrspace(1)* %out
48 ; FUNC-LABEL: {{^}}safe_sin_2x_f32:
54 define amdgpu_kernel void @safe_sin_2x_f32(float addrspace(1)* %out, float %x) #1 {
55 %y = fmul float 2.0, %x
56 %sin = call float @llvm.sin.f32(float %y)
57 store float %sin, float addrspace(1)* %out
61 ; FUNC-LABEL: {{^}}unsafe_sin_2x_f32:
68 define amdgpu_kernel void @unsafe_sin_2x_f32(float addrspace(1)* %out, float %x) #2 {
69 %y = fmul float 2.0, %x
70 %sin = call float @llvm.sin.f32(float %y)
71 store float %sin, float addrspace(1)* %out
75 ; FUNC-LABEL: {{^}}test_safe_2sin_f32:
81 define amdgpu_kernel void @test_safe_2sin_f32(float addrspace(1)* %out, float %x) #1 {
82 %y = fmul float 2.0, %x
83 %sin = call float @llvm.sin.f32(float %y)
84 store float %sin, float addrspace(1)* %out
88 ; FUNC-LABEL: {{^}}test_unsafe_2sin_f32:
94 define amdgpu_kernel void @test_unsafe_2sin_f32(float addrspace(1)* %out, float %x) #2 {
95 %y = fmul float 2.0, %x
96 %sin = call float @llvm.sin.f32(float %y)
97 store float %sin, float addrspace(1)* %out
101 ; FUNC-LABEL: {{^}}sin_v4f32:
102 ; EG: SIN * T{{[0-9]+\.[XYZW], PV\.[XYZW]}}
103 ; EG: SIN * T{{[0-9]+\.[XYZW], PV\.[XYZW]}}
104 ; EG: SIN * T{{[0-9]+\.[XYZW], PV\.[XYZW]}}
105 ; EG: SIN * T{{[0-9]+\.[XYZW], PV\.[XYZW]}}
113 define amdgpu_kernel void @sin_v4f32(<4 x float> addrspace(1)* %out, <4 x float> %vx) #1 {
114 %sin = call <4 x float> @llvm.sin.v4f32( <4 x float> %vx)
115 store <4 x float> %sin, <4 x float> addrspace(1)* %out
119 declare float @llvm.sin.f32(float) #0
120 declare <4 x float> @llvm.sin.v4f32(<4 x float>) #0
122 attributes #0 = { nounwind readnone }
123 attributes #1 = { nounwind "unsafe-fp-math"="false" }
124 attributes #2 = { nounwind "unsafe-fp-math"="true" }