mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-29 23:12:55 +01:00
37d6d91b5b
R600 was using a clamped version of rsq, but SI was not. Add a new rsq_clamped intrinsic and use them consistently. It's unclear to me from the documentation what behavior the R600 instructions have, so I assume they have the legacy behavior described by the SI documents. For R600, use RECIPSQRT_IEEE for both llvm.AMDGPU.rsq.legacy and llvm.AMDGPU.rsq. R600 also has RECIPSQRT_FF, which I'm not sure how it fits in here. llvm-svn: 211637
12 lines
485 B
LLVM
12 lines
485 B
LLVM
; RUN: llc -march=r600 -mcpu=SI -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
|
|
|
|
declare double @llvm.AMDGPU.rsq.clamped.f64(double) nounwind readnone
|
|
|
|
; FUNC-LABEL: @rsq_clamped_f64
|
|
; SI: V_RSQ_CLAMP_F64_e32
|
|
define void @rsq_clamped_f64(double addrspace(1)* %out, double %src) nounwind {
|
|
%rsq_clamped = call double @llvm.AMDGPU.rsq.clamped.f64(double %src) nounwind readnone
|
|
store double %rsq_clamped, double addrspace(1)* %out, align 8
|
|
ret void
|
|
}
|