File tree Expand file tree Collapse file tree 2 files changed +19
-5
lines changed
lib/Target/PowerPC/AsmParser Expand file tree Collapse file tree 2 files changed +19
-5
lines changed Original file line number Diff line number Diff line change @@ -1320,7 +1320,10 @@ MCRegister PPCAsmParser::matchRegisterName(int64_t &IntVal) {
13201320 if (!getParser ().getTok ().is (AsmToken::Identifier))
13211321 return MCRegister ();
13221322
1323- StringRef Name = getParser ().getTok ().getString ();
1323+ // MatchRegisterName() expects lower-case registers, but we want to support
1324+ // case-insensitive spelling.
1325+ std::string NameBuf = getParser ().getTok ().getString ().lower ();
1326+ StringRef Name (NameBuf);
13241327 MCRegister RegNo = MatchRegisterName (Name);
13251328 if (!RegNo)
13261329 return RegNo;
@@ -1329,15 +1332,15 @@ MCRegister PPCAsmParser::matchRegisterName(int64_t &IntVal) {
13291332
13301333 // MatchRegisterName doesn't seem to have special handling for 64bit vs 32bit
13311334 // register types.
1332- if (Name. equals_insensitive ( " lr" ) ) {
1335+ if (Name == " lr" ) {
13331336 RegNo = isPPC64 () ? PPC::LR8 : PPC::LR;
13341337 IntVal = 8 ;
1335- } else if (Name. equals_insensitive ( " ctr" ) ) {
1338+ } else if (Name == " ctr" ) {
13361339 RegNo = isPPC64 () ? PPC::CTR8 : PPC::CTR;
13371340 IntVal = 9 ;
1338- } else if (Name. equals_insensitive ( " vrsave" ) )
1341+ } else if (Name == " vrsave" )
13391342 IntVal = 256 ;
1340- else if (Name.starts_with_insensitive (" r" ))
1343+ else if (Name.starts_with (" r" ))
13411344 RegNo = isPPC64 () ? XRegs[IntVal] : RRegs[IntVal];
13421345
13431346 getParser ().Lex ();
Original file line number Diff line number Diff line change 1+ # RUN: llvm-mc -triple powerpc64le-unknown-unknown %s 2>&1 | FileCheck %s
2+
3+ # Test that upper case registers are accepted.
4+
5+ # CHECK-LABEL: test:
6+ # CHECK-NEXT: ld 1, 0(3)
7+ # CHECK-NEXT: blr
8+
9+ test:
10+ ld %R1, 0 (%R3)
11+ blr
You can’t perform that action at this time.
0 commit comments