@@ -1777,7 +1777,7 @@ class AMDGPUAsmParser : public MCTargetAsmParser {
17771777 bool validateMIMGDim (const MCInst &Inst, const OperandVector &Operands);
17781778 bool validateMIMGMSAA (const MCInst &Inst);
17791779 bool validateOpSel (const MCInst &Inst);
1780- bool validateNeg (const MCInst &Inst, int OpName);
1780+ bool validateNeg (const MCInst &Inst, AMDGPU::OpName OpName);
17811781 bool validateDPP (const MCInst &Inst, const OperandVector &Operands);
17821782 bool validateVccOperand (MCRegister Reg) const ;
17831783 bool validateVOPLiteral (const MCInst &Inst, const OperandVector &Operands);
@@ -3953,8 +3953,9 @@ bool AMDGPUAsmParser::validateMIMGAddrSize(const MCInst &Inst,
39533953 const AMDGPU::MIMGBaseOpcodeInfo *BaseOpcode =
39543954 AMDGPU::getMIMGBaseOpcodeInfo (Info->BaseOpcode );
39553955 int VAddr0Idx = AMDGPU::getNamedOperandIdx (Opc, AMDGPU::OpName::vaddr0);
3956- int RSrcOpName = (Desc.TSFlags & SIInstrFlags::MIMG) ? AMDGPU::OpName::srsrc
3957- : AMDGPU::OpName::rsrc;
3956+ AMDGPU::OpName RSrcOpName = (Desc.TSFlags & SIInstrFlags::MIMG)
3957+ ? AMDGPU::OpName::srsrc
3958+ : AMDGPU::OpName::rsrc;
39583959 int SrsrcIdx = AMDGPU::getNamedOperandIdx (Opc, RSrcOpName);
39593960 int DimIdx = AMDGPU::getNamedOperandIdx (Opc, AMDGPU::OpName::dim);
39603961 int A16Idx = AMDGPU::getNamedOperandIdx (Opc, AMDGPU::OpName::a16);
@@ -4651,7 +4652,7 @@ bool AMDGPUAsmParser::validateOpSel(const MCInst &Inst) {
46514652 return true ;
46524653}
46534654
4654- bool AMDGPUAsmParser::validateNeg (const MCInst &Inst, int OpName) {
4655+ bool AMDGPUAsmParser::validateNeg (const MCInst &Inst, AMDGPU::OpName OpName) {
46554656 assert (OpName == AMDGPU::OpName::neg_lo || OpName == AMDGPU::OpName::neg_hi);
46564657
46574658 const unsigned Opc = Inst.getOpcode ();
@@ -4676,9 +4677,9 @@ bool AMDGPUAsmParser::validateNeg(const MCInst &Inst, int OpName) {
46764677 // It is convenient that such instructions don't have src_modifiers operand
46774678 // for src operands that don't allow neg because they also don't allow opsel.
46784679
4679- int SrcMods[3 ] = {AMDGPU::OpName::src0_modifiers,
4680- AMDGPU::OpName::src1_modifiers,
4681- AMDGPU::OpName::src2_modifiers};
4680+ const AMDGPU::OpName SrcMods[3 ] = {AMDGPU::OpName::src0_modifiers,
4681+ AMDGPU::OpName::src1_modifiers,
4682+ AMDGPU::OpName::src2_modifiers};
46824683
46834684 for (unsigned i = 0 ; i < 3 ; ++i) {
46844685 if (!AMDGPU::hasNamedOperand (Opc, SrcMods[i])) {
@@ -4805,9 +4806,9 @@ bool AMDGPUAsmParser::validateVOPLiteral(const MCInst &Inst,
48054806}
48064807
48074808// Returns -1 if not a register, 0 if VGPR and 1 if AGPR.
4808- static int IsAGPROperand (const MCInst &Inst, uint16_t NameIdx ,
4809+ static int IsAGPROperand (const MCInst &Inst, AMDGPU::OpName Name ,
48094810 const MCRegisterInfo *MRI) {
4810- int OpIdx = AMDGPU::getNamedOperandIdx (Inst.getOpcode (), NameIdx );
4811+ int OpIdx = AMDGPU::getNamedOperandIdx (Inst.getOpcode (), Name );
48114812 if (OpIdx < 0 )
48124813 return -1 ;
48134814
@@ -4828,12 +4829,13 @@ bool AMDGPUAsmParser::validateAGPRLdSt(const MCInst &Inst) const {
48284829 SIInstrFlags::DS)) == 0 )
48294830 return true ;
48304831
4831- uint16_t DataNameIdx = (TSFlags & SIInstrFlags::DS) ? AMDGPU::OpName::data0
4832- : AMDGPU::OpName::vdata;
4832+ AMDGPU::OpName DataName = (TSFlags & SIInstrFlags::DS)
4833+ ? AMDGPU::OpName::data0
4834+ : AMDGPU::OpName::vdata;
48334835
48344836 const MCRegisterInfo *MRI = getMRI ();
48354837 int DstAreg = IsAGPROperand (Inst, AMDGPU::OpName::vdst, MRI);
4836- int DataAreg = IsAGPROperand (Inst, DataNameIdx , MRI);
4838+ int DataAreg = IsAGPROperand (Inst, DataName , MRI);
48374839
48384840 if ((TSFlags & SIInstrFlags::DS) && DataAreg >= 0 ) {
48394841 int Data2Areg = IsAGPROperand (Inst, AMDGPU::OpName::data1, MRI);
@@ -8647,9 +8649,8 @@ static void cvtVOP3DstOpSelOnly(MCInst &Inst, const MCRegisterInfo &MRI) {
86478649 return ;
86488650
86498651 int SrcNum;
8650- const int Ops[] = { AMDGPU::OpName::src0,
8651- AMDGPU::OpName::src1,
8652- AMDGPU::OpName::src2 };
8652+ const AMDGPU::OpName Ops[] = {AMDGPU::OpName::src0, AMDGPU::OpName::src1,
8653+ AMDGPU::OpName::src2};
86538654 for (SrcNum = 0 ; SrcNum < 3 && AMDGPU::hasNamedOperand (Opc, Ops[SrcNum]);
86548655 ++SrcNum)
86558656 ;
@@ -8771,12 +8772,11 @@ void AMDGPUAsmParser::cvtVINTERP(MCInst &Inst, const OperandVector &Operands)
87718772 if (OpSelIdx == -1 )
87728773 return ;
87738774
8774- const int Ops[] = { AMDGPU::OpName::src0,
8775- AMDGPU::OpName::src1,
8776- AMDGPU::OpName::src2 };
8777- const int ModOps[] = { AMDGPU::OpName::src0_modifiers,
8778- AMDGPU::OpName::src1_modifiers,
8779- AMDGPU::OpName::src2_modifiers };
8775+ const AMDGPU::OpName Ops[] = {AMDGPU::OpName::src0, AMDGPU::OpName::src1,
8776+ AMDGPU::OpName::src2};
8777+ const AMDGPU::OpName ModOps[] = {AMDGPU::OpName::src0_modifiers,
8778+ AMDGPU::OpName::src1_modifiers,
8779+ AMDGPU::OpName::src2_modifiers};
87808780
87818781 unsigned OpSel = Inst.getOperand (OpSelIdx).getImm ();
87828782
@@ -8912,12 +8912,11 @@ void AMDGPUAsmParser::cvtVOP3P(MCInst &Inst, const OperandVector &Operands,
89128912 if (NegHiIdx != -1 )
89138913 addOptionalImmOperand (Inst, Operands, OptIdx, AMDGPUOperand::ImmTyNegHi);
89148914
8915- const int Ops[] = { AMDGPU::OpName::src0,
8916- AMDGPU::OpName::src1,
8917- AMDGPU::OpName::src2 };
8918- const int ModOps[] = { AMDGPU::OpName::src0_modifiers,
8919- AMDGPU::OpName::src1_modifiers,
8920- AMDGPU::OpName::src2_modifiers };
8915+ const AMDGPU::OpName Ops[] = {AMDGPU::OpName::src0, AMDGPU::OpName::src1,
8916+ AMDGPU::OpName::src2};
8917+ const AMDGPU::OpName ModOps[] = {AMDGPU::OpName::src0_modifiers,
8918+ AMDGPU::OpName::src1_modifiers,
8919+ AMDGPU::OpName::src2_modifiers};
89218920
89228921 unsigned OpSel = 0 ;
89238922 unsigned OpSelHi = 0 ;
@@ -8980,7 +8979,8 @@ void AMDGPUAsmParser::cvtVOP3P(MCInst &Inst, const OperandVector &Operands) {
89808979}
89818980
89828981static void addSrcModifiersAndSrc (MCInst &Inst, const OperandVector &Operands,
8983- unsigned i, unsigned Opc, unsigned OpName) {
8982+ unsigned i, unsigned Opc,
8983+ AMDGPU::OpName OpName) {
89848984 if (AMDGPU::getNamedOperandIdx (Opc, OpName) != -1 )
89858985 ((AMDGPUOperand &)*Operands[i]).addRegOrImmWithFPInputModsOperands (Inst, 2 );
89868986 else
0 commit comments