summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2014-04-30 13:36:56 +0000
committerTim Northover <tnorthover@apple.com>2014-04-30 13:36:56 +0000
commitbfb7bc89df1542bbc448da3d04e4d97cad108a1d (patch)
tree0ff6b93ca0457cf0a1a3c96a6e40677b4f8db9d8
parent36c74721061dedfa3d704bfff18170ffc49d0e44 (diff)
downloadllvm-bfb7bc89df1542bbc448da3d04e4d97cad108a1d.tar.gz
llvm-bfb7bc89df1542bbc448da3d04e4d97cad108a1d.tar.bz2
llvm-bfb7bc89df1542bbc448da3d04e4d97cad108a1d.tar.xz
AArch64/ARM64: copy support for bCC instead of b.CC across.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207646 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/ARM64/AsmParser/ARM64AsmParser.cpp21
-rw-r--r--test/MC/ARM64/condbr-without-dots.s37
2 files changed, 58 insertions, 0 deletions
diff --git a/lib/Target/ARM64/AsmParser/ARM64AsmParser.cpp b/lib/Target/ARM64/AsmParser/ARM64AsmParser.cpp
index 115bff89c4..6a8310e8f2 100644
--- a/lib/Target/ARM64/AsmParser/ARM64AsmParser.cpp
+++ b/lib/Target/ARM64/AsmParser/ARM64AsmParser.cpp
@@ -3257,6 +3257,27 @@ bool ARM64AsmParser::parseOperand(OperandVector &Operands, bool isCondCode,
bool ARM64AsmParser::ParseInstruction(ParseInstructionInfo &Info,
StringRef Name, SMLoc NameLoc,
OperandVector &Operands) {
+ Name = StringSwitch<StringRef>(Name.lower())
+ .Case("beq", "b.eq")
+ .Case("bne", "b.ne")
+ .Case("bhs", "b.hs")
+ .Case("bcs", "b.cs")
+ .Case("blo", "b.lo")
+ .Case("bcc", "b.cc")
+ .Case("bmi", "b.mi")
+ .Case("bpl", "b.pl")
+ .Case("bvs", "b.vs")
+ .Case("bvc", "b.vc")
+ .Case("bhi", "b.hi")
+ .Case("bls", "b.ls")
+ .Case("bge", "b.ge")
+ .Case("blt", "b.lt")
+ .Case("bgt", "b.gt")
+ .Case("ble", "b.le")
+ .Case("bal", "b.al")
+ .Case("bnv", "b.nv")
+ .Default(Name);
+
// Create the leading tokens for the mnemonic, split by '.' characters.
size_t Start = 0, Next = Name.find('.');
StringRef Head = Name.slice(Start, Next);
diff --git a/test/MC/ARM64/condbr-without-dots.s b/test/MC/ARM64/condbr-without-dots.s
new file mode 100644
index 0000000000..2a9f7a7cf7
--- /dev/null
+++ b/test/MC/ARM64/condbr-without-dots.s
@@ -0,0 +1,37 @@
+// RUN: llvm-mc -triple arm64-apple-ios -o - %s | FileCheck %s
+
+ beq lbl
+ bne lbl
+ bcs lbl
+ bhs lbl
+ blo lbl
+ bcc lbl
+ bmi lbl
+ bpl lbl
+ bvs lbl
+ bvc lbl
+ bhi lbl
+ bls lbl
+ bge lbl
+ blt lbl
+ bgt lbl
+ ble lbl
+ bal lbl
+
+// CHECK: b.eq lbl
+// CHECK: b.ne lbl
+// CHECK: b.hs lbl
+// CHECK: b.hs lbl
+// CHECK: b.lo lbl
+// CHECK: b.lo lbl
+// CHECK: b.mi lbl
+// CHECK: b.pl lbl
+// CHECK: b.vs lbl
+// CHECK: b.vc lbl
+// CHECK: b.hi lbl
+// CHECK: b.ls lbl
+// CHECK: b.ge lbl
+// CHECK: b.lt lbl
+// CHECK: b.gt lbl
+// CHECK: b.le lbl
+// CHECK: b.al lbl