forked from OSchip/llvm-project
R600/SI: Add fsqrt pattern for SI
Patch by: Niels Ole Salscheider Reviewed-by: Tom Stellard <thomas.stellard@amd.com> llvm-svn: 186180
This commit is contained in:
parent
2a6a610516
commit
8ed7b45da3
|
@ -669,8 +669,12 @@ defm V_RCP_F64 : VOP1_64 <0x0000002f, "V_RCP_F64",
|
|||
defm V_RCP_CLAMP_F64 : VOP1_64 <0x00000030, "V_RCP_CLAMP_F64", []>;
|
||||
defm V_RSQ_F64 : VOP1_64 <0x00000031, "V_RSQ_F64", []>;
|
||||
defm V_RSQ_CLAMP_F64 : VOP1_64 <0x00000032, "V_RSQ_CLAMP_F64", []>;
|
||||
defm V_SQRT_F32 : VOP1_32 <0x00000033, "V_SQRT_F32", []>;
|
||||
defm V_SQRT_F64 : VOP1_64 <0x00000034, "V_SQRT_F64", []>;
|
||||
defm V_SQRT_F32 : VOP1_32 <0x00000033, "V_SQRT_F32",
|
||||
[(set f32:$dst, (fsqrt f32:$src0))]
|
||||
>;
|
||||
defm V_SQRT_F64 : VOP1_64 <0x00000034, "V_SQRT_F64",
|
||||
[(set f64:$dst, (fsqrt f64:$src0))]
|
||||
>;
|
||||
defm V_SIN_F32 : VOP1_32 <0x00000035, "V_SIN_F32", []>;
|
||||
defm V_COS_F32 : VOP1_32 <0x00000036, "V_COS_F32", []>;
|
||||
defm V_NOT_B32 : VOP1_32 <0x00000037, "V_NOT_B32", []>;
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
; RUN: llc < %s -march=r600 -mcpu=tahiti | FileCheck %s
|
||||
|
||||
; CHECK: @fsqrt_f32
|
||||
; CHECK: V_SQRT_F32_e32 {{VGPR[0-9]+, VGPR[0-9]+}}
|
||||
|
||||
define void @fsqrt_f32(float addrspace(1)* %out, float addrspace(1)* %in) {
|
||||
%r0 = load float addrspace(1)* %in
|
||||
%r1 = call float @llvm.sqrt.f32(float %r0)
|
||||
store float %r1, float addrspace(1)* %out
|
||||
ret void
|
||||
}
|
||||
|
||||
; CHECK: @fsqrt_f64
|
||||
; CHECK: V_SQRT_F64_e32 {{VGPR[0-9]+_VGPR[0-9]+, VGPR[0-9]+_VGPR[0-9]+}}
|
||||
|
||||
define void @fsqrt_f64(double addrspace(1)* %out, double addrspace(1)* %in) {
|
||||
%r0 = load double addrspace(1)* %in
|
||||
%r1 = call double @llvm.sqrt.f64(double %r0)
|
||||
store double %r1, double addrspace(1)* %out
|
||||
ret void
|
||||
}
|
||||
|
||||
declare float @llvm.sqrt.f32(float %Val)
|
||||
declare double @llvm.sqrt.f64(double %Val)
|
Loading…
Reference in New Issue