-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
[X86][MC] Support case insenstive for dfv,sf,cf,of,zf
for CCMP/CTEST
#95910
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@llvm/pr-subscribers-mc @llvm/pr-subscribers-backend-x86 Author: Freddy Ye (FreddyLeaf) ChangesFull diff: https://github.com/llvm/llvm-project/pull/95910.diff 3 Files Affected:
diff --git a/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp b/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
index c0f54b223877c..dbea42d55b5fc 100644
--- a/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
+++ b/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
@@ -2318,7 +2318,7 @@ bool X86AsmParser::parseCFlagsOp(OperandVector &Operands) {
return Error(Tok.getLoc(), "Expected { at this point");
Parser.Lex(); // Eat "{"
Tok = Parser.getTok();
- if (Tok.getIdentifier() != "dfv")
+ if (Tok.getIdentifier().lower() != "dfv")
return Error(Tok.getLoc(), "Expected dfv at this point");
Parser.Lex(); // Eat "dfv"
Tok = Parser.getTok();
@@ -2338,7 +2338,7 @@ bool X86AsmParser::parseCFlagsOp(OperandVector &Operands) {
unsigned CFlags = 0;
for (unsigned I = 0; I < 4; ++I) {
Tok = Parser.getTok();
- unsigned CFlag = StringSwitch<unsigned>(Tok.getIdentifier())
+ unsigned CFlag = StringSwitch<unsigned>(Tok.getIdentifier().lower())
.Case("of", 0x8)
.Case("sf", 0x4)
.Case("zf", 0x2)
diff --git a/llvm/test/MC/X86/apx/ccmp-att.s b/llvm/test/MC/X86/apx/ccmp-att.s
index 0b78562f32e18..faf84f206a329 100644
--- a/llvm/test/MC/X86/apx/ccmp-att.s
+++ b/llvm/test/MC/X86/apx/ccmp-att.s
@@ -1,7 +1,7 @@
# RUN: llvm-mc -triple x86_64 -show-encoding %s | FileCheck %s
# RUN: not llvm-mc -triple i386 -show-encoding %s 2>&1 | FileCheck %s --check-prefix=ERROR
-# ERROR-COUNT-401: error:
+# ERROR-COUNT-402: error:
# ERROR-NOT: error:
## Condition flags
@@ -1211,3 +1211,9 @@
# CHECK: ccmpeq {dfv=of} %r9, %r15
# CHECK: encoding: [0x62,0x54,0xc4,0x04,0x39,0xcf]
ccmpeq {dfv=of} %r9, %r15
+
+## Case Sensitive
+
+# CHECK: ccmpoq {dfv=of,sf,zf,cf} %rax, %rbx
+# CHECK: encoding: [0x62,0xf4,0xfc,0x00,0x39,0xc3]
+ ccmpoq {dFV=Cf,zF,SF,of} %rax, %rbx
diff --git a/llvm/test/MC/X86/apx/ccmp-intel.s b/llvm/test/MC/X86/apx/ccmp-intel.s
index 095f7fb71b7c8..42155efeff401 100644
--- a/llvm/test/MC/X86/apx/ccmp-intel.s
+++ b/llvm/test/MC/X86/apx/ccmp-intel.s
@@ -1208,3 +1208,9 @@
# CHECK: ccmpe {dfv=of} r15, r9
# CHECK: encoding: [0x62,0x54,0xc4,0x04,0x39,0xcf]
ccmpe {dfv=of} r15, r9
+
+## Case Sensitive
+
+# CHECK: ccmpo {dfv=of,sf,zf,cf} rbx, rax
+# CHECK: encoding: [0x62,0xf4,0xfc,0x00,0x39,0xc3]
+ ccmpo {DFv=Cf,zF,SF,of} rbx, rax
|
KanRobert
reviewed
Jun 18, 2024
KanRobert
reviewed
Jun 18, 2024
KanRobert
changed the title
[X86][MC] Support case insenstive for
[X86][MC] Support case insenstive for Jun 19, 2024
dfv,sf,cf,of,zf
.dfv,sf,cf,of,zf
for CCMP/CTEST
KanRobert
approved these changes
Jun 19, 2024
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.
LGTM
AlexisPerry
pushed a commit
to llvm-project-tlp/llvm-project
that referenced
this pull request
Jul 9, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.