2015-01-06 18:00:21 +00:00
|
|
|
; RUN: llc -march=amdgcn -mcpu=SI -mattr=-fp32-denormals -enable-unsafe-fp-math -verify-machineinstrs < %s | FileCheck -check-prefix=SI-UNSAFE -check-prefix=SI -check-prefix=FUNC %s
|
|
|
|
; RUN: llc -march=amdgcn -mcpu=SI -mattr=-fp32-denormals -verify-machineinstrs < %s | FileCheck -check-prefix=SI-SAFE -check-prefix=SI -check-prefix=FUNC %s
|
|
|
|
; XUN: llc -march=amdgcn -mcpu=SI -mattr=+fp32-denormals -verify-machineinstrs < %s | FileCheck -check-prefix=SI-SAFE-SPDENORM -check-prefix=SI -check-prefix=FUNC %s
|
2015-01-27 17:27:15 +00:00
|
|
|
; RUN: llc -march=amdgcn -mcpu=tonga -mattr=-fp32-denormals -enable-unsafe-fp-math -verify-machineinstrs < %s | FileCheck -check-prefix=SI-UNSAFE -check-prefix=SI -check-prefix=FUNC %s
|
|
|
|
; RUN: llc -march=amdgcn -mcpu=tonga -mattr=-fp32-denormals -verify-machineinstrs < %s | FileCheck -check-prefix=SI-SAFE -check-prefix=SI -check-prefix=FUNC %s
|
|
|
|
; XUN: llc -march=amdgcn -mcpu=tonga -mattr=+fp32-denormals -verify-machineinstrs < %s | FileCheck -check-prefix=SI-SAFE-SPDENORM -check-prefix=SI -check-prefix=FUNC %s
|
2014-06-19 01:19:19 +00:00
|
|
|
|
2014-07-24 06:59:24 +00:00
|
|
|
; RUN: llc -march=r600 -mcpu=cypress -verify-machineinstrs < %s | FileCheck -check-prefix=EG-SAFE -check-prefix=FUNC %s
|
|
|
|
; RUN: llc -march=r600 -mcpu=cayman -verify-machineinstrs < %s | FileCheck -check-prefix=EG -check-prefix=FUNC %s
|
|
|
|
|
2014-06-19 01:19:19 +00:00
|
|
|
declare float @llvm.AMDGPU.rcp.f32(float) nounwind readnone
|
|
|
|
declare double @llvm.AMDGPU.rcp.f64(double) nounwind readnone
|
|
|
|
|
|
|
|
declare float @llvm.sqrt.f32(float) nounwind readnone
|
|
|
|
|
2014-10-01 17:15:17 +00:00
|
|
|
; FUNC-LABEL: {{^}}rcp_f32:
|
2014-11-05 14:50:53 +00:00
|
|
|
; SI: v_rcp_f32_e32
|
2014-07-24 06:59:24 +00:00
|
|
|
; EG: RECIP_IEEE
|
2014-06-19 01:19:19 +00:00
|
|
|
define void @rcp_f32(float addrspace(1)* %out, float %src) nounwind {
|
|
|
|
%rcp = call float @llvm.AMDGPU.rcp.f32(float %src) nounwind readnone
|
|
|
|
store float %rcp, float addrspace(1)* %out, align 4
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-07-24 06:59:24 +00:00
|
|
|
; FIXME: Evergreen only ever does unsafe fp math.
|
2014-10-01 17:15:17 +00:00
|
|
|
; FUNC-LABEL: {{^}}rcp_pat_f32:
|
2014-07-24 06:59:24 +00:00
|
|
|
|
2014-11-05 14:50:53 +00:00
|
|
|
; SI-SAFE: v_rcp_f32_e32
|
|
|
|
; XSI-SAFE-SPDENORM-NOT: v_rcp_f32_e32
|
2014-07-24 06:59:24 +00:00
|
|
|
|
|
|
|
; EG: RECIP_IEEE
|
|
|
|
|
2014-06-19 01:19:19 +00:00
|
|
|
define void @rcp_pat_f32(float addrspace(1)* %out, float %src) nounwind {
|
|
|
|
%rcp = fdiv float 1.0, %src
|
|
|
|
store float %rcp, float addrspace(1)* %out, align 4
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
2014-10-01 17:15:17 +00:00
|
|
|
; FUNC-LABEL: {{^}}rsq_rcp_pat_f32:
|
2014-11-05 14:50:53 +00:00
|
|
|
; SI-UNSAFE: v_rsq_f32_e32
|
|
|
|
; SI-SAFE: v_sqrt_f32_e32
|
|
|
|
; SI-SAFE: v_rcp_f32_e32
|
2014-07-24 06:59:24 +00:00
|
|
|
|
|
|
|
; EG: RECIPSQRT_IEEE
|
2014-06-19 01:19:19 +00:00
|
|
|
define void @rsq_rcp_pat_f32(float addrspace(1)* %out, float %src) nounwind {
|
|
|
|
%sqrt = call float @llvm.sqrt.f32(float %src) nounwind readnone
|
|
|
|
%rcp = call float @llvm.AMDGPU.rcp.f32(float %sqrt) nounwind readnone
|
|
|
|
store float %rcp, float addrspace(1)* %out, align 4
|
|
|
|
ret void
|
|
|
|
}
|