//'preserved' GRs:
[
+ r5 // the 'frame pointer' (base pointer) reg
+
// We never generate references to these regs, so we don't need to declare
// that they are saved. In fact, we could just remove them entirely.
- //r4, r5, r6, r7,
+ //r4, r6, r7,
//'special' GRs:
// r12, // memory stack pointer (SP)- XXX NOT callee saved, we do it ourselves
// rp, // return branch register (rp/b0) - we do this ourselves
// **** r13 (thread pointer) we do not touch, ever. it's not here. ****//
- //r15, // our frame pointer (FP)
+ //r15,
//'stacked' GRs the RSE takes care of, we don't worry about
/* We don't want PEI::calculateCallerSavedRegisters to worry about them,
int FrameIndex = MI.getOperand(i).getFrameIndex();
// choose a base register: ( hasFP? framepointer : stack pointer )
- unsigned BaseRegister = FP ? IA64::r15 : IA64::r12;
+ unsigned BaseRegister = FP ? IA64::r5 : IA64::r12;
// Add the base register
MI.SetMachineOperandReg(i, BaseRegister);
// now if we need to, save the old FP and set the new
if (FP) {
- MI = BuildMI(IA64::ST8, 2).addReg(IA64::r12).addReg(IA64::r15);
+ MI = BuildMI(IA64::ST8, 2).addReg(IA64::r12).addReg(IA64::r5);
MBB.insert(MBBI, MI);
// this must be the last instr in the prolog ? (XXX: why??)
- MI = BuildMI(IA64::MOV, 1, IA64::r15).addReg(IA64::r12);
+ MI = BuildMI(IA64::MOV, 1, IA64::r5).addReg(IA64::r12);
MBB.insert(MBBI, MI);
}
if (FP)
{
//copy the FP into the SP (discards allocas)
- MI=BuildMI(IA64::MOV, 1, IA64::r12).addReg(IA64::r15);
+ MI=BuildMI(IA64::MOV, 1, IA64::r12).addReg(IA64::r5);
MBB.insert(MBBI, MI);
//restore the FP
- MI=BuildMI(IA64::LD8, 1, IA64::r15).addReg(IA64::r15);
+ MI=BuildMI(IA64::LD8, 1, IA64::r5).addReg(IA64::r5);
MBB.insert(MBBI, MI);
}
//
// these are the scratch (+stacked) general registers
-// FIXME/XXX we also reserve a frame pointer (r15)
+// FIXME/XXX we also reserve a frame pointer (r5)
// FIXME/XXX we also reserve r2 for spilling/filling predicates
// in IA64RegisterInfo.cpp
// FIXME/XXX we also reserve r22 for calculating addresses
// registers to be the first ones allocated
out7, out6, out5, out4, out3, out2, out1, out0,
- r3, r8, r9, r10, r11, r14,
+ r3, r8, r9, r10, r11, r14, r15,
r16, r17, r18, r19, r20, r21, r23,
r24, r25, r26, r27, r28, r29, r30, r31,
r32, r33, r34, r35, r36, r37, r38, r39,
r104, r105, r106, r107, r108, r109, r110, r111,
r112, r113, r114, r115, r116, r117, r118, r119,
r120, r121, r122, r123, r124, r125, r126, r127,
- r0, r1, r2, r12, r13, r15, r22, rp]> // the last 16 are special (look down)
+ r0, r1, r2, r5, r12, r13, r22, rp]> // the last 16 are special (look down)
{
let MethodProtos = [{
iterator allocation_order_begin(MachineFunction &MF) const;
GRClass::iterator
GRClass::allocation_order_end(MachineFunction &MF) const {
- int numReservedRegs=8; // the 8 special registers r0,r1,r2,r12,r13 etc
+ int numReservedRegs=8; // the 8 special registers r0,r1,r2,r5,r12,r13 etc
// we also can't allocate registers for use as locals if they're
// already required as 'out' registers