1 ; RUN: llc -march=r600 -mcpu=redwood < %s | FileCheck -check-prefix=EG -check-prefix=FUNC %s
2 ; RUN: llc -march=amdgcn -mcpu=kaveri -verify-machineinstrs < %s | FileCheck -check-prefixes=GCN,SICIVI,FUNC %s
3 ; RUN: llc -march=amdgcn -mcpu=tahiti -verify-machineinstrs < %s | FileCheck -check-prefixes=GCN,SICIVI,FUNC %s
4 ; RUN: llc -march=amdgcn -mcpu=fiji -verify-machineinstrs < %s | FileCheck -check-prefixes=GCN,SICIVI,FUNC %s
5 ; RUN: llc -march=amdgcn -mcpu=gfx900 -verify-machineinstrs < %s | FileCheck -check-prefixes=GCN,GFX9,FUNC %s
11 ; EG: SIN * T{{[0-9]+\.[XYZW], PV\.[XYZW]}}
16 ; GFX9-NOT: v_fract_f32
19 define amdgpu_kernel void @sin_f32(float addrspace(1)* %out, float %x) #1 {
20 %sin = call float @llvm.sin.f32(float %x)
21 store float %sin, float addrspace(1)* %out
25 ; FUNC-LABEL: {{^}}safe_sin_3x_f32:
29 ; GFX9-NOT: v_fract_f32
32 define amdgpu_kernel void @safe_sin_3x_f32(float addrspace(1)* %out, float %x) #1 {
33 %y = fmul float 3.0, %x
34 %sin = call float @llvm.sin.f32(float %y)
35 store float %sin, float addrspace(1)* %out
39 ; FUNC-LABEL: {{^}}unsafe_sin_3x_f32:
44 ; GFX9-NOT: v_fract_f32
47 define amdgpu_kernel void @unsafe_sin_3x_f32(float addrspace(1)* %out, float %x) #2 {
48 %y = fmul float 3.0, %x
49 %sin = call float @llvm.sin.f32(float %y)
50 store float %sin, float addrspace(1)* %out
54 ; FUNC-LABEL: {{^}}safe_sin_2x_f32:
58 ; GFX9-NOT: v_fract_f32
61 define amdgpu_kernel void @safe_sin_2x_f32(float addrspace(1)* %out, float %x) #1 {
62 %y = fmul float 2.0, %x
63 %sin = call float @llvm.sin.f32(float %y)
64 store float %sin, float addrspace(1)* %out
68 ; FUNC-LABEL: {{^}}unsafe_sin_2x_f32:
73 ; GFX9-NOT: v_fract_f32
76 define amdgpu_kernel void @unsafe_sin_2x_f32(float addrspace(1)* %out, float %x) #2 {
77 %y = fmul float 2.0, %x
78 %sin = call float @llvm.sin.f32(float %y)
79 store float %sin, float addrspace(1)* %out
83 ; FUNC-LABEL: {{^}}test_safe_2sin_f32:
87 ; GFX9-NOT: v_fract_f32
90 define amdgpu_kernel void @test_safe_2sin_f32(float addrspace(1)* %out, float %x) #1 {
91 %y = fmul float 2.0, %x
92 %sin = call float @llvm.sin.f32(float %y)
93 store float %sin, float addrspace(1)* %out
97 ; FUNC-LABEL: {{^}}test_unsafe_2sin_f32:
100 ; SICIVI: v_fract_f32
101 ; GFX9-NOT: v_fract_f32
104 define amdgpu_kernel void @test_unsafe_2sin_f32(float addrspace(1)* %out, float %x) #2 {
105 %y = fmul float 2.0, %x
106 %sin = call float @llvm.sin.f32(float %y)
107 store float %sin, float addrspace(1)* %out
111 ; FUNC-LABEL: {{^}}sin_v4f32:
112 ; EG: SIN * T{{[0-9]+\.[XYZW], PV\.[XYZW]}}
113 ; EG: SIN * T{{[0-9]+\.[XYZW], PV\.[XYZW]}}
114 ; EG: SIN * T{{[0-9]+\.[XYZW], PV\.[XYZW]}}
115 ; EG: SIN * T{{[0-9]+\.[XYZW], PV\.[XYZW]}}
123 define amdgpu_kernel void @sin_v4f32(<4 x float> addrspace(1)* %out, <4 x float> %vx) #1 {
124 %sin = call <4 x float> @llvm.sin.v4f32( <4 x float> %vx)
125 store <4 x float> %sin, <4 x float> addrspace(1)* %out
129 declare float @llvm.sin.f32(float) #0
130 declare <4 x float> @llvm.sin.v4f32(<4 x float>) #0
132 attributes #0 = { nounwind readnone }
133 attributes #1 = { nounwind "unsafe-fp-math"="false" }
134 attributes #2 = { nounwind "unsafe-fp-math"="true" }