2014-07-12 00:36:19 +00:00
|
|
|
; RUN: llc -march=r600 -mcpu=SI -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
|
|
|
|
|
|
|
|
declare double @llvm.AMDGPU.rcp.f64(double) nounwind readnone
|
|
|
|
declare double @llvm.sqrt.f64(double) nounwind readnone
|
|
|
|
|
2014-10-01 17:15:17 +00:00
|
|
|
; FUNC-LABEL: {{^}}rcp_f64:
|
2014-07-12 00:36:19 +00:00
|
|
|
; SI: V_RCP_F64_e32
|
|
|
|
define void @rcp_f64(double addrspace(1)* %out, double %src) nounwind {
|
|
|
|
%rcp = call double @llvm.AMDGPU.rcp.f64(double %src) nounwind readnone
|
|
|
|
store double %rcp, double addrspace(1)* %out, align 8
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-10-01 17:15:17 +00:00
|
|
|
; FUNC-LABEL: {{^}}rcp_pat_f64:
|
2014-07-12 00:36:19 +00:00
|
|
|
; SI: V_RCP_F64_e32
|
|
|
|
define void @rcp_pat_f64(double addrspace(1)* %out, double %src) nounwind {
|
|
|
|
%rcp = fdiv double 1.0, %src
|
|
|
|
store double %rcp, double addrspace(1)* %out, align 8
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-10-01 17:15:17 +00:00
|
|
|
; FUNC-LABEL: {{^}}rsq_rcp_pat_f64:
|
2014-07-15 23:50:10 +00:00
|
|
|
; SI-UNSAFE: V_RSQ_F64_e32
|
|
|
|
; SI-SAFE-NOT: V_RSQ_F64_e32
|
2014-07-12 00:36:19 +00:00
|
|
|
define void @rsq_rcp_pat_f64(double addrspace(1)* %out, double %src) nounwind {
|
|
|
|
%sqrt = call double @llvm.sqrt.f64(double %src) nounwind readnone
|
|
|
|
%rcp = call double @llvm.AMDGPU.rcp.f64(double %sqrt) nounwind readnone
|
|
|
|
store double %rcp, double addrspace(1)* %out, align 8
|
|
|
|
ret void
|
|
|
|
}
|