[llvm] r313680 - [ARM] Relax 'cpsie'/'cpsid' flag parsing.

Jonathan Roelofs via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 19 14:23:19 PDT 2017


Author: jroelofs
Date: Tue Sep 19 14:23:19 2017
New Revision: 313680

URL: http://llvm.org/viewvc/llvm-project?rev=313680&view=rev
Log:
[ARM] Relax 'cpsie'/'cpsid' flag parsing.

The ARM docs suggest in examples that the flags can have either case, and there
are applications in the wild that (libopencm3, for example) that expect to be
able to use the uppercase spelling.

https://reviews.llvm.org/D37953

Modified:
    llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
    llvm/trunk/test/MC/ARM/basic-arm-instructions.s

Modified: llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp?rev=313680&r1=313679&r2=313680&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp (original)
+++ llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp Tue Sep 19 14:23:19 2017
@@ -4023,7 +4023,7 @@ ARMAsmParser::parseProcIFlagsOperand(Ope
   unsigned IFlags = 0;
   if (IFlagsStr != "none") {
         for (int i = 0, e = IFlagsStr.size(); i != e; ++i) {
-      unsigned Flag = StringSwitch<unsigned>(IFlagsStr.substr(i, 1))
+      unsigned Flag = StringSwitch<unsigned>(IFlagsStr.substr(i, 1).lower())
         .Case("a", ARM_PROC::A)
         .Case("i", ARM_PROC::I)
         .Case("f", ARM_PROC::F)

Modified: llvm/trunk/test/MC/ARM/basic-arm-instructions.s
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ARM/basic-arm-instructions.s?rev=313680&r1=313679&r2=313680&view=diff
==============================================================================
--- llvm/trunk/test/MC/ARM/basic-arm-instructions.s (original)
+++ llvm/trunk/test/MC/ARM/basic-arm-instructions.s Tue Sep 19 14:23:19 2017
@@ -791,10 +791,12 @@ Lforward:
 @ CPS
 @------------------------------------------------------------------------------
         cpsie  aif
+        cpsie  AIF
         cps  #15
         cpsid  if, #10
 
 @ CHECK: cpsie  aif @ encoding: [0xc0,0x01,0x08,0xf1]
+@ CHECK: cpsie  aif @ encoding: [0xc0,0x01,0x08,0xf1]
 @ CHECK: cps  #15 @ encoding: [0x0f,0x00,0x02,0xf1]
 @ CHECK: cpsid  if, #10 @ encoding: [0xca,0x00,0x0e,0xf1]
 




More information about the llvm-commits mailing list