aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMisha Brukman <brukman+llvm@gmail.com>2004-07-21 19:36:57 +0000
committerMisha Brukman <brukman+llvm@gmail.com>2004-07-21 19:36:57 +0000
commite0380e0c4298d6d4c62846dbef4026991cf9336d (patch)
tree5fb4cc1d9851d70961fb175b9a50a21e9c96d6a5
parent1721784a1bf2978ccbd187c1dedd89aa10b8f23f (diff)
Use addSImm() instead of addImm() for stack offsets, which may be negative.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15081 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Target/PowerPC/PowerPCRegisterInfo.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Target/PowerPC/PowerPCRegisterInfo.cpp b/lib/Target/PowerPC/PowerPCRegisterInfo.cpp
index b52e83905a..d1fdf1f4ac 100644
--- a/lib/Target/PowerPC/PowerPCRegisterInfo.cpp
+++ b/lib/Target/PowerPC/PowerPCRegisterInfo.cpp
@@ -210,7 +210,7 @@ void PowerPCRegisterInfo::emitPrologue(MachineFunction &MF) const {
// Store the incoming LR so it is preserved across calls
MI = BuildMI(PPC32::MFLR, 0, PPC32::R0);
MBB.insert(MBBI, MI);
- MI = BuildMI(PPC32::STW, 3).addReg(PPC32::R0).addImm(8).addReg(PPC32::R1);
+ MI = BuildMI(PPC32::STW, 3).addReg(PPC32::R0).addSImm(8).addReg(PPC32::R1);
MBB.insert(MBBI, MI);
}
@@ -219,7 +219,7 @@ void PowerPCRegisterInfo::emitPrologue(MachineFunction &MF) const {
// adjust stack pointer: r1 -= numbytes
if (NumBytes) {
- MI = BuildMI(PPC32::STWU, 2, PPC32::R1).addImm(-NumBytes).addReg(PPC32::R1);
+ MI = BuildMI(PPC32::STWU, 2, PPC32::R1).addSImm(-NumBytes).addReg(PPC32::R1);
MBB.insert(MBBI, MI);
}
}
@@ -247,7 +247,7 @@ void PowerPCRegisterInfo::emitEpilogue(MachineFunction &MF,
MBB.insert(MBBI, MI);
}
// Adjust stack pointer back
- MI = BuildMI(PPC32::ADDI, 2, PPC32::R1).addReg(PPC32::R1).addImm(NumBytes);
+ MI = BuildMI(PPC32::ADDI, 2, PPC32::R1).addReg(PPC32::R1).addSImm(NumBytes);
MBB.insert(MBBI, MI);
}