diff options
author | Jim Grosbach <grosbach@apple.com> | 2011-08-19 18:49:59 +0000 |
---|---|---|
committer | Jim Grosbach <grosbach@apple.com> | 2011-08-19 18:49:59 +0000 |
commit | 48ff5ffe9e2a90f853ce3645b1b97ea7885eccf1 (patch) | |
tree | 79cabd12b5ffbe98611c39e6044a69a775bed350 /lib/Target/ARM/AsmParser/ARMAsmParser.cpp | |
parent | 09f6e0dfda121251c5da7dba04b8b72d5572b0df (diff) |
Thumb assembly parsing and encoding for LDRB.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138059 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/AsmParser/ARMAsmParser.cpp')
-rw-r--r-- | lib/Target/ARM/AsmParser/ARMAsmParser.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp index b6fce294f2..d04b9b73cc 100644 --- a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp +++ b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp @@ -628,6 +628,15 @@ public: int64_t Val = Mem.OffsetImm->getValue(); return Val >= 0 && Val <= 124 && (Val % 4) == 0; } + bool isMemThumbRIs1() const { + if (Kind != Memory || Mem.OffsetRegNum != 0 || + !isARMLowRegister(Mem.BaseRegNum)) + return false; + // Immediate offset in range [0, 31]. + if (!Mem.OffsetImm) return true; + int64_t Val = Mem.OffsetImm->getValue(); + return Val >= 0 && Val <= 31; + } bool isMemThumbSPI() const { if (Kind != Memory || Mem.OffsetRegNum != 0 || Mem.BaseRegNum != ARM::SP) return false; @@ -1000,6 +1009,13 @@ public: Inst.addOperand(MCOperand::CreateImm(Val)); } + void addMemThumbRIs1Operands(MCInst &Inst, unsigned N) const { + assert(N == 2 && "Invalid number of operands!"); + int64_t Val = Mem.OffsetImm ? (Mem.OffsetImm->getValue()) : 0; + Inst.addOperand(MCOperand::CreateReg(Mem.BaseRegNum)); + Inst.addOperand(MCOperand::CreateImm(Val)); + } + void addMemThumbSPIOperands(MCInst &Inst, unsigned N) const { assert(N == 2 && "Invalid number of operands!"); int64_t Val = Mem.OffsetImm ? (Mem.OffsetImm->getValue() / 4) : 0; |