1*9880d681SAndroid Build Coastguard Worker; RUN: llc -march=r600 -mcpu=redwood < %s | FileCheck -check-prefix=EG -check-prefix=FUNC %s 2*9880d681SAndroid Build Coastguard Worker; RUN: llc -march=amdgcn -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s 3*9880d681SAndroid Build Coastguard Worker 4*9880d681SAndroid Build Coastguard Worker; FUNC-LABEL: sin_f32 5*9880d681SAndroid Build Coastguard Worker; EG: MULADD_IEEE * 6*9880d681SAndroid Build Coastguard Worker; EG: FRACT * 7*9880d681SAndroid Build Coastguard Worker; EG: ADD * 8*9880d681SAndroid Build Coastguard Worker; EG: SIN * T{{[0-9]+\.[XYZW], PV\.[XYZW]}} 9*9880d681SAndroid Build Coastguard Worker; EG-NOT: SIN 10*9880d681SAndroid Build Coastguard Worker 11*9880d681SAndroid Build Coastguard Worker; SI: v_mul_f32 12*9880d681SAndroid Build Coastguard Worker; SI: v_fract_f32 13*9880d681SAndroid Build Coastguard Worker; SI: v_sin_f32 14*9880d681SAndroid Build Coastguard Worker; SI-NOT: v_sin_f32 15*9880d681SAndroid Build Coastguard Workerdefine void @sin_f32(float addrspace(1)* %out, float %x) #1 { 16*9880d681SAndroid Build Coastguard Worker %sin = call float @llvm.sin.f32(float %x) 17*9880d681SAndroid Build Coastguard Worker store float %sin, float addrspace(1)* %out 18*9880d681SAndroid Build Coastguard Worker ret void 19*9880d681SAndroid Build Coastguard Worker} 20*9880d681SAndroid Build Coastguard Worker 21*9880d681SAndroid Build Coastguard Worker; FUNC-LABEL: {{^}}safe_sin_3x_f32: 22*9880d681SAndroid Build Coastguard Worker; SI: v_mul_f32 23*9880d681SAndroid Build Coastguard Worker; SI: v_mul_f32 24*9880d681SAndroid Build Coastguard Worker; SI: v_fract_f32 25*9880d681SAndroid Build Coastguard Worker; SI: v_sin_f32 26*9880d681SAndroid Build Coastguard Worker; SI-NOT: v_sin_f32 27*9880d681SAndroid Build Coastguard Workerdefine void @safe_sin_3x_f32(float addrspace(1)* %out, float %x) #1 { 28*9880d681SAndroid Build Coastguard Worker %y = fmul float 3.0, %x 29*9880d681SAndroid Build Coastguard Worker %sin = call float @llvm.sin.f32(float %y) 30*9880d681SAndroid Build Coastguard Worker store float %sin, float addrspace(1)* %out 31*9880d681SAndroid Build Coastguard Worker ret void 32*9880d681SAndroid Build Coastguard Worker} 33*9880d681SAndroid Build Coastguard Worker 34*9880d681SAndroid Build Coastguard Worker; FUNC-LABEL: {{^}}unsafe_sin_3x_f32: 35*9880d681SAndroid Build Coastguard Worker; SI-NOT: v_add_f32 36*9880d681SAndroid Build Coastguard Worker; SI: 0x3ef47644 37*9880d681SAndroid Build Coastguard Worker; SI: v_mul_f32 38*9880d681SAndroid Build Coastguard Worker; SI: v_fract_f32 39*9880d681SAndroid Build Coastguard Worker; SI: v_sin_f32 40*9880d681SAndroid Build Coastguard Worker; SI-NOT: v_sin_f32 41*9880d681SAndroid Build Coastguard Workerdefine void @unsafe_sin_3x_f32(float addrspace(1)* %out, float %x) #2 { 42*9880d681SAndroid Build Coastguard Worker %y = fmul float 3.0, %x 43*9880d681SAndroid Build Coastguard Worker %sin = call float @llvm.sin.f32(float %y) 44*9880d681SAndroid Build Coastguard Worker store float %sin, float addrspace(1)* %out 45*9880d681SAndroid Build Coastguard Worker ret void 46*9880d681SAndroid Build Coastguard Worker} 47*9880d681SAndroid Build Coastguard Worker 48*9880d681SAndroid Build Coastguard Worker; FUNC-LABEL: {{^}}safe_sin_2x_f32: 49*9880d681SAndroid Build Coastguard Worker; SI: v_add_f32 50*9880d681SAndroid Build Coastguard Worker; SI: v_mul_f32 51*9880d681SAndroid Build Coastguard Worker; SI: v_fract_f32 52*9880d681SAndroid Build Coastguard Worker; SI: v_sin_f32 53*9880d681SAndroid Build Coastguard Worker; SI-NOT: v_sin_f32 54*9880d681SAndroid Build Coastguard Workerdefine void @safe_sin_2x_f32(float addrspace(1)* %out, float %x) #1 { 55*9880d681SAndroid Build Coastguard Worker %y = fmul float 2.0, %x 56*9880d681SAndroid Build Coastguard Worker %sin = call float @llvm.sin.f32(float %y) 57*9880d681SAndroid Build Coastguard Worker store float %sin, float addrspace(1)* %out 58*9880d681SAndroid Build Coastguard Worker ret void 59*9880d681SAndroid Build Coastguard Worker} 60*9880d681SAndroid Build Coastguard Worker 61*9880d681SAndroid Build Coastguard Worker; FUNC-LABEL: {{^}}unsafe_sin_2x_f32: 62*9880d681SAndroid Build Coastguard Worker; SI-NOT: v_add_f32 63*9880d681SAndroid Build Coastguard Worker; SI: 0x3ea2f983 64*9880d681SAndroid Build Coastguard Worker; SI: v_mul_f32 65*9880d681SAndroid Build Coastguard Worker; SI: v_fract_f32 66*9880d681SAndroid Build Coastguard Worker; SI: v_sin_f32 67*9880d681SAndroid Build Coastguard Worker; SI-NOT: v_sin_f32 68*9880d681SAndroid Build Coastguard Workerdefine void @unsafe_sin_2x_f32(float addrspace(1)* %out, float %x) #2 { 69*9880d681SAndroid Build Coastguard Worker %y = fmul float 2.0, %x 70*9880d681SAndroid Build Coastguard Worker %sin = call float @llvm.sin.f32(float %y) 71*9880d681SAndroid Build Coastguard Worker store float %sin, float addrspace(1)* %out 72*9880d681SAndroid Build Coastguard Worker ret void 73*9880d681SAndroid Build Coastguard Worker} 74*9880d681SAndroid Build Coastguard Worker 75*9880d681SAndroid Build Coastguard Worker; FUNC-LABEL: {{^}}test_safe_2sin_f32: 76*9880d681SAndroid Build Coastguard Worker; SI: v_add_f32 77*9880d681SAndroid Build Coastguard Worker; SI: v_mul_f32 78*9880d681SAndroid Build Coastguard Worker; SI: v_fract_f32 79*9880d681SAndroid Build Coastguard Worker; SI: v_sin_f32 80*9880d681SAndroid Build Coastguard Worker; SI-NOT: v_sin_f32 81*9880d681SAndroid Build Coastguard Workerdefine void @test_safe_2sin_f32(float addrspace(1)* %out, float %x) #1 { 82*9880d681SAndroid Build Coastguard Worker %y = fmul float 2.0, %x 83*9880d681SAndroid Build Coastguard Worker %sin = call float @llvm.sin.f32(float %y) 84*9880d681SAndroid Build Coastguard Worker store float %sin, float addrspace(1)* %out 85*9880d681SAndroid Build Coastguard Worker ret void 86*9880d681SAndroid Build Coastguard Worker} 87*9880d681SAndroid Build Coastguard Worker 88*9880d681SAndroid Build Coastguard Worker; FUNC-LABEL: {{^}}test_unsafe_2sin_f32: 89*9880d681SAndroid Build Coastguard Worker; SI: 0x3ea2f983 90*9880d681SAndroid Build Coastguard Worker; SI: v_mul_f32 91*9880d681SAndroid Build Coastguard Worker; SI: v_fract_f32 92*9880d681SAndroid Build Coastguard Worker; SI: v_sin_f32 93*9880d681SAndroid Build Coastguard Worker; SI-NOT: v_sin_f32 94*9880d681SAndroid Build Coastguard Workerdefine void @test_unsafe_2sin_f32(float addrspace(1)* %out, float %x) #2 { 95*9880d681SAndroid Build Coastguard Worker %y = fmul float 2.0, %x 96*9880d681SAndroid Build Coastguard Worker %sin = call float @llvm.sin.f32(float %y) 97*9880d681SAndroid Build Coastguard Worker store float %sin, float addrspace(1)* %out 98*9880d681SAndroid Build Coastguard Worker ret void 99*9880d681SAndroid Build Coastguard Worker} 100*9880d681SAndroid Build Coastguard Worker 101*9880d681SAndroid Build Coastguard Worker; FUNC-LABEL: {{^}}sin_v4f32: 102*9880d681SAndroid Build Coastguard Worker; EG: SIN * T{{[0-9]+\.[XYZW], PV\.[XYZW]}} 103*9880d681SAndroid Build Coastguard Worker; EG: SIN * T{{[0-9]+\.[XYZW], PV\.[XYZW]}} 104*9880d681SAndroid Build Coastguard Worker; EG: SIN * T{{[0-9]+\.[XYZW], PV\.[XYZW]}} 105*9880d681SAndroid Build Coastguard Worker; EG: SIN * T{{[0-9]+\.[XYZW], PV\.[XYZW]}} 106*9880d681SAndroid Build Coastguard Worker; EG-NOT: SIN 107*9880d681SAndroid Build Coastguard Worker 108*9880d681SAndroid Build Coastguard Worker; SI: v_sin_f32 109*9880d681SAndroid Build Coastguard Worker; SI: v_sin_f32 110*9880d681SAndroid Build Coastguard Worker; SI: v_sin_f32 111*9880d681SAndroid Build Coastguard Worker; SI: v_sin_f32 112*9880d681SAndroid Build Coastguard Worker; SI-NOT: v_sin_f32 113*9880d681SAndroid Build Coastguard Workerdefine void @sin_v4f32(<4 x float> addrspace(1)* %out, <4 x float> %vx) #1 { 114*9880d681SAndroid Build Coastguard Worker %sin = call <4 x float> @llvm.sin.v4f32( <4 x float> %vx) 115*9880d681SAndroid Build Coastguard Worker store <4 x float> %sin, <4 x float> addrspace(1)* %out 116*9880d681SAndroid Build Coastguard Worker ret void 117*9880d681SAndroid Build Coastguard Worker} 118*9880d681SAndroid Build Coastguard Worker 119*9880d681SAndroid Build Coastguard Workerdeclare float @llvm.sin.f32(float) #0 120*9880d681SAndroid Build Coastguard Workerdeclare <4 x float> @llvm.sin.v4f32(<4 x float>) #0 121*9880d681SAndroid Build Coastguard Worker 122*9880d681SAndroid Build Coastguard Workerattributes #0 = { nounwind readnone } 123*9880d681SAndroid Build Coastguard Workerattributes #1 = { nounwind "unsafe-fp-math"="false" } 124*9880d681SAndroid Build Coastguard Workerattributes #2 = { nounwind "unsafe-fp-math"="true" } 125