2014-09-03 03:02:53 +08:00
|
|
|
; RUN: llc -march=r600 -mcpu=redwood < %s | FileCheck -check-prefix=EG -check-prefix=FUNC %s
|
|
|
|
; RUN: llc -march=r600 -mcpu=SI < %s | FileCheck -check-prefix=SI -check-prefix=SI-SAFE -check-prefix=FUNC %s
|
|
|
|
; RUN: llc -march=r600 -mcpu=SI -enable-unsafe-fp-math < %s | FileCheck -check-prefix=SI -check-prefix=SI-UNSAFE -check-prefix=FUNC %s
|
|
|
|
|
|
|
|
; FUNC-LABEL: sin_f32
|
|
|
|
; EG: MULADD_IEEE *
|
|
|
|
; EG: FRACT *
|
|
|
|
; EG: ADD *
|
|
|
|
; EG: SIN * T{{[0-9]+\.[XYZW], PV\.[XYZW]}}
|
|
|
|
; EG-NOT: SIN
|
|
|
|
; SI: V_MUL_F32
|
|
|
|
; SI: V_FRACT_F32
|
|
|
|
; SI: V_SIN_F32
|
|
|
|
; SI-NOT: V_SIN_F32
|
|
|
|
|
|
|
|
define void @sin_f32(float addrspace(1)* %out, float %x) #1 {
|
2014-05-02 23:41:47 +08:00
|
|
|
%sin = call float @llvm.sin.f32(float %x)
|
|
|
|
store float %sin, float addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-10-02 01:15:17 +08:00
|
|
|
; FUNC-LABEL: {{^}}sin_3x_f32:
|
2014-09-03 03:02:53 +08:00
|
|
|
; SI-UNSAFE-NOT: V_ADD_F32
|
2014-09-18 01:32:13 +08:00
|
|
|
; SI-UNSAFE: 0x3ef47644
|
2014-09-03 03:02:53 +08:00
|
|
|
; SI-UNSAFE: V_MUL_F32
|
|
|
|
; SI-SAFE: V_MUL_F32
|
|
|
|
; SI-SAFE: V_MUL_F32
|
|
|
|
; SI: V_FRACT_F32
|
|
|
|
; SI: V_SIN_F32
|
|
|
|
; SI-NOT: V_SIN_F32
|
|
|
|
define void @sin_3x_f32(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
|
|
|
|
}
|
|
|
|
|
2014-10-02 01:15:17 +08:00
|
|
|
; FUNC-LABEL: {{^}}sin_2x_f32:
|
2014-09-03 03:02:53 +08:00
|
|
|
; SI-UNSAFE-NOT: V_ADD_F32
|
2014-09-18 01:32:13 +08:00
|
|
|
; SI-UNSAFE: 0x3ea2f983
|
2014-09-03 03:02:53 +08:00
|
|
|
; SI-UNSAFE: V_MUL_F32
|
|
|
|
; SI-SAFE: V_ADD_F32
|
|
|
|
; SI-SAFE: V_MUL_F32
|
|
|
|
; SI: V_FRACT_F32
|
|
|
|
; SI: V_SIN_F32
|
|
|
|
; SI-NOT: V_SIN_F32
|
|
|
|
define void @sin_2x_f32(float addrspace(1)* %out, float %x) #1 {
|
|
|
|
%y = fmul float 2.0, %x
|
|
|
|
%sin = call float @llvm.sin.f32(float %y)
|
|
|
|
store float %sin, float addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-10-02 01:15:17 +08:00
|
|
|
; FUNC-LABEL: {{^}}test_2sin_f32:
|
2014-09-18 01:32:13 +08:00
|
|
|
; SI-UNSAFE: 0x3ea2f983
|
2014-09-03 03:02:53 +08:00
|
|
|
; SI-UNSAFE: V_MUL_F32
|
|
|
|
; SI-SAFE: V_ADD_F32
|
|
|
|
; SI-SAFE: V_MUL_F32
|
|
|
|
; SI: V_FRACT_F32
|
|
|
|
; SI: V_SIN_F32
|
|
|
|
; SI-NOT: V_SIN_F32
|
|
|
|
define void @test_2sin_f32(float addrspace(1)* %out, float %x) #1 {
|
|
|
|
%y = fmul float 2.0, %x
|
2014-07-20 02:44:39 +08:00
|
|
|
%sin = call float @llvm.sin.f32(float %y)
|
|
|
|
store float %sin, float addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-10-02 01:15:17 +08:00
|
|
|
; FUNC-LABEL: {{^}}sin_v4f32:
|
2014-09-03 03:02:53 +08:00
|
|
|
; EG: SIN * T{{[0-9]+\.[XYZW], PV\.[XYZW]}}
|
|
|
|
; EG: SIN * T{{[0-9]+\.[XYZW], PV\.[XYZW]}}
|
|
|
|
; EG: SIN * T{{[0-9]+\.[XYZW], PV\.[XYZW]}}
|
|
|
|
; EG: SIN * T{{[0-9]+\.[XYZW], PV\.[XYZW]}}
|
|
|
|
; EG-NOT: SIN
|
|
|
|
; SI: V_SIN_F32
|
|
|
|
; SI: V_SIN_F32
|
|
|
|
; SI: V_SIN_F32
|
|
|
|
; SI: V_SIN_F32
|
|
|
|
; SI-NOT: V_SIN_F32
|
|
|
|
|
|
|
|
define void @sin_v4f32(<4 x float> addrspace(1)* %out, <4 x float> %vx) #1 {
|
2014-05-02 23:41:47 +08:00
|
|
|
%sin = call <4 x float> @llvm.sin.v4f32( <4 x float> %vx)
|
|
|
|
store <4 x float> %sin, <4 x float> addrspace(1)* %out
|
2012-12-12 05:25:42 +08:00
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
declare float @llvm.sin.f32(float) readnone
|
2014-05-02 23:41:47 +08:00
|
|
|
declare <4 x float> @llvm.sin.v4f32(<4 x float>) readnone
|
2012-12-12 05:25:42 +08:00
|
|
|
|
2013-11-12 06:10:24 +08:00
|
|
|
attributes #0 = { "ShaderType"="0" }
|