Skip to content

Commit 728fb23

Browse files
authored
[X86][MC] Support case insenstive for dfv,sf,cf,of,zf for CCMP/CTEST (#95910)
1 parent 0c02811 commit 728fb23

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2318,7 +2318,7 @@ bool X86AsmParser::parseCFlagsOp(OperandVector &Operands) {
23182318
return Error(Tok.getLoc(), "Expected { at this point");
23192319
Parser.Lex(); // Eat "{"
23202320
Tok = Parser.getTok();
2321-
if (Tok.getIdentifier() != "dfv")
2321+
if (Tok.getIdentifier().lower() != "dfv")
23222322
return Error(Tok.getLoc(), "Expected dfv at this point");
23232323
Parser.Lex(); // Eat "dfv"
23242324
Tok = Parser.getTok();
@@ -2338,7 +2338,7 @@ bool X86AsmParser::parseCFlagsOp(OperandVector &Operands) {
23382338
unsigned CFlags = 0;
23392339
for (unsigned I = 0; I < 4; ++I) {
23402340
Tok = Parser.getTok();
2341-
unsigned CFlag = StringSwitch<unsigned>(Tok.getIdentifier())
2341+
unsigned CFlag = StringSwitch<unsigned>(Tok.getIdentifier().lower())
23422342
.Case("of", 0x8)
23432343
.Case("sf", 0x4)
23442344
.Case("zf", 0x2)

llvm/test/MC/X86/apx/ccmp-att.s

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# RUN: llvm-mc -triple x86_64 -show-encoding %s | FileCheck %s
22
# RUN: not llvm-mc -triple i386 -show-encoding %s 2>&1 | FileCheck %s --check-prefix=ERROR
33

4-
# ERROR-COUNT-401: error:
4+
# ERROR-COUNT-402: error:
55
# ERROR-NOT: error:
66
## Condition flags
77

@@ -1211,3 +1211,9 @@
12111211
# CHECK: ccmpeq {dfv=of} %r9, %r15
12121212
# CHECK: encoding: [0x62,0x54,0xc4,0x04,0x39,0xcf]
12131213
ccmpeq {dfv=of} %r9, %r15
1214+
1215+
## Case sensitive
1216+
1217+
# CHECK: ccmpoq {dfv=of,sf,zf,cf} %rax, %rbx
1218+
# CHECK: encoding: [0x62,0xf4,0xfc,0x00,0x39,0xc3]
1219+
ccmpoq {dFV=Cf,zF,SF,of} %rax, %rbx

llvm/test/MC/X86/apx/ccmp-intel.s

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,3 +1208,9 @@
12081208
# CHECK: ccmpe {dfv=of} r15, r9
12091209
# CHECK: encoding: [0x62,0x54,0xc4,0x04,0x39,0xcf]
12101210
ccmpe {dfv=of} r15, r9
1211+
1212+
## Case sensitive
1213+
1214+
# CHECK: ccmpo {dfv=of,sf,zf,cf} rbx, rax
1215+
# CHECK: encoding: [0x62,0xf4,0xfc,0x00,0x39,0xc3]
1216+
ccmpo {DFv=Cf,zF,SF,of} rbx, rax

0 commit comments

Comments
 (0)