aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/PowerPC
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-11-16 21:45:30 +0000
committerChris Lattner <sabre@nondot.org>2006-11-16 21:45:30 +0000
commit1b0a2d8370b28de0d3998b0303bc3dad983989d9 (patch)
tree5481df47ee568c9e206f20d53fde36f628fef174 /lib/Target/PowerPC
parent73b00947e7db9987f3e779a3b89d4823742691d2 (diff)
downloadexternal_llvm-1b0a2d8370b28de0d3998b0303bc3dad983989d9.zip
external_llvm-1b0a2d8370b28de0d3998b0303bc3dad983989d9.tar.gz
external_llvm-1b0a2d8370b28de0d3998b0303bc3dad983989d9.tar.bz2
fix a regression that I introduced. stdu should scale the offset by 4
before printing it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31791 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PowerPC')
-rw-r--r--lib/Target/PowerPC/PPCAsmPrinter.cpp11
-rw-r--r--lib/Target/PowerPC/PPCInstr64Bit.td2
2 files changed, 11 insertions, 2 deletions
diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp
index 47056de..41f4121 100644
--- a/lib/Target/PowerPC/PPCAsmPrinter.cpp
+++ b/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
diff --git a/lib/Target/PowerPC/PPCInstr64Bit.td b/lib/Target/PowerPC/PPCInstr64Bit.td
index 1a1b8ac..7d895d8 100644
--- a/lib/Target/PowerPC/PPCInstr64Bit.td
+++ b/lib/Target/PowerPC/PPCInstr64Bit.td
@@ -413,7 +413,7 @@ def STWU8 : DForm_1<37, (ops ptr_rc:$ea_res, G8RC:$rS,
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))]>,