-
Notifications
You must be signed in to change notification settings - Fork 13.4k
[ARM] Change the type of CC and VCC code in splitMnemonic
.
#83413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ARM] Change the type of CC and VCC code in splitMnemonic
.
#83413
Conversation
@llvm/pr-subscribers-mc @llvm/pr-subscribers-backend-arm Author: Alfie Richards (AlfieRichardsArm) ChangesThis changes the type of Full diff: https://github.com/llvm/llvm-project/pull/83413.diff 1 Files Affected:
diff --git a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
index 37bfb76a494dee..dd6c637a6fa2a0 100644
--- a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
+++ b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
@@ -506,9 +506,10 @@ class ARMAsmParser : public MCTargetAsmParser {
bool isMnemonicVPTPredicable(StringRef Mnemonic, StringRef ExtraToken);
StringRef splitMnemonic(StringRef Mnemonic, StringRef ExtraToken,
- unsigned &PredicationCode,
- unsigned &VPTPredicationCode, bool &CarrySetting,
- unsigned &ProcessorIMod, StringRef &ITMask);
+ ARMCC::CondCodes &PredicationCode,
+ ARMVCC::VPTCodes &VPTPredicationCode,
+ bool &CarrySetting, unsigned &ProcessorIMod,
+ StringRef &ITMask);
void getMnemonicAcceptInfo(StringRef Mnemonic, StringRef ExtraToken,
StringRef FullInst, bool &CanAcceptCarrySet,
bool &CanAcceptPredicationCode,
@@ -6283,10 +6284,9 @@ bool ARMAsmParser::parsePrefix(ARMMCExpr::VariantKind &RefKind) {
//
// FIXME: Would be nice to autogen this.
// FIXME: This is a bit of a maze of special cases.
-StringRef ARMAsmParser::splitMnemonic(StringRef Mnemonic,
- StringRef ExtraToken,
- unsigned &PredicationCode,
- unsigned &VPTPredicationCode,
+StringRef ARMAsmParser::splitMnemonic(StringRef Mnemonic, StringRef ExtraToken,
+ ARMCC::CondCodes &PredicationCode,
+ ARMVCC::VPTCodes &VPTPredicationCode,
bool &CarrySetting,
unsigned &ProcessorIMod,
StringRef &ITMask) {
@@ -6340,7 +6340,7 @@ StringRef ARMAsmParser::splitMnemonic(StringRef Mnemonic,
unsigned CC = ARMCondCodeFromString(Mnemonic.substr(Mnemonic.size()-2));
if (CC != ~0U) {
Mnemonic = Mnemonic.slice(0, Mnemonic.size() - 2);
- PredicationCode = CC;
+ PredicationCode = (ARMCC::CondCodes)CC;
}
}
@@ -6387,7 +6387,7 @@ StringRef ARMAsmParser::splitMnemonic(StringRef Mnemonic,
unsigned CC = ARMVectorCondCodeFromString(Mnemonic.substr(Mnemonic.size()-1));
if (CC != ~0U) {
Mnemonic = Mnemonic.slice(0, Mnemonic.size()-1);
- VPTPredicationCode = CC;
+ VPTPredicationCode = (ARMVCC::VPTCodes)CC;
}
return Mnemonic;
}
|
This changes the type from `unsigned` to `ARMCC::CondCodes` for clarity and correctness.
28ce7d8
to
bc43e2d
Compare
Note the failing test is not relevant, seems to be a timeout or similar |
I will wait a couple days for external code review |
@s-barannikov I've added you as a reviewer as this commit is a prerequisite for some optional operands work that I will submit in coming days and I see you have worked on the same area. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Straightforward change, LGTM modulo style nit
@@ -6340,7 +6340,7 @@ StringRef ARMAsmParser::splitMnemonic(StringRef Mnemonic, | |||
unsigned CC = ARMCondCodeFromString(Mnemonic.substr(Mnemonic.size()-2)); | |||
if (CC != ~0U) { | |||
Mnemonic = Mnemonic.slice(0, Mnemonic.size() - 2); | |||
PredicationCode = CC; | |||
PredicationCode = (ARMCC::CondCodes)CC; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The anchor link really changes the meaning of that link (:
I'll get a quick fix in
✅ With the latest revision this PR passed the C/C++ code formatter. |
55a6345
to
bf7bbb1
Compare
Failing test continues to be a seemingly unrelated failure regarding MLIR |
0bc0eda
to
a1cd51c
Compare
a1cd51c
to
bf7bbb1
Compare
After a fixing me pushing to the wrong branch this is back to what it should be. |
Test failure is unrelated MLIR test. Merging this now. |
This changes the type of
PredicationCode
andVPTPredicationCode
fromunsigned
toARMCC::CondCodes
andARMVCC::VPTCodes
resp' for clarity and correctness.