@@ -136,8 +136,8 @@ class AArch64AsmParser : public MCTargetAsmParser {
136
136
assert (Predicated);
137
137
return ElementSize;
138
138
}
139
- unsigned getDstReg () const { return Dst; }
140
- unsigned getPgReg () const {
139
+ MCRegister getDstReg () const { return Dst; }
140
+ MCRegister getPgReg () const {
141
141
assert (Predicated);
142
142
return Pg;
143
143
}
@@ -146,8 +146,8 @@ class AArch64AsmParser : public MCTargetAsmParser {
146
146
bool Active = false ;
147
147
bool Predicated = false ;
148
148
unsigned ElementSize;
149
- unsigned Dst;
150
- unsigned Pg;
149
+ MCRegister Dst;
150
+ MCRegister Pg;
151
151
} NextPrefix;
152
152
153
153
AArch64TargetStreamer &getTargetStreamer () {
@@ -5234,7 +5234,7 @@ bool AArch64AsmParser::parseInstruction(ParseInstructionInfo &Info,
5234
5234
return false ;
5235
5235
}
5236
5236
5237
- static inline bool isMatchingOrAlias (unsigned ZReg, unsigned Reg) {
5237
+ static inline bool isMatchingOrAlias (MCRegister ZReg, MCRegister Reg) {
5238
5238
assert ((ZReg >= AArch64::Z0) && (ZReg <= AArch64::Z31));
5239
5239
return (ZReg == ((Reg - AArch64::B0) + AArch64::Z0)) ||
5240
5240
(ZReg == ((Reg - AArch64::H0) + AArch64::Z0)) ||
@@ -5322,7 +5322,7 @@ bool AArch64AsmParser::validateInstruction(MCInst &Inst, SMLoc &IDLoc,
5322
5322
if (IsWindowsArm64EC) {
5323
5323
for (unsigned i = 0 ; i < Inst.getNumOperands (); ++i) {
5324
5324
if (Inst.getOperand (i).isReg ()) {
5325
- unsigned Reg = Inst.getOperand (i).getReg ();
5325
+ MCRegister Reg = Inst.getOperand (i).getReg ();
5326
5326
// At this point, vector registers are matched to their
5327
5327
// appropriately sized alias.
5328
5328
if ((Reg == AArch64::W13 || Reg == AArch64::X13) ||
@@ -5351,9 +5351,9 @@ bool AArch64AsmParser::validateInstruction(MCInst &Inst, SMLoc &IDLoc,
5351
5351
case AArch64::LDPWpre:
5352
5352
case AArch64::LDPXpost:
5353
5353
case AArch64::LDPXpre: {
5354
- unsigned Rt = Inst.getOperand (1 ).getReg ();
5355
- unsigned Rt2 = Inst.getOperand (2 ).getReg ();
5356
- unsigned Rn = Inst.getOperand (3 ).getReg ();
5354
+ MCRegister Rt = Inst.getOperand (1 ).getReg ();
5355
+ MCRegister Rt2 = Inst.getOperand (2 ).getReg ();
5356
+ MCRegister Rn = Inst.getOperand (3 ).getReg ();
5357
5357
if (RI->isSubRegisterEq (Rn, Rt))
5358
5358
return Error (Loc[0 ], " unpredictable LDP instruction, writeback base "
5359
5359
" is also a destination" );
@@ -5376,8 +5376,8 @@ bool AArch64AsmParser::validateInstruction(MCInst &Inst, SMLoc &IDLoc,
5376
5376
case AArch64::LDPSWi:
5377
5377
case AArch64::LDPWi:
5378
5378
case AArch64::LDPXi: {
5379
- unsigned Rt = Inst.getOperand (0 ).getReg ();
5380
- unsigned Rt2 = Inst.getOperand (1 ).getReg ();
5379
+ MCRegister Rt = Inst.getOperand (0 ).getReg ();
5380
+ MCRegister Rt2 = Inst.getOperand (1 ).getReg ();
5381
5381
if (Rt == Rt2)
5382
5382
return Error (Loc[1 ], " unpredictable LDP instruction, Rt2==Rt" );
5383
5383
break ;
@@ -5389,8 +5389,8 @@ bool AArch64AsmParser::validateInstruction(MCInst &Inst, SMLoc &IDLoc,
5389
5389
case AArch64::LDPSpost:
5390
5390
case AArch64::LDPSpre:
5391
5391
case AArch64::LDPSWpost: {
5392
- unsigned Rt = Inst.getOperand (1 ).getReg ();
5393
- unsigned Rt2 = Inst.getOperand (2 ).getReg ();
5392
+ MCRegister Rt = Inst.getOperand (1 ).getReg ();
5393
+ MCRegister Rt2 = Inst.getOperand (2 ).getReg ();
5394
5394
if (Rt == Rt2)
5395
5395
return Error (Loc[1 ], " unpredictable LDP instruction, Rt2==Rt" );
5396
5396
break ;
@@ -5405,9 +5405,9 @@ bool AArch64AsmParser::validateInstruction(MCInst &Inst, SMLoc &IDLoc,
5405
5405
case AArch64::STPWpre:
5406
5406
case AArch64::STPXpost:
5407
5407
case AArch64::STPXpre: {
5408
- unsigned Rt = Inst.getOperand (1 ).getReg ();
5409
- unsigned Rt2 = Inst.getOperand (2 ).getReg ();
5410
- unsigned Rn = Inst.getOperand (3 ).getReg ();
5408
+ MCRegister Rt = Inst.getOperand (1 ).getReg ();
5409
+ MCRegister Rt2 = Inst.getOperand (2 ).getReg ();
5410
+ MCRegister Rn = Inst.getOperand (3 ).getReg ();
5411
5411
if (RI->isSubRegisterEq (Rn, Rt))
5412
5412
return Error (Loc[0 ], " unpredictable STP instruction, writeback base "
5413
5413
" is also a source" );
@@ -5438,8 +5438,8 @@ bool AArch64AsmParser::validateInstruction(MCInst &Inst, SMLoc &IDLoc,
5438
5438
case AArch64::LDRSWpost:
5439
5439
case AArch64::LDRWpost:
5440
5440
case AArch64::LDRXpost: {
5441
- unsigned Rt = Inst.getOperand (1 ).getReg ();
5442
- unsigned Rn = Inst.getOperand (2 ).getReg ();
5441
+ MCRegister Rt = Inst.getOperand (1 ).getReg ();
5442
+ MCRegister Rn = Inst.getOperand (2 ).getReg ();
5443
5443
if (RI->isSubRegisterEq (Rn, Rt))
5444
5444
return Error (Loc[0 ], " unpredictable LDR instruction, writeback base "
5445
5445
" is also a source" );
@@ -5457,8 +5457,8 @@ bool AArch64AsmParser::validateInstruction(MCInst &Inst, SMLoc &IDLoc,
5457
5457
case AArch64::STRHpre:
5458
5458
case AArch64::STRWpre:
5459
5459
case AArch64::STRXpre: {
5460
- unsigned Rt = Inst.getOperand (1 ).getReg ();
5461
- unsigned Rn = Inst.getOperand (2 ).getReg ();
5460
+ MCRegister Rt = Inst.getOperand (1 ).getReg ();
5461
+ MCRegister Rn = Inst.getOperand (2 ).getReg ();
5462
5462
if (RI->isSubRegisterEq (Rn, Rt))
5463
5463
return Error (Loc[0 ], " unpredictable STR instruction, writeback base "
5464
5464
" is also a source" );
@@ -5472,9 +5472,9 @@ bool AArch64AsmParser::validateInstruction(MCInst &Inst, SMLoc &IDLoc,
5472
5472
case AArch64::STLXRH:
5473
5473
case AArch64::STLXRW:
5474
5474
case AArch64::STLXRX: {
5475
- unsigned Rs = Inst.getOperand (0 ).getReg ();
5476
- unsigned Rt = Inst.getOperand (1 ).getReg ();
5477
- unsigned Rn = Inst.getOperand (2 ).getReg ();
5475
+ MCRegister Rs = Inst.getOperand (0 ).getReg ();
5476
+ MCRegister Rt = Inst.getOperand (1 ).getReg ();
5477
+ MCRegister Rn = Inst.getOperand (2 ).getReg ();
5478
5478
if (RI->isSubRegisterEq (Rt, Rs) ||
5479
5479
(RI->isSubRegisterEq (Rn, Rs) && Rn != AArch64::SP))
5480
5480
return Error (Loc[0 ],
@@ -5485,10 +5485,10 @@ bool AArch64AsmParser::validateInstruction(MCInst &Inst, SMLoc &IDLoc,
5485
5485
case AArch64::STXPX:
5486
5486
case AArch64::STLXPW:
5487
5487
case AArch64::STLXPX: {
5488
- unsigned Rs = Inst.getOperand (0 ).getReg ();
5489
- unsigned Rt1 = Inst.getOperand (1 ).getReg ();
5490
- unsigned Rt2 = Inst.getOperand (2 ).getReg ();
5491
- unsigned Rn = Inst.getOperand (3 ).getReg ();
5488
+ MCRegister Rs = Inst.getOperand (0 ).getReg ();
5489
+ MCRegister Rt1 = Inst.getOperand (1 ).getReg ();
5490
+ MCRegister Rt2 = Inst.getOperand (2 ).getReg ();
5491
+ MCRegister Rn = Inst.getOperand (3 ).getReg ();
5492
5492
if (RI->isSubRegisterEq (Rt1, Rs) || RI->isSubRegisterEq (Rt2, Rs) ||
5493
5493
(RI->isSubRegisterEq (Rn, Rs) && Rn != AArch64::SP))
5494
5494
return Error (Loc[0 ],
@@ -5497,8 +5497,8 @@ bool AArch64AsmParser::validateInstruction(MCInst &Inst, SMLoc &IDLoc,
5497
5497
}
5498
5498
case AArch64::LDRABwriteback:
5499
5499
case AArch64::LDRAAwriteback: {
5500
- unsigned Xt = Inst.getOperand (0 ).getReg ();
5501
- unsigned Xn = Inst.getOperand (1 ).getReg ();
5500
+ MCRegister Xt = Inst.getOperand (0 ).getReg ();
5501
+ MCRegister Xn = Inst.getOperand (1 ).getReg ();
5502
5502
if (Xt == Xn)
5503
5503
return Error (Loc[0 ],
5504
5504
" unpredictable LDRA instruction, writeback base"
@@ -5605,12 +5605,12 @@ bool AArch64AsmParser::validateInstruction(MCInst &Inst, SMLoc &IDLoc,
5605
5605
case AArch64::CPYETWN:
5606
5606
case AArch64::CPYETRN:
5607
5607
case AArch64::CPYETN: {
5608
- unsigned Xd_wb = Inst.getOperand (0 ).getReg ();
5609
- unsigned Xs_wb = Inst.getOperand (1 ).getReg ();
5610
- unsigned Xn_wb = Inst.getOperand (2 ).getReg ();
5611
- unsigned Xd = Inst.getOperand (3 ).getReg ();
5612
- unsigned Xs = Inst.getOperand (4 ).getReg ();
5613
- unsigned Xn = Inst.getOperand (5 ).getReg ();
5608
+ MCRegister Xd_wb = Inst.getOperand (0 ).getReg ();
5609
+ MCRegister Xs_wb = Inst.getOperand (1 ).getReg ();
5610
+ MCRegister Xn_wb = Inst.getOperand (2 ).getReg ();
5611
+ MCRegister Xd = Inst.getOperand (3 ).getReg ();
5612
+ MCRegister Xs = Inst.getOperand (4 ).getReg ();
5613
+ MCRegister Xn = Inst.getOperand (5 ).getReg ();
5614
5614
if (Xd_wb != Xd)
5615
5615
return Error (Loc[0 ],
5616
5616
" invalid CPY instruction, Xd_wb and Xd do not match" );
@@ -5655,11 +5655,11 @@ bool AArch64AsmParser::validateInstruction(MCInst &Inst, SMLoc &IDLoc,
5655
5655
case AArch64::MOPSSETGET:
5656
5656
case AArch64::MOPSSETGEN:
5657
5657
case AArch64::MOPSSETGETN: {
5658
- unsigned Xd_wb = Inst.getOperand (0 ).getReg ();
5659
- unsigned Xn_wb = Inst.getOperand (1 ).getReg ();
5660
- unsigned Xd = Inst.getOperand (2 ).getReg ();
5661
- unsigned Xn = Inst.getOperand (3 ).getReg ();
5662
- unsigned Xm = Inst.getOperand (4 ).getReg ();
5658
+ MCRegister Xd_wb = Inst.getOperand (0 ).getReg ();
5659
+ MCRegister Xn_wb = Inst.getOperand (1 ).getReg ();
5660
+ MCRegister Xd = Inst.getOperand (2 ).getReg ();
5661
+ MCRegister Xn = Inst.getOperand (3 ).getReg ();
5662
+ MCRegister Xm = Inst.getOperand (4 ).getReg ();
5663
5663
if (Xd_wb != Xd)
5664
5664
return Error (Loc[0 ],
5665
5665
" invalid SET instruction, Xd_wb and Xd do not match" );
@@ -6451,7 +6451,7 @@ bool AArch64AsmParser::matchAndEmitInstruction(SMLoc IDLoc, unsigned &Opcode,
6451
6451
// GPR64. Twiddle it here if necessary.
6452
6452
AArch64Operand &Op = static_cast <AArch64Operand &>(*Operands[2 ]);
6453
6453
if (Op.isScalarReg ()) {
6454
- unsigned Reg = getXRegFromWReg (Op.getReg ());
6454
+ MCRegister Reg = getXRegFromWReg (Op.getReg ());
6455
6455
Operands[2 ] = AArch64Operand::CreateReg (Reg, RegKind::Scalar,
6456
6456
Op.getStartLoc (), Op.getEndLoc (),
6457
6457
getContext ());
@@ -6467,7 +6467,7 @@ bool AArch64AsmParser::matchAndEmitInstruction(SMLoc IDLoc, unsigned &Opcode,
6467
6467
// GPR64. Twiddle it here if necessary.
6468
6468
AArch64Operand &Op = static_cast <AArch64Operand &>(*Operands[2 ]);
6469
6469
if (Op.isScalarReg ()) {
6470
- unsigned Reg = getXRegFromWReg (Op.getReg ());
6470
+ MCRegister Reg = getXRegFromWReg (Op.getReg ());
6471
6471
Operands[2 ] = AArch64Operand::CreateReg (Reg, RegKind::Scalar,
6472
6472
Op.getStartLoc (),
6473
6473
Op.getEndLoc (), getContext ());
@@ -6484,7 +6484,7 @@ bool AArch64AsmParser::matchAndEmitInstruction(SMLoc IDLoc, unsigned &Opcode,
6484
6484
// GPR32. Twiddle it here if necessary.
6485
6485
AArch64Operand &Op = static_cast <AArch64Operand &>(*Operands[1 ]);
6486
6486
if (Op.isScalarReg ()) {
6487
- unsigned Reg = getWRegFromXReg (Op.getReg ());
6487
+ MCRegister Reg = getWRegFromXReg (Op.getReg ());
6488
6488
Operands[1 ] = AArch64Operand::CreateReg (Reg, RegKind::Scalar,
6489
6489
Op.getStartLoc (),
6490
6490
Op.getEndLoc (), getContext ());
@@ -7907,7 +7907,7 @@ ParseStatus AArch64AsmParser::tryParseGPRSeqPair(OperandVector &Operands) {
7907
7907
return Error (E, " expected second odd register of a consecutive same-size "
7908
7908
" even/odd register pair" );
7909
7909
7910
- unsigned Pair = 0 ;
7910
+ MCRegister Pair;
7911
7911
if (isXReg) {
7912
7912
Pair = RI->getMatchingSuperReg (FirstReg, AArch64::sube64,
7913
7913
&AArch64MCRegisterClasses[AArch64::XSeqPairsClassRegClassID]);
@@ -8047,7 +8047,7 @@ ParseStatus AArch64AsmParser::tryParseGPR64x8(OperandVector &Operands) {
8047
8047
8048
8048
MCContext &ctx = getContext ();
8049
8049
const MCRegisterInfo *RI = ctx.getRegisterInfo ();
8050
- int X8Reg = RI->getMatchingSuperReg (
8050
+ MCRegister X8Reg = RI->getMatchingSuperReg (
8051
8051
XReg, AArch64::x8sub_0,
8052
8052
&AArch64MCRegisterClasses[AArch64::GPR64x8ClassRegClassID]);
8053
8053
if (!X8Reg)
0 commit comments