Register sizes are in bits, not bytes
authorNate Begeman <natebegeman@mac.com>
Fri, 27 Aug 2004 04:28:10 +0000 (04:28 +0000)
committerNate Begeman <natebegeman@mac.com>
Fri, 27 Aug 2004 04:28:10 +0000 (04:28 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16070 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/PrologEpilogInserter.cpp
lib/Target/PowerPC/PPC64RegisterInfo.cpp
lib/Target/PowerPC/PPCRegisterInfo.cpp

index c71755612ec065213be823604b61762b7a925edc..1aee69f9cca74cf46b5bfbd3c88ee394cd629545 100644 (file)
@@ -181,11 +181,11 @@ void PEI::calculateCallerSavedRegisters(MachineFunction &Fn) {
     int FrameIdx;
     if (FixedSlot == FixedSpillSlots+NumFixedSpillSlots) {
       // Nope, just spill it anywhere convenient.
-      FrameIdx = FFI->CreateStackObject(RegInfo->getSpillSize(Reg),
+      FrameIdx = FFI->CreateStackObject(RegInfo->getSpillSize(Reg)/8,
                                         RegInfo->getSpillAlignment(Reg)/8);
     } else {
       // Spill it to the stack where we must.
-      FrameIdx = FFI->CreateFixedObject(RegInfo->getSpillSize(Reg),
+      FrameIdx = FFI->CreateFixedObject(RegInfo->getSpillSize(Reg)/8,
                                         FixedSlot->second);
     }
     StackSlots.push_back(FrameIdx);
index 304f28c1bddc3402b3b6fa7889d2b98dde1c846e..774e661e62f753b70e495bbf748ba6f70a125e72 100644 (file)
@@ -240,7 +240,7 @@ void PPC64RegisterInfo::emitPrologue(MachineFunction &MF) const {
   // Add the size of R1 to  NumBytes size for the store of R1 to the bottom 
   // of the stack and round the size to a multiple of the alignment.
   unsigned Align = MF.getTarget().getFrameInfo()->getStackAlignment();
-  unsigned GPRSize = getSpillSize(PPC::R1);
+  unsigned GPRSize = getSpillSize(PPC::R1)/8;
   unsigned Size = hasFP(MF) ? GPRSize + GPRSize : GPRSize;
   NumBytes = (NumBytes+Size+Align-1)/Align*Align;
 
index b3a9da069ff28bfc04601081c4b33dba7f2ddde9..bebb86884187f6cde80af1bfd136ed040e6a4e34 100644 (file)
@@ -238,7 +238,7 @@ void PPC32RegisterInfo::emitPrologue(MachineFunction &MF) const {
   // Add the size of R1 to  NumBytes size for the store of R1 to the bottom 
   // of the stack and round the size to a multiple of the alignment.
   unsigned Align = MF.getTarget().getFrameInfo()->getStackAlignment();
-  unsigned GPRSize = getSpillSize(PPC::R1);
+  unsigned GPRSize = getSpillSize(PPC::R1)/8;
   unsigned Size = hasFP(MF) ? GPRSize + GPRSize : GPRSize;
   NumBytes = (NumBytes+Size+Align-1)/Align*Align;
 
@@ -278,7 +278,7 @@ void PPC32RegisterInfo::emitEpilogue(MachineFunction &MF,
   
   // Get the number of bytes allocated from the FrameInfo...
   unsigned NumBytes = MFI->getStackSize();
-  unsigned GPRSize = getSpillSize(PPC::R31);
+  unsigned GPRSize = getSpillSize(PPC::R31)/8;
 
   if (NumBytes != 0) {
     if (hasFP(MF)) {