diff options
author | Tom Stellard <thomas.stellard@amd.com> | 2013-10-10 17:11:24 +0000 |
---|---|---|
committer | Tom Stellard <thomas.stellard@amd.com> | 2013-10-10 17:11:24 +0000 |
commit | 0f9eaaa8aa10bdb658e887782b86f03dbea79cb1 (patch) | |
tree | 1b06eb716b8934bcfcc7f104657cc3db65e3e5ab /lib/Target/R600/AMDGPUInstrInfo.cpp | |
parent | 219e788dc6e38120266d366a51286739fa33123b (diff) | |
download | llvm-0f9eaaa8aa10bdb658e887782b86f03dbea79cb1.tar.gz llvm-0f9eaaa8aa10bdb658e887782b86f03dbea79cb1.tar.bz2 llvm-0f9eaaa8aa10bdb658e887782b86f03dbea79cb1.tar.xz |
R600/SI: Define a separate MIMG instruction for each possible output value type
During instruction selection, we rewrite the destination register
class for MIMG instructions based on their writemasks. This creates
machine verifier errors since the new register class does not match
the register class in the MIMG instruction definition.
We can avoid this by defining different MIMG instructions for each
possible destination type and then switching to the correct instruction
when we change the register class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192365 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/R600/AMDGPUInstrInfo.cpp')
-rw-r--r-- | lib/Target/R600/AMDGPUInstrInfo.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Target/R600/AMDGPUInstrInfo.cpp b/lib/Target/R600/AMDGPUInstrInfo.cpp index 8d3f740c3c..bb7f97ff11 100644 --- a/lib/Target/R600/AMDGPUInstrInfo.cpp +++ b/lib/Target/R600/AMDGPUInstrInfo.cpp @@ -244,3 +244,12 @@ void AMDGPUInstrInfo::convertToISA(MachineInstr & MI, MachineFunction &MF, } } } + +int AMDGPUInstrInfo::getMaskedMIMGOp(uint16_t Opcode, unsigned Channels) const { + switch (Channels) { + default: return Opcode; + case 1: return AMDGPU::getMaskedMIMGOp(Opcode, AMDGPU::Channels_1); + case 2: return AMDGPU::getMaskedMIMGOp(Opcode, AMDGPU::Channels_2); + case 3: return AMDGPU::getMaskedMIMGOp(Opcode, AMDGPU::Channels_3); + } +} |