Skip to content

Commit d9e4c10

Browse files
committed
[AArch64] Simplify with MCSubtargetInfo::hasFeature. NFC
1 parent c0f3ac1 commit d9e4c10

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

llvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3408,8 +3408,7 @@ AArch64AsmParser::parseCondCodeString(StringRef Cond, std::string &Suggestion) {
34083408
.Case("nv", AArch64CC::NV)
34093409
.Default(AArch64CC::Invalid);
34103410

3411-
if (CC == AArch64CC::Invalid &&
3412-
getSTI().getFeatureBits()[AArch64::FeatureSVE]) {
3411+
if (CC == AArch64CC::Invalid && getSTI().hasFeature(AArch64::FeatureSVE)) {
34133412
CC = StringSwitch<AArch64CC::CondCode>(Cond.lower())
34143413
.Case("none", AArch64CC::EQ)
34153414
.Case("any", AArch64CC::NE)
@@ -6355,7 +6354,7 @@ bool AArch64AsmParser::MatchAndEmitInstruction(SMLoc IDLoc, unsigned &Opcode,
63556354
// instruction for FP registers correctly in some rare circumstances. Convert
63566355
// it to a safe instruction and warn (because silently changing someone's
63576356
// assembly is rude).
6358-
if (getSTI().getFeatureBits()[AArch64::FeatureZCZeroingFPWorkaround] &&
6357+
if (getSTI().hasFeature(AArch64::FeatureZCZeroingFPWorkaround) &&
63596358
NumOperands == 4 && Tok == "movi") {
63606359
AArch64Operand &Op1 = static_cast<AArch64Operand &>(*Operands[1]);
63616360
AArch64Operand &Op2 = static_cast<AArch64Operand &>(*Operands[2]);

llvm/lib/Target/AArch64/MCTargetDesc/AArch64InstPrinter.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,7 @@ void AArch64InstPrinter::printInst(const MCInst *MI, uint64_t Address,
213213
int ImmS = MI->getOperand(4).getImm();
214214

215215
if ((Op2.getReg() == AArch64::WZR || Op2.getReg() == AArch64::XZR) &&
216-
(ImmR == 0 || ImmS < ImmR) &&
217-
STI.getFeatureBits()[AArch64::HasV8_2aOps]) {
216+
(ImmR == 0 || ImmS < ImmR) && STI.hasFeature(AArch64::HasV8_2aOps)) {
218217
// BFC takes precedence over its entire range, sligtly differently to BFI.
219218
int BitWidth = Opcode == AArch64::BFMXri ? 64 : 32;
220219
int LSB = (BitWidth - ImmR) % BitWidth;

0 commit comments

Comments
 (0)