diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-10-20 06:22:33 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-10-20 06:22:33 +0000 |
| commit | 9351e4f4b2afabe192b37a2f0d9f905a00c41a88 (patch) | |
| tree | 8768f74cacf19274019f61798c14027f5159edfb /llvm/lib | |
| parent | 60d513165374ce9a8e633d907773b13a7e4ec4a9 (diff) | |
| download | bcm5719-llvm-9351e4f4b2afabe192b37a2f0d9f905a00c41a88.tar.gz bcm5719-llvm-9351e4f4b2afabe192b37a2f0d9f905a00c41a88.zip | |
implement some more easy hooks.
llvm-svn: 84614
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp | 30 | ||||
| -rw-r--r-- | llvm/lib/Target/ARM/AsmPrinter/ARMInstPrinter.h | 7 |
2 files changed, 34 insertions, 3 deletions
diff --git a/llvm/lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp b/llvm/lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp index e38d0f54ed7..bde15a94a91 100644 --- a/llvm/lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp +++ b/llvm/lib/Target/ARM/AsmPrinter/ARMInstPrinter.cpp @@ -284,6 +284,36 @@ void ARMInstPrinter::printAddrMode5Operand(const MCInst *MI, unsigned OpNum, O << "]"; } +void ARMInstPrinter::printAddrMode6Operand(const MCInst *MI, unsigned OpNum) { + const MCOperand &MO1 = MI->getOperand(OpNum); + const MCOperand &MO2 = MI->getOperand(OpNum+1); + const MCOperand &MO3 = MI->getOperand(OpNum+2); + + // FIXME: No support yet for specifying alignment. + O << '[' << getRegisterName(MO1.getReg()) << ']'; + + if (ARM_AM::getAM6WBFlag(MO3.getImm())) { + if (MO2.getReg() == 0) + O << '!'; + else + O << ", " << getRegisterName(MO2.getReg()); + } +} + +void ARMInstPrinter::printAddrModePCOperand(const MCInst *MI, unsigned OpNum, + const char *Modifier) { + assert(0 && "FIXME: Implement printAddrModePCOperand"); +} + +void ARMInstPrinter::printBitfieldInvMaskImmOperand (const MCInst *MI, + unsigned OpNum) { + const MCOperand &MO = MI->getOperand(OpNum); + uint32_t v = ~MO.getImm(); + int32_t lsb = CountTrailingZeros_32(v); + int32_t width = (32 - CountLeadingZeros_32 (v)) - lsb; + assert(MO.isImm() && "Not a valid bf_inv_mask_imm value!"); + O << '#' << lsb << ", #" << width; +} void ARMInstPrinter::printRegisterList(const MCInst *MI, unsigned OpNum) { O << "{"; diff --git a/llvm/lib/Target/ARM/AsmPrinter/ARMInstPrinter.h b/llvm/lib/Target/ARM/AsmPrinter/ARMInstPrinter.h index 83690bd0031..3981a961dff 100644 --- a/llvm/lib/Target/ARM/AsmPrinter/ARMInstPrinter.h +++ b/llvm/lib/Target/ARM/AsmPrinter/ARMInstPrinter.h @@ -47,10 +47,11 @@ public: const char *Modifier = 0); void printAddrMode5Operand(const MCInst *MI, unsigned OpNum, const char *Modifier = 0); - void printAddrMode6Operand(const MCInst *MI, unsigned OpNum) {} + void printAddrMode6Operand(const MCInst *MI, unsigned OpNum); void printAddrModePCOperand(const MCInst *MI, unsigned OpNum, - const char *Modifier = 0) {} - void printBitfieldInvMaskImmOperand (const MCInst *MI, unsigned OpNum) {} + const char *Modifier = 0); + + void printBitfieldInvMaskImmOperand (const MCInst *MI, unsigned OpNum); void printThumbITMask(const MCInst *MI, unsigned OpNum) {} void printThumbAddrModeRROperand(const MCInst *MI, unsigned OpNum) {} |

