R600: Fix inconsistency in rsq instructions.
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 24 Jun 2014 22:13:39 +0000 (22:13 +0000)
committerMatt Arsenault <Matthew.Arsenault@amd.com>
Tue, 24 Jun 2014 22:13:39 +0000 (22:13 +0000)
commit257d48d22cadb5677b1be4a756b5bc74f286139b
treea8e73efc0ab8383bbcf8fffa4807b5954a758130
parent6008924508d0c8fdb82ff338a13d073a0650a51c
R600: Fix inconsistency in rsq instructions.

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
13 files changed:
llvm/include/llvm/IR/IntrinsicsR600.td
llvm/lib/Target/R600/AMDGPUISelLowering.cpp
llvm/lib/Target/R600/AMDGPUISelLowering.h
llvm/lib/Target/R600/AMDGPUInstrInfo.td
llvm/lib/Target/R600/AMDGPUInstructions.td
llvm/lib/Target/R600/AMDGPUIntrinsics.td
llvm/lib/Target/R600/R600ISelLowering.cpp
llvm/lib/Target/R600/R600Instructions.td
llvm/lib/Target/R600/SIInstructions.td
llvm/test/CodeGen/R600/llvm.AMDGPU.legacy.rsq.ll [new file with mode: 0644]
llvm/test/CodeGen/R600/llvm.AMDGPU.rsq.clamped.f64.ll [new file with mode: 0644]
llvm/test/CodeGen/R600/llvm.AMDGPU.rsq.clamped.ll [new file with mode: 0644]
llvm/test/CodeGen/R600/llvm.AMDGPU.rsq.ll [new file with mode: 0644]