]> granicus.if.org Git - llvm/commitdiff
[ARM] Relax 'cpsie'/'cpsid' flag parsing.
authorJonathan Roelofs <jonathan@codesourcery.com>
Tue, 19 Sep 2017 21:23:19 +0000 (21:23 +0000)
committerJonathan Roelofs <jonathan@codesourcery.com>
Tue, 19 Sep 2017 21:23:19 +0000 (21:23 +0000)
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@313680 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/AsmParser/ARMAsmParser.cpp
test/MC/ARM/basic-arm-instructions.s

index 43135ad2103e670aa308c2771c68de2fd4cc0328..9abb6eab951ea0e110b091a619de2d1a0c16ed02 100644 (file)
@@ -4023,7 +4023,7 @@ ARMAsmParser::parseProcIFlagsOperand(OperandVector &Operands) {
   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)
index da68a6cfd104574e8f1dfb7a4dd4797c9a5743a6..d4d79364b3d7ab2db2db38324826861f300679f0 100644 (file)
@@ -791,9 +791,11 @@ 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]