llvm.org GIT mirror llvm / d69b3c5
Make prolog align stack properly. Make epilog not touch any registers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12183 91177308-0d34-0410-b5e6-96231b3b80d8 Brian Gaeke 15 years ago
2 changed file(s) with 8 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
7070
7171 // Eventually this should emit the correct save instruction based on the
7272 // number of bytes in the frame. For now we just hardcode it.
73 BuildMI(MBB, MBB.begin(), V8::SAVEi, 2, V8::SP).addImm(-122).addReg(V8::SP);
73 BuildMI(MBB, MBB.begin(), V8::SAVEri, 2, V8::SP).addImm(-112).addReg(V8::SP);
7474 }
7575
7676 void SparcV8RegisterInfo::emitEpilogue(MachineFunction &MF,
7777 MachineBasicBlock &MBB) const {
7878 MachineBasicBlock::iterator MBBI = prior(MBB.end());
79 assert(MBBI->getOpcode() == V8::JMPLi &&
80 "Can only put epilog before return instruction!");
81 BuildMI(MBB, MBBI, V8::RESTOREi, 2, V8::O0).addImm(0).addReg(V8::L7);
79 assert(MBBI->getOpcode() == V8::RETL &&
80 "Can only put epilog before 'retl' instruction!");
81 BuildMI(MBB, MBBI, V8::RESTORErr, 2, V8::G0).addReg(V8::G0).addReg(V8::G0);
8282 }
8383
8484
7070
7171 // Eventually this should emit the correct save instruction based on the
7272 // number of bytes in the frame. For now we just hardcode it.
73 BuildMI(MBB, MBB.begin(), V8::SAVEi, 2, V8::SP).addImm(-122).addReg(V8::SP);
73 BuildMI(MBB, MBB.begin(), V8::SAVEri, 2, V8::SP).addImm(-112).addReg(V8::SP);
7474 }
7575
7676 void SparcV8RegisterInfo::emitEpilogue(MachineFunction &MF,
7777 MachineBasicBlock &MBB) const {
7878 MachineBasicBlock::iterator MBBI = prior(MBB.end());
79 assert(MBBI->getOpcode() == V8::JMPLi &&
80 "Can only put epilog before return instruction!");
81 BuildMI(MBB, MBBI, V8::RESTOREi, 2, V8::O0).addImm(0).addReg(V8::L7);
79 assert(MBBI->getOpcode() == V8::RETL &&
80 "Can only put epilog before 'retl' instruction!");
81 BuildMI(MBB, MBBI, V8::RESTORErr, 2, V8::G0).addReg(V8::G0).addReg(V8::G0);
8282 }
8383
8484