Implement eliminateCallFramePseudoInstr().
authorBrian Gaeke <gaeke@uiuc.edu>
Sun, 10 Oct 2004 19:57:21 +0000 (19:57 +0000)
committerBrian Gaeke <gaeke@uiuc.edu>
Sun, 10 Oct 2004 19:57:21 +0000 (19:57 +0000)
Wrap a long comment line.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16883 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Sparc/SparcRegisterInfo.cpp
lib/Target/SparcV8/SparcV8RegisterInfo.cpp

index 9b3c68b8fe7e298fe1c64372517f169b101b58c4..f09b1aff960cfa3182e16dfbab4dc450a65b3766 100644 (file)
@@ -77,10 +77,12 @@ void SparcV8RegisterInfo::copyRegToReg(MachineBasicBlock &MBB,
 void SparcV8RegisterInfo::
 eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,
                               MachineBasicBlock::iterator I) const {
-  std::cerr
-    << "Sorry, I don't know how to eliminate call frame pseudo instrs yet, in\n"
-    << __FUNCTION__ << " at " << __FILE__ << ":" << __LINE__ << "\n";
-  abort();
+  MachineInstr &MI = *I;
+  int size = MI.getOperand (0).getImmedValue ();
+  if (MI.getOpcode () == V8::ADJCALLSTACKDOWN)
+    size = -size;
+  BuildMI (MBB, I, V8::ADDri, 2, V8::SP).addReg (V8::SP).addSImm (size);
+  MBB.erase (I);
 }
 
 void
@@ -115,8 +117,8 @@ void SparcV8RegisterInfo::emitPrologue(MachineFunction &MF) const {
   // Get the number of bytes to allocate from the FrameInfo
   int NumBytes = (int) MFI->getStackSize();
 
-  // Emit the correct save instruction based on the number of bytes in the frame.
-  // Minimum stack frame size according to V8 ABI is:
+  // Emit the correct save instruction based on the number of bytes in
+  // the frame. Minimum stack frame size according to V8 ABI is:
   //   16 words for register window spill
   //    1 word for address of returned aggregate-value
   // +  6 words for passing parameters on the stack
index 9b3c68b8fe7e298fe1c64372517f169b101b58c4..f09b1aff960cfa3182e16dfbab4dc450a65b3766 100644 (file)
@@ -77,10 +77,12 @@ void SparcV8RegisterInfo::copyRegToReg(MachineBasicBlock &MBB,
 void SparcV8RegisterInfo::
 eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,
                               MachineBasicBlock::iterator I) const {
-  std::cerr
-    << "Sorry, I don't know how to eliminate call frame pseudo instrs yet, in\n"
-    << __FUNCTION__ << " at " << __FILE__ << ":" << __LINE__ << "\n";
-  abort();
+  MachineInstr &MI = *I;
+  int size = MI.getOperand (0).getImmedValue ();
+  if (MI.getOpcode () == V8::ADJCALLSTACKDOWN)
+    size = -size;
+  BuildMI (MBB, I, V8::ADDri, 2, V8::SP).addReg (V8::SP).addSImm (size);
+  MBB.erase (I);
 }
 
 void
@@ -115,8 +117,8 @@ void SparcV8RegisterInfo::emitPrologue(MachineFunction &MF) const {
   // Get the number of bytes to allocate from the FrameInfo
   int NumBytes = (int) MFI->getStackSize();
 
-  // Emit the correct save instruction based on the number of bytes in the frame.
-  // Minimum stack frame size according to V8 ABI is:
+  // Emit the correct save instruction based on the number of bytes in
+  // the frame. Minimum stack frame size according to V8 ABI is:
   //   16 words for register window spill
   //    1 word for address of returned aggregate-value
   // +  6 words for passing parameters on the stack