summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ARM/InstPrinter
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2011-08-17 21:51:27 +0000
committerJim Grosbach <grosbach@apple.com>2011-08-17 21:51:27 +0000
commit46dd413991f6fa74a1da3f139b386e364dfc9f78 (patch)
treedc7abad80f76c521c9d369879c445fabcd7e1746 /llvm/lib/Target/ARM/InstPrinter
parentd5553f1c34727a4bfabf34ace2c9fad0a7079350 (diff)
downloadbcm5719-llvm-46dd413991f6fa74a1da3f139b386e364dfc9f78.tar.gz
bcm5719-llvm-46dd413991f6fa74a1da3f139b386e364dfc9f78.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. llvm-svn: 137879
Diffstat (limited to 'llvm/lib/Target/ARM/InstPrinter')
-rw-r--r--llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp8
-rw-r--r--llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.h1
2 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp b/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp
index 67d39a38684..30fa76ad701 100644
--- a/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp
+++ b/llvm/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,
diff --git a/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.h b/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.h
index 8b94ec5f05d..e68a6290fe5 100644
--- a/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.h
+++ b/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.h
@@ -74,6 +74,7 @@ public:
void printPKHASRShiftImm(const MCInst *MI, unsigned OpNum, raw_ostream &O);
void printThumbS4ImmOperand(const MCInst *MI, unsigned OpNum, raw_ostream &O);
+ void printThumbSRImm(const MCInst *MI, unsigned OpNum, raw_ostream &O);
void printThumbITMask(const MCInst *MI, unsigned OpNum, raw_ostream &O);
void printThumbAddrModeRROperand(const MCInst *MI, unsigned OpNum,
raw_ostream &O);
OpenPOWER on IntegriCloud