diff options
author | Jim Grosbach <grosbach@apple.com> | 2011-07-26 16:24:27 +0000 |
---|---|---|
committer | Jim Grosbach <grosbach@apple.com> | 2011-07-26 16:24:27 +0000 |
commit | ed8384806e56952c44f8a717c1ef54a8468d2c8d (patch) | |
tree | 13a8c3ce6ff1f9a945a3aa98643c6ed5d8854425 /lib/Target/ARM/AsmParser/ARMAsmParser.cpp | |
parent | 873db3eebae3cf1e0931149896f262d17a4dc79d (diff) |
ARM parsing and encoding for SVC instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136090 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/AsmParser/ARMAsmParser.cpp')
-rw-r--r-- | lib/Target/ARM/AsmParser/ARMAsmParser.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp index 39ca9530a1..c252ce8358 100644 --- a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp +++ b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp @@ -467,6 +467,14 @@ public: int64_t Value = CE->getValue(); return Value >= 0 && Value < 65536; } + bool isImm24bit() const { + if (Kind != Immediate) + return false; + const MCConstantExpr *CE = dyn_cast<MCConstantExpr>(getImm()); + if (!CE) return false; + int64_t Value = CE->getValue(); + return Value >= 0 && Value <= 0xffffff; + } bool isPKHLSLImm() const { if (Kind != Immediate) return false; @@ -738,6 +746,11 @@ public: addExpr(Inst, getImm()); } + void addImm24bitOperands(MCInst &Inst, unsigned N) const { + assert(N == 1 && "Invalid number of operands!"); + addExpr(Inst, getImm()); + } + void addPKHLSLImmOperands(MCInst &Inst, unsigned N) const { assert(N == 1 && "Invalid number of operands!"); addExpr(Inst, getImm()); |