diff options
author | Jim Grosbach <grosbach@apple.com> | 2011-08-17 21:51:27 +0000 |
---|---|---|
committer | Jim Grosbach <grosbach@apple.com> | 2011-08-17 21:51:27 +0000 |
commit | 70939ee1415722d7f39f13faf9b3644b96007996 (patch) | |
tree | 2c6a128afc34d663ef08f93901253692885d8fb1 /lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp | |
parent | 795cf5efba4255cadd0bfde0e9d3dec65e96dd50 (diff) | |
download | external_llvm-70939ee1415722d7f39f13faf9b3644b96007996.tar.gz external_llvm-70939ee1415722d7f39f13faf9b3644b96007996.tar.bz2 external_llvm-70939ee1415722d7f39f13faf9b3644b96007996.zip |
ARM clean up the imm_sr operand class representation.
Represent the operand value as it will be encoded in the instruction. This
allows removing the specialized encoder and decoder methods entirely. Add
an assembler match class while we're at it to lay groundwork for parsing the
thumb shift instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137879 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp')
-rw-r--r-- | lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp b/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp index 67d39a3868..30fa76ad70 100644 --- a/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp +++ b/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp @@ -639,7 +639,13 @@ void ARMInstPrinter::printPCLabel(const MCInst *MI, unsigned OpNum, void ARMInstPrinter::printThumbS4ImmOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O) { - O << "#" << MI->getOperand(OpNum).getImm() * 4; + O << "#" << MI->getOperand(OpNum).getImm() * 4; +} + +void ARMInstPrinter::printThumbSRImm(const MCInst *MI, unsigned OpNum, + raw_ostream &O) { + unsigned Imm = MI->getOperand(OpNum).getImm(); + O << "#" << (Imm == 0 ? 32 : Imm); } void ARMInstPrinter::printThumbITMask(const MCInst *MI, unsigned OpNum, |