|
33 | 33 | #include "llvm/MC/MCParser/MCAsmParser.h" |
34 | 34 | #include "llvm/MC/MCParser/MCParsedAsmOperand.h" |
35 | 35 | #include "llvm/MC/MCParser/MCTargetAsmParser.h" |
36 | | -#include "llvm/MC/MCRegisterInfo.h" |
37 | 36 | #include "llvm/MC/MCSymbol.h" |
38 | 37 | #include "llvm/MC/TargetRegistry.h" |
39 | 38 | #include "llvm/Support/AMDGPUMetadata.h" |
@@ -1537,10 +1536,6 @@ class AMDGPUAsmParser : public MCTargetAsmParser { |
1537 | 1536 | return getFeatureBits()[AMDGPU::FeatureFlatInstOffsets]; |
1538 | 1537 | } |
1539 | 1538 |
|
1540 | | - bool hasTrue16Insts() const { |
1541 | | - return getFeatureBits()[AMDGPU::FeatureTrue16BitInsts]; |
1542 | | - } |
1543 | | - |
1544 | 1539 | bool hasArchitectedFlatScratch() const { |
1545 | 1540 | return getFeatureBits()[AMDGPU::FeatureArchitectedFlatScratch]; |
1546 | 1541 | } |
@@ -1782,7 +1777,6 @@ class AMDGPUAsmParser : public MCTargetAsmParser { |
1782 | 1777 | bool validateMIMGDim(const MCInst &Inst, const OperandVector &Operands); |
1783 | 1778 | bool validateMIMGMSAA(const MCInst &Inst); |
1784 | 1779 | bool validateOpSel(const MCInst &Inst); |
1785 | | - bool validateTrue16OpSel(const MCInst &Inst); |
1786 | 1780 | bool validateNeg(const MCInst &Inst, int OpName); |
1787 | 1781 | bool validateDPP(const MCInst &Inst, const OperandVector &Operands); |
1788 | 1782 | bool validateVccOperand(MCRegister Reg) const; |
@@ -4657,39 +4651,6 @@ bool AMDGPUAsmParser::validateOpSel(const MCInst &Inst) { |
4657 | 4651 | return true; |
4658 | 4652 | } |
4659 | 4653 |
|
4660 | | -bool AMDGPUAsmParser::validateTrue16OpSel(const MCInst &Inst) { |
4661 | | - if (!hasTrue16Insts()) |
4662 | | - return true; |
4663 | | - const MCRegisterInfo *MRI = getMRI(); |
4664 | | - const unsigned Opc = Inst.getOpcode(); |
4665 | | - int OpSelIdx = AMDGPU::getNamedOperandIdx(Opc, AMDGPU::OpName::op_sel); |
4666 | | - if (OpSelIdx == -1) |
4667 | | - return true; |
4668 | | - unsigned OpSelOpValue = Inst.getOperand(OpSelIdx).getImm(); |
4669 | | - // If the value is 0 we could have a default OpSel Operand, so conservatively |
4670 | | - // allow it. |
4671 | | - if (OpSelOpValue == 0) |
4672 | | - return true; |
4673 | | - unsigned OpCount = 0; |
4674 | | - for (int OpName : {AMDGPU::OpName::src0, AMDGPU::OpName::src1, |
4675 | | - AMDGPU::OpName::src2, AMDGPU::OpName::vdst}) { |
4676 | | - int OpIdx = AMDGPU::getNamedOperandIdx(Inst.getOpcode(), OpName); |
4677 | | - if (OpIdx == -1) |
4678 | | - continue; |
4679 | | - const MCOperand &Op = Inst.getOperand(OpIdx); |
4680 | | - if (Op.isReg() && |
4681 | | - MRI->getRegClass(AMDGPU::VGPR_16RegClassID).contains(Op.getReg())) { |
4682 | | - bool VGPRSuffixIsHi = AMDGPU::isHi16Reg(Op.getReg(), *MRI); |
4683 | | - bool OpSelOpIsHi = ((OpSelOpValue & (1 << OpCount)) != 0); |
4684 | | - if (OpSelOpIsHi != VGPRSuffixIsHi) |
4685 | | - return false; |
4686 | | - } |
4687 | | - ++OpCount; |
4688 | | - } |
4689 | | - |
4690 | | - return true; |
4691 | | -} |
4692 | | - |
4693 | 4654 | bool AMDGPUAsmParser::validateNeg(const MCInst &Inst, int OpName) { |
4694 | 4655 | assert(OpName == AMDGPU::OpName::neg_lo || OpName == AMDGPU::OpName::neg_hi); |
4695 | 4656 |
|
@@ -5171,11 +5132,6 @@ bool AMDGPUAsmParser::validateInstruction(const MCInst &Inst, |
5171 | 5132 | Error(getRegLoc(LDS_DIRECT, Operands), *ErrMsg); |
5172 | 5133 | return false; |
5173 | 5134 | } |
5174 | | - if (!validateTrue16OpSel(Inst)) { |
5175 | | - Error(getImmLoc(AMDGPUOperand::ImmTyOpSel, Operands), |
5176 | | - "op_sel operand conflicts with 16-bit operand suffix"); |
5177 | | - return false; |
5178 | | - } |
5179 | 5135 | if (!validateSOPLiteral(Inst)) { |
5180 | 5136 | Error(getLitLoc(Operands), |
5181 | 5137 | "only one unique literal operand is allowed"); |
|
0 commit comments