summaryrefslogtreecommitdiff
path: root/lib/Target/ARM/AsmParser
diff options
context:
space:
mode:
authorMihai Popa <mihail.popa@gmail.com>2013-08-21 13:14:58 +0000
committerMihai Popa <mihail.popa@gmail.com>2013-08-21 13:14:58 +0000
commit1a9f21abac47dcea0c62341b0ee4fd35481350b8 (patch)
tree32cb251e0265df494a0c64e60801dfa9c1410076 /lib/Target/ARM/AsmParser
parent8ba76daba09e79b10c4aad8f4298433c6dafa6d5 (diff)
downloadllvm-1a9f21abac47dcea0c62341b0ee4fd35481350b8.tar.gz
llvm-1a9f21abac47dcea0c62341b0ee4fd35481350b8.tar.bz2
llvm-1a9f21abac47dcea0c62341b0ee4fd35481350b8.tar.xz
Make "mov" work for all Thumb2 MOV encodings
According to the ARM specification, "mov" is a valid mnemonic for all Thumb2 MOV encodings. To achieve this, the patch adds one instruction alias with a special range condition to avoid collision with the Thumb1 MOV. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188901 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/AsmParser')
-rw-r--r--lib/Target/ARM/AsmParser/ARMAsmParser.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
index df9306a9b9..7467071db3 100644
--- a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
+++ b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
@@ -867,6 +867,15 @@ public:
int64_t Value = CE->getValue();
return Value >= 0 && Value < 65536;
}
+ bool isImm256_65535Expr() const {
+ if (!isImm()) return false;
+ const MCConstantExpr *CE = dyn_cast<MCConstantExpr>(getImm());
+ // If it's not a constant expression, it'll generate a fixup and be
+ // handled later.
+ if (!CE) return true;
+ int64_t Value = CE->getValue();
+ return Value >= 256 && Value < 65536;
+ }
bool isImm0_65535Expr() const {
if (!isImm()) return false;
const MCConstantExpr *CE = dyn_cast<MCConstantExpr>(getImm());