diff options
| author | Tom Stellard <thomas.stellard@amd.com> | 2014-09-23 21:26:25 +0000 |
|---|---|---|
| committer | Tom Stellard <thomas.stellard@amd.com> | 2014-09-23 21:26:25 +0000 |
| commit | 73ae1cb59a4a3fe25c8678846816b37bfb87edfe (patch) | |
| tree | 21be006366c091b8a8e1d2ac25e6372477f0c65c /llvm/lib/Target/R600/MCTargetDesc/SIMCCodeEmitter.cpp | |
| parent | bdf54a21b5e3392b431b6569007cb61689c76a3c (diff) | |
| download | bcm5719-llvm-73ae1cb59a4a3fe25c8678846816b37bfb87edfe.tar.gz bcm5719-llvm-73ae1cb59a4a3fe25c8678846816b37bfb87edfe.zip | |
R600/SI: Clean up checks for legality of immediate operands
There are new register classes VCSrc_* which represent operands that
can take an SGPR, VGPR or inline constant. The VSrc_* class is now used
to represent operands that can take an SGPR, VGPR, or a 32-bit
immediate.
This allows us to have more accurate checks for legality of
immediates, since before we had no way to distinguish between operands
that supported any 32-bit immediate and operands which could only
support inline constants.
llvm-svn: 218334
Diffstat (limited to 'llvm/lib/Target/R600/MCTargetDesc/SIMCCodeEmitter.cpp')
| -rw-r--r-- | llvm/lib/Target/R600/MCTargetDesc/SIMCCodeEmitter.cpp | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/llvm/lib/Target/R600/MCTargetDesc/SIMCCodeEmitter.cpp b/llvm/lib/Target/R600/MCTargetDesc/SIMCCodeEmitter.cpp index 65f3eb5d99a..999fd0dbc9a 100644 --- a/llvm/lib/Target/R600/MCTargetDesc/SIMCCodeEmitter.cpp +++ b/llvm/lib/Target/R600/MCTargetDesc/SIMCCodeEmitter.cpp @@ -85,21 +85,13 @@ MCCodeEmitter *llvm::createSIMCCodeEmitter(const MCInstrInfo &MCII, bool SIMCCodeEmitter::isSrcOperand(const MCInstrDesc &Desc, unsigned OpNo) const { - // FIXME: We need a better way to figure out which operands can be immediate - // values - // - // Some VOP* instructions like ADDC use VReg32 as the register class - // for source 0, because they read VCC and can't take an SGPR as an - // argument due to constant bus restrictions. - if (OpNo == 1 && (Desc.TSFlags & (SIInstrFlags::VOP1 | SIInstrFlags::VOP2 | - SIInstrFlags::VOPC))) - return true; - unsigned RegClass = Desc.OpInfo[OpNo].RegClass; return (AMDGPU::SSrc_32RegClassID == RegClass) || (AMDGPU::SSrc_64RegClassID == RegClass) || (AMDGPU::VSrc_32RegClassID == RegClass) || - (AMDGPU::VSrc_64RegClassID == RegClass); + (AMDGPU::VSrc_64RegClassID == RegClass) || + (AMDGPU::VCSrc_32RegClassID == RegClass) || + (AMDGPU::VCSrc_64RegClassID == RegClass); } uint32_t SIMCCodeEmitter::getLitEncoding(const MCOperand &MO) const { |

