[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp PPCInstr64Bit.td
Chris Lattner
sabre at nondot.org
Thu Nov 16 13:45:45 PST 2006
Changes in directory llvm/lib/Target/PowerPC:
PPCAsmPrinter.cpp updated: 1.207 -> 1.208
PPCInstr64Bit.td updated: 1.30 -> 1.31
---
Log message:
fix a regression that I introduced. stdu should scale the offset by 4
before printing it.
---
Diffs of the changes: (+11 -2)
PPCAsmPrinter.cpp | 11 ++++++++++-
PPCInstr64Bit.td | 2 +-
2 files changed, 11 insertions(+), 2 deletions(-)
Index: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
diff -u llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.207 llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.208
--- llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:1.207 Fri Nov 3 23:27:39 2006
+++ llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp Thu Nov 16 15:45:30 2006
@@ -127,7 +127,16 @@
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
Index: llvm/lib/Target/PowerPC/PPCInstr64Bit.td
diff -u llvm/lib/Target/PowerPC/PPCInstr64Bit.td:1.30 llvm/lib/Target/PowerPC/PPCInstr64Bit.td:1.31
--- llvm/lib/Target/PowerPC/PPCInstr64Bit.td:1.30 Wed Nov 15 18:57:19 2006
+++ llvm/lib/Target/PowerPC/PPCInstr64Bit.td Thu Nov 16 15:45:30 2006
@@ -413,7 +413,7 @@
def STDU : DSForm_1<62, 1, (ops ptr_rc:$ea_res, G8RC:$rS,
- symbolLo:$ptroff, ptr_rc:$ptrreg),
+ s16immX4:$ptroff, ptr_rc:$ptrreg),
"stdu $rS, $ptroff($ptrreg)", LdStSTD,
[(set ptr_rc:$ea_res, (pre_store G8RC:$rS, ptr_rc:$ptrreg,
iaddroff:$ptroff))]>,
More information about the llvm-commits
mailing list