From: Misha Brukman Date: Wed, 21 Jul 2004 19:36:57 +0000 (+0000) Subject: Use addSImm() instead of addImm() for stack offsets, which may be negative. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=e0380e0c4298d6d4c62846dbef4026991cf9336d;p=oota-llvm.git 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 --- diff --git a/lib/Target/PowerPC/PowerPCRegisterInfo.cpp b/lib/Target/PowerPC/PowerPCRegisterInfo.cpp index b52e83905ac..d1fdf1f4ace 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); }