diff options
author | Changpeng Fang <changpeng.fang@gmail.com> | 2016-11-14 18:33:18 +0000 |
---|---|---|
committer | Changpeng Fang <changpeng.fang@gmail.com> | 2016-11-14 18:33:18 +0000 |
commit | 8236fe103f051eac41ff23f6684578b5e31c9871 (patch) | |
tree | 1fd311f7ad5aec7170aa7a5cbd96bcda1e13d3e4 /llvm/lib/Target/AMDGPU/SIISelLowering.cpp | |
parent | 41c52889b90ded563e1aa56cfa7764e083323b00 (diff) | |
download | bcm5719-llvm-8236fe103f051eac41ff23f6684578b5e31c9871.tar.gz bcm5719-llvm-8236fe103f051eac41ff23f6684578b5e31c9871.zip |
AMDGPU/SI: Support data types other than V4f32 in image intrinsics
Summary:
Extend image intrinsics to support data types of V1F32 and V2F32.
TODO: we should define a mapping table to change the opcode for data type of V2F32 but just one channel is active,
even though such case should be very rare.
Reviewers:
tstellarAMD
Differential Revision:
http://reviews.llvm.org/D26472
llvm-svn: 286860
Diffstat (limited to 'llvm/lib/Target/AMDGPU/SIISelLowering.cpp')
-rw-r--r-- | llvm/lib/Target/AMDGPU/SIISelLowering.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp index d8ed325d098..a0650d407ef 100644 --- a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp +++ b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp @@ -4047,13 +4047,16 @@ void SITargetLowering::AdjustInstrPostInstrSelection(MachineInstr &MI, if (TII->isMIMG(MI)) { unsigned VReg = MI.getOperand(0).getReg(); + const TargetRegisterClass *RC = MRI.getRegClass(VReg); + // TODO: Need mapping tables to handle other cases (register classes). + if (RC != &AMDGPU::VReg_128RegClass) + return; + unsigned DmaskIdx = MI.getNumOperands() == 12 ? 3 : 4; unsigned Writemask = MI.getOperand(DmaskIdx).getImm(); unsigned BitsSet = 0; for (unsigned i = 0; i < 4; ++i) BitsSet += Writemask & (1 << i) ? 1 : 0; - - const TargetRegisterClass *RC; switch (BitsSet) { default: return; case 1: RC = &AMDGPU::VGPR_32RegClass; break; |