diff options
author | Chris Lattner <sabre@nondot.org> | 2006-11-16 21:45:30 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-11-16 21:45:30 +0000 |
commit | 30055b920804ca8c9d66388fdefd21a4c32d0afa (patch) | |
tree | b6349e27b1659bdc9c7cd63c78c7222f650bb8a4 /llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp | |
parent | c5e769710eee550ea2132f282c74f4a4fb1b9eeb (diff) | |
download | bcm5719-llvm-30055b920804ca8c9d66388fdefd21a4c32d0afa.tar.gz bcm5719-llvm-30055b920804ca8c9d66388fdefd21a4c32d0afa.zip |
fix a regression that I introduced. stdu should scale the offset by 4
before printing it.
llvm-svn: 31791
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp')
-rw-r--r-- | llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp index 47056de2ab7..41f4121f5bc 100644 --- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp +++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp @@ -127,7 +127,16 @@ namespace { O << (unsigned short)MI->getOperand(OpNo).getImmedValue(); } void printS16X4ImmOperand(const MachineInstr *MI, unsigned OpNo) { - O << (short)(MI->getOperand(OpNo).getImmedValue()*4); + if (MI->getOperand(OpNo).isImmediate()) { + O << (short)(MI->getOperand(OpNo).getImmedValue()*4); + } else { + O << "lo16("; + printOp(MI->getOperand(OpNo)); + if (TM.getRelocationModel() == Reloc::PIC_) + O << "-\"L" << getFunctionNumber() << "$pb\")"; + else + O << ')'; + } } void printBranchOperand(const MachineInstr *MI, unsigned OpNo) { // Branches can take an immediate operand. This is used by the branch |