@@ -1777,7 +1777,7 @@ class AMDGPUAsmParser : public MCTargetAsmParser {
1777
1777
bool validateMIMGDim (const MCInst &Inst, const OperandVector &Operands);
1778
1778
bool validateMIMGMSAA (const MCInst &Inst);
1779
1779
bool validateOpSel (const MCInst &Inst);
1780
- bool validateNeg (const MCInst &Inst, int OpName);
1780
+ bool validateNeg (const MCInst &Inst, AMDGPU::OpName OpName);
1781
1781
bool validateDPP (const MCInst &Inst, const OperandVector &Operands);
1782
1782
bool validateVccOperand (MCRegister Reg) const ;
1783
1783
bool validateVOPLiteral (const MCInst &Inst, const OperandVector &Operands);
@@ -3953,8 +3953,9 @@ bool AMDGPUAsmParser::validateMIMGAddrSize(const MCInst &Inst,
3953
3953
const AMDGPU::MIMGBaseOpcodeInfo *BaseOpcode =
3954
3954
AMDGPU::getMIMGBaseOpcodeInfo (Info->BaseOpcode );
3955
3955
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;
3958
3959
int SrsrcIdx = AMDGPU::getNamedOperandIdx (Opc, RSrcOpName);
3959
3960
int DimIdx = AMDGPU::getNamedOperandIdx (Opc, AMDGPU::OpName::dim);
3960
3961
int A16Idx = AMDGPU::getNamedOperandIdx (Opc, AMDGPU::OpName::a16);
@@ -4651,7 +4652,7 @@ bool AMDGPUAsmParser::validateOpSel(const MCInst &Inst) {
4651
4652
return true ;
4652
4653
}
4653
4654
4654
- bool AMDGPUAsmParser::validateNeg (const MCInst &Inst, int OpName) {
4655
+ bool AMDGPUAsmParser::validateNeg (const MCInst &Inst, AMDGPU::OpName OpName) {
4655
4656
assert (OpName == AMDGPU::OpName::neg_lo || OpName == AMDGPU::OpName::neg_hi);
4656
4657
4657
4658
const unsigned Opc = Inst.getOpcode ();
@@ -4676,9 +4677,9 @@ bool AMDGPUAsmParser::validateNeg(const MCInst &Inst, int OpName) {
4676
4677
// It is convenient that such instructions don't have src_modifiers operand
4677
4678
// for src operands that don't allow neg because they also don't allow opsel.
4678
4679
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};
4682
4683
4683
4684
for (unsigned i = 0 ; i < 3 ; ++i) {
4684
4685
if (!AMDGPU::hasNamedOperand (Opc, SrcMods[i])) {
@@ -4805,9 +4806,9 @@ bool AMDGPUAsmParser::validateVOPLiteral(const MCInst &Inst,
4805
4806
}
4806
4807
4807
4808
// 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 ,
4809
4810
const MCRegisterInfo *MRI) {
4810
- int OpIdx = AMDGPU::getNamedOperandIdx (Inst.getOpcode (), NameIdx );
4811
+ int OpIdx = AMDGPU::getNamedOperandIdx (Inst.getOpcode (), Name );
4811
4812
if (OpIdx < 0 )
4812
4813
return -1 ;
4813
4814
@@ -4828,12 +4829,13 @@ bool AMDGPUAsmParser::validateAGPRLdSt(const MCInst &Inst) const {
4828
4829
SIInstrFlags::DS)) == 0 )
4829
4830
return true ;
4830
4831
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;
4833
4835
4834
4836
const MCRegisterInfo *MRI = getMRI ();
4835
4837
int DstAreg = IsAGPROperand (Inst, AMDGPU::OpName::vdst, MRI);
4836
- int DataAreg = IsAGPROperand (Inst, DataNameIdx , MRI);
4838
+ int DataAreg = IsAGPROperand (Inst, DataName , MRI);
4837
4839
4838
4840
if ((TSFlags & SIInstrFlags::DS) && DataAreg >= 0 ) {
4839
4841
int Data2Areg = IsAGPROperand (Inst, AMDGPU::OpName::data1, MRI);
@@ -8647,9 +8649,8 @@ static void cvtVOP3DstOpSelOnly(MCInst &Inst, const MCRegisterInfo &MRI) {
8647
8649
return ;
8648
8650
8649
8651
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};
8653
8654
for (SrcNum = 0 ; SrcNum < 3 && AMDGPU::hasNamedOperand (Opc, Ops[SrcNum]);
8654
8655
++SrcNum)
8655
8656
;
@@ -8771,12 +8772,11 @@ void AMDGPUAsmParser::cvtVINTERP(MCInst &Inst, const OperandVector &Operands)
8771
8772
if (OpSelIdx == -1 )
8772
8773
return ;
8773
8774
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};
8780
8780
8781
8781
unsigned OpSel = Inst.getOperand (OpSelIdx).getImm ();
8782
8782
@@ -8912,12 +8912,11 @@ void AMDGPUAsmParser::cvtVOP3P(MCInst &Inst, const OperandVector &Operands,
8912
8912
if (NegHiIdx != -1 )
8913
8913
addOptionalImmOperand (Inst, Operands, OptIdx, AMDGPUOperand::ImmTyNegHi);
8914
8914
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};
8921
8920
8922
8921
unsigned OpSel = 0 ;
8923
8922
unsigned OpSelHi = 0 ;
@@ -8980,7 +8979,8 @@ void AMDGPUAsmParser::cvtVOP3P(MCInst &Inst, const OperandVector &Operands) {
8980
8979
}
8981
8980
8982
8981
static void addSrcModifiersAndSrc (MCInst &Inst, const OperandVector &Operands,
8983
- unsigned i, unsigned Opc, unsigned OpName) {
8982
+ unsigned i, unsigned Opc,
8983
+ AMDGPU::OpName OpName) {
8984
8984
if (AMDGPU::getNamedOperandIdx (Opc, OpName) != -1 )
8985
8985
((AMDGPUOperand &)*Operands[i]).addRegOrImmWithFPInputModsOperands (Inst, 2 );
8986
8986
else
0 commit comments