2005-02-05 02:24:26 +00:00
|
|
|
//===- AlphaRegisterInfo.cpp - Alpha Register Information -------*- C++ -*-===//
|
2005-04-21 23:13:11 +00:00
|
|
|
//
|
2005-01-22 23:41:55 +00:00
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
2007-12-29 20:36:04 +00:00
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
2005-04-21 23:13:11 +00:00
|
|
|
//
|
2005-01-22 23:41:55 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
2008-02-10 18:45:23 +00:00
|
|
|
// This file contains the Alpha implementation of the TargetRegisterInfo class.
|
2005-01-22 23:41:55 +00:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#define DEBUG_TYPE "reginfo"
|
|
|
|
#include "Alpha.h"
|
|
|
|
#include "AlphaRegisterInfo.h"
|
|
|
|
#include "llvm/Constants.h"
|
|
|
|
#include "llvm/Type.h"
|
2005-04-13 17:17:28 +00:00
|
|
|
#include "llvm/Function.h"
|
2005-01-22 23:41:55 +00:00
|
|
|
#include "llvm/CodeGen/ValueTypes.h"
|
|
|
|
#include "llvm/CodeGen/MachineInstrBuilder.h"
|
|
|
|
#include "llvm/CodeGen/MachineFunction.h"
|
|
|
|
#include "llvm/CodeGen/MachineFrameInfo.h"
|
2006-03-23 18:12:57 +00:00
|
|
|
#include "llvm/CodeGen/MachineLocation.h"
|
2005-01-22 23:41:55 +00:00
|
|
|
#include "llvm/Target/TargetFrameInfo.h"
|
|
|
|
#include "llvm/Target/TargetMachine.h"
|
|
|
|
#include "llvm/Target/TargetOptions.h"
|
2006-11-27 23:37:22 +00:00
|
|
|
#include "llvm/Target/TargetInstrInfo.h"
|
2005-01-22 23:41:55 +00:00
|
|
|
#include "llvm/Support/CommandLine.h"
|
|
|
|
#include "llvm/Support/Debug.h"
|
2007-02-19 21:49:54 +00:00
|
|
|
#include "llvm/ADT/BitVector.h"
|
2005-01-22 23:41:55 +00:00
|
|
|
#include "llvm/ADT/STLExtras.h"
|
|
|
|
#include <cstdlib>
|
|
|
|
using namespace llvm;
|
|
|
|
|
2005-03-04 21:40:02 +00:00
|
|
|
//These describe LDAx
|
2005-03-29 19:24:04 +00:00
|
|
|
static const int IMM_LOW = -32768;
|
|
|
|
static const int IMM_HIGH = 32767;
|
2005-03-05 15:30:33 +00:00
|
|
|
static const int IMM_MULT = 65536;
|
2005-02-22 21:59:48 +00:00
|
|
|
|
|
|
|
static long getUpper16(long l)
|
|
|
|
{
|
2005-03-04 21:40:02 +00:00
|
|
|
long y = l / IMM_MULT;
|
|
|
|
if (l % IMM_MULT > IMM_HIGH)
|
2005-02-22 21:59:48 +00:00
|
|
|
++y;
|
|
|
|
return y;
|
|
|
|
}
|
2005-01-22 23:41:55 +00:00
|
|
|
|
2005-03-04 21:40:02 +00:00
|
|
|
static long getLower16(long l)
|
|
|
|
{
|
|
|
|
long h = getUpper16(l);
|
|
|
|
return l - h * IMM_MULT;
|
|
|
|
}
|
|
|
|
|
2006-11-13 23:36:35 +00:00
|
|
|
AlphaRegisterInfo::AlphaRegisterInfo(const TargetInstrInfo &tii)
|
|
|
|
: AlphaGenRegisterInfo(Alpha::ADJUSTSTACKDOWN, Alpha::ADJUSTSTACKUP),
|
2009-06-26 00:17:05 +00:00
|
|
|
TII(tii), curgpdist(0)
|
2005-01-22 23:41:55 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2007-07-14 14:06:15 +00:00
|
|
|
const unsigned* AlphaRegisterInfo::getCalleeSavedRegs(const MachineFunction *MF)
|
|
|
|
const {
|
2007-01-02 21:33:40 +00:00
|
|
|
static const unsigned CalleeSavedRegs[] = {
|
2006-05-18 00:12:58 +00:00
|
|
|
Alpha::R9, Alpha::R10,
|
|
|
|
Alpha::R11, Alpha::R12,
|
|
|
|
Alpha::R13, Alpha::R14,
|
|
|
|
Alpha::F2, Alpha::F3,
|
|
|
|
Alpha::F4, Alpha::F5,
|
|
|
|
Alpha::F6, Alpha::F7,
|
|
|
|
Alpha::F8, Alpha::F9, 0
|
|
|
|
};
|
2007-01-02 21:33:40 +00:00
|
|
|
return CalleeSavedRegs;
|
2006-05-18 00:12:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
const TargetRegisterClass* const*
|
2007-07-14 14:06:15 +00:00
|
|
|
AlphaRegisterInfo::getCalleeSavedRegClasses(const MachineFunction *MF) const {
|
2007-01-02 21:33:40 +00:00
|
|
|
static const TargetRegisterClass * const CalleeSavedRegClasses[] = {
|
2006-05-18 00:12:58 +00:00
|
|
|
&Alpha::GPRCRegClass, &Alpha::GPRCRegClass,
|
|
|
|
&Alpha::GPRCRegClass, &Alpha::GPRCRegClass,
|
|
|
|
&Alpha::GPRCRegClass, &Alpha::GPRCRegClass,
|
|
|
|
&Alpha::F8RCRegClass, &Alpha::F8RCRegClass,
|
|
|
|
&Alpha::F8RCRegClass, &Alpha::F8RCRegClass,
|
|
|
|
&Alpha::F8RCRegClass, &Alpha::F8RCRegClass,
|
|
|
|
&Alpha::F8RCRegClass, &Alpha::F8RCRegClass, 0
|
|
|
|
};
|
2007-01-02 21:33:40 +00:00
|
|
|
return CalleeSavedRegClasses;
|
2006-05-18 00:12:58 +00:00
|
|
|
}
|
|
|
|
|
2007-02-19 21:49:54 +00:00
|
|
|
BitVector AlphaRegisterInfo::getReservedRegs(const MachineFunction &MF) const {
|
|
|
|
BitVector Reserved(getNumRegs());
|
|
|
|
Reserved.set(Alpha::R15);
|
|
|
|
Reserved.set(Alpha::R30);
|
|
|
|
Reserved.set(Alpha::R31);
|
|
|
|
return Reserved;
|
|
|
|
}
|
|
|
|
|
2005-01-22 23:41:55 +00:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
// Stack Frame Processing methods
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
// hasFP - Return true if the specified function should have a dedicated frame
|
|
|
|
// pointer register. This is true if the function has variable sized allocas or
|
|
|
|
// if frame pointer elimination is disabled.
|
|
|
|
//
|
2007-01-23 00:57:47 +00:00
|
|
|
bool AlphaRegisterInfo::hasFP(const MachineFunction &MF) const {
|
2008-07-07 23:14:23 +00:00
|
|
|
const MachineFrameInfo *MFI = MF.getFrameInfo();
|
2008-09-26 22:10:44 +00:00
|
|
|
return MFI->hasVarSizedObjects();
|
2005-01-22 23:41:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void AlphaRegisterInfo::
|
|
|
|
eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,
|
|
|
|
MachineBasicBlock::iterator I) const {
|
|
|
|
if (hasFP(MF)) {
|
|
|
|
// If we have a frame pointer, turn the adjcallstackup instruction into a
|
|
|
|
// 'sub ESP, <amt>' and the adjcallstackdown instruction into 'add ESP,
|
|
|
|
// <amt>'
|
|
|
|
MachineInstr *Old = I;
|
2007-12-30 20:49:49 +00:00
|
|
|
uint64_t Amount = Old->getOperand(0).getImm();
|
2005-01-22 23:41:55 +00:00
|
|
|
if (Amount != 0) {
|
|
|
|
// We need to keep the stack aligned properly. To do this, we round the
|
|
|
|
// amount of space needed for the outgoing arguments up to the next
|
|
|
|
// alignment boundary.
|
|
|
|
unsigned Align = MF.getTarget().getFrameInfo()->getStackAlignment();
|
|
|
|
Amount = (Amount+Align-1)/Align*Align;
|
|
|
|
|
2005-02-22 21:59:48 +00:00
|
|
|
MachineInstr *New;
|
|
|
|
if (Old->getOpcode() == Alpha::ADJUSTSTACKDOWN) {
|
2009-02-12 23:08:38 +00:00
|
|
|
New=BuildMI(MF, Old->getDebugLoc(), TII.get(Alpha::LDA), Alpha::R30)
|
2005-02-22 21:59:48 +00:00
|
|
|
.addImm(-Amount).addReg(Alpha::R30);
|
|
|
|
} else {
|
2005-04-22 17:54:37 +00:00
|
|
|
assert(Old->getOpcode() == Alpha::ADJUSTSTACKUP);
|
2009-02-12 23:08:38 +00:00
|
|
|
New=BuildMI(MF, Old->getDebugLoc(), TII.get(Alpha::LDA), Alpha::R30)
|
2005-02-22 21:59:48 +00:00
|
|
|
.addImm(Amount).addReg(Alpha::R30);
|
|
|
|
}
|
2005-04-21 23:13:11 +00:00
|
|
|
|
2005-01-22 23:41:55 +00:00
|
|
|
// Replace the pseudo instruction with a new instruction...
|
2005-02-22 21:59:48 +00:00
|
|
|
MBB.insert(I, New);
|
2005-01-22 23:41:55 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
MBB.erase(I);
|
|
|
|
}
|
|
|
|
|
2005-02-22 21:59:48 +00:00
|
|
|
//Alpha has a slightly funny stack:
|
2005-04-21 23:13:11 +00:00
|
|
|
//Args
|
2005-02-22 21:59:48 +00:00
|
|
|
//<- incoming SP
|
|
|
|
//fixed locals (and spills, callee saved, etc)
|
|
|
|
//<- FP
|
|
|
|
//variable locals
|
|
|
|
//<- SP
|
|
|
|
|
2007-02-28 00:21:17 +00:00
|
|
|
void AlphaRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II,
|
2007-05-01 09:13:03 +00:00
|
|
|
int SPAdj, RegScavenger *RS) const {
|
|
|
|
assert(SPAdj == 0 && "Unexpected");
|
|
|
|
|
2005-01-30 00:35:27 +00:00
|
|
|
unsigned i = 0;
|
|
|
|
MachineInstr &MI = *II;
|
|
|
|
MachineBasicBlock &MBB = *MI.getParent();
|
|
|
|
MachineFunction &MF = *MBB.getParent();
|
2005-02-22 21:59:48 +00:00
|
|
|
bool FP = hasFP(MF);
|
|
|
|
|
2008-10-03 15:45:36 +00:00
|
|
|
while (!MI.getOperand(i).isFI()) {
|
2005-01-30 00:35:27 +00:00
|
|
|
++i;
|
|
|
|
assert(i < MI.getNumOperands() && "Instr doesn't have FrameIndex operand!");
|
|
|
|
}
|
2005-01-22 23:41:55 +00:00
|
|
|
|
2007-12-30 23:10:15 +00:00
|
|
|
int FrameIndex = MI.getOperand(i).getIndex();
|
2005-01-22 23:41:55 +00:00
|
|
|
|
2005-01-30 00:35:27 +00:00
|
|
|
// Add the base register of R30 (SP) or R15 (FP).
|
2006-09-05 02:31:13 +00:00
|
|
|
MI.getOperand(i + 1).ChangeToRegister(FP ? Alpha::R15 : Alpha::R30, false);
|
2005-04-21 23:13:11 +00:00
|
|
|
|
2005-02-22 21:59:48 +00:00
|
|
|
// Now add the frame object offset to the offset from the virtual frame index.
|
2005-01-30 00:35:27 +00:00
|
|
|
int Offset = MF.getFrameInfo()->getObjectOffset(FrameIndex);
|
|
|
|
|
2006-12-07 22:21:48 +00:00
|
|
|
DOUT << "FI: " << FrameIndex << " Offset: " << Offset << "\n";
|
2005-02-22 21:59:48 +00:00
|
|
|
|
2005-01-30 00:35:27 +00:00
|
|
|
Offset += MF.getFrameInfo()->getStackSize();
|
2005-04-21 23:13:11 +00:00
|
|
|
|
2006-12-07 22:21:48 +00:00
|
|
|
DOUT << "Corrected Offset " << Offset
|
|
|
|
<< " for stack size: " << MF.getFrameInfo()->getStackSize() << "\n";
|
2005-01-30 00:35:27 +00:00
|
|
|
|
2005-03-04 21:40:02 +00:00
|
|
|
if (Offset > IMM_HIGH || Offset < IMM_LOW) {
|
2006-12-07 22:21:48 +00:00
|
|
|
DOUT << "Unconditionally using R28 for evil purposes Offset: "
|
|
|
|
<< Offset << "\n";
|
2006-09-05 02:31:13 +00:00
|
|
|
//so in this case, we need to use a temporary register, and move the
|
|
|
|
//original inst off the SP/FP
|
2005-02-22 21:59:48 +00:00
|
|
|
//fix up the old:
|
2006-09-05 02:31:13 +00:00
|
|
|
MI.getOperand(i + 1).ChangeToRegister(Alpha::R28, false);
|
2006-05-04 17:52:23 +00:00
|
|
|
MI.getOperand(i).ChangeToImmediate(getLower16(Offset));
|
2005-02-22 21:59:48 +00:00
|
|
|
//insert the new
|
2009-02-12 23:08:38 +00:00
|
|
|
MachineInstr* nMI=BuildMI(MF, MI.getDebugLoc(),
|
|
|
|
TII.get(Alpha::LDAH), Alpha::R28)
|
2005-02-22 21:59:48 +00:00
|
|
|
.addImm(getUpper16(Offset)).addReg(FP ? Alpha::R15 : Alpha::R30);
|
2005-03-13 00:43:20 +00:00
|
|
|
MBB.insert(II, nMI);
|
2005-02-22 21:59:48 +00:00
|
|
|
} else {
|
2006-05-04 17:52:23 +00:00
|
|
|
MI.getOperand(i).ChangeToImmediate(Offset);
|
2005-02-22 21:59:48 +00:00
|
|
|
}
|
2005-01-22 23:41:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void AlphaRegisterInfo::emitPrologue(MachineFunction &MF) const {
|
|
|
|
MachineBasicBlock &MBB = MF.front(); // Prolog goes in entry BB
|
|
|
|
MachineBasicBlock::iterator MBBI = MBB.begin();
|
|
|
|
MachineFrameInfo *MFI = MF.getFrameInfo();
|
2009-02-23 00:42:30 +00:00
|
|
|
DebugLoc dl = (MBBI != MBB.end() ?
|
|
|
|
MBBI->getDebugLoc() : DebugLoc::getUnknownLoc());
|
2005-02-22 21:59:48 +00:00
|
|
|
bool FP = hasFP(MF);
|
2005-04-21 23:13:11 +00:00
|
|
|
|
2005-01-22 23:41:55 +00:00
|
|
|
//handle GOP offset
|
2009-02-13 02:30:42 +00:00
|
|
|
BuildMI(MBB, MBBI, dl, TII.get(Alpha::LDAHg), Alpha::R29)
|
2005-07-22 20:52:16 +00:00
|
|
|
.addGlobalAddress(const_cast<Function*>(MF.getFunction()))
|
|
|
|
.addReg(Alpha::R27).addImm(++curgpdist);
|
2009-02-13 02:30:42 +00:00
|
|
|
BuildMI(MBB, MBBI, dl, TII.get(Alpha::LDAg), Alpha::R29)
|
2005-07-22 20:52:16 +00:00
|
|
|
.addGlobalAddress(const_cast<Function*>(MF.getFunction()))
|
|
|
|
.addReg(Alpha::R29).addImm(curgpdist);
|
|
|
|
|
2005-04-13 17:17:28 +00:00
|
|
|
//evil const_cast until MO stuff setup to handle const
|
2009-02-13 02:30:42 +00:00
|
|
|
BuildMI(MBB, MBBI, dl, TII.get(Alpha::ALTENT))
|
2006-05-04 01:15:02 +00:00
|
|
|
.addGlobalAddress(const_cast<Function*>(MF.getFunction()));
|
2005-04-21 23:13:11 +00:00
|
|
|
|
2005-01-22 23:41:55 +00:00
|
|
|
// Get the number of bytes to allocate from the FrameInfo
|
2005-03-04 21:40:02 +00:00
|
|
|
long NumBytes = MFI->getStackSize();
|
2005-01-22 23:41:55 +00:00
|
|
|
|
2005-02-22 21:59:48 +00:00
|
|
|
if (FP)
|
|
|
|
NumBytes += 8; //reserve space for the old FP
|
|
|
|
|
2005-01-22 23:41:55 +00:00
|
|
|
// Do we need to allocate space on the stack?
|
|
|
|
if (NumBytes == 0) return;
|
|
|
|
|
2006-01-25 01:51:08 +00:00
|
|
|
unsigned Align = MF.getTarget().getFrameInfo()->getStackAlignment();
|
|
|
|
NumBytes = (NumBytes+Align-1)/Align*Align;
|
|
|
|
|
2005-01-22 23:41:55 +00:00
|
|
|
// Update frame info to pretend that this is part of the stack...
|
|
|
|
MFI->setStackSize(NumBytes);
|
2005-02-22 21:59:48 +00:00
|
|
|
|
2005-01-22 23:41:55 +00:00
|
|
|
// adjust stack pointer: r30 -= numbytes
|
2005-03-04 21:40:02 +00:00
|
|
|
NumBytes = -NumBytes;
|
|
|
|
if (NumBytes >= IMM_LOW) {
|
2009-02-13 02:30:42 +00:00
|
|
|
BuildMI(MBB, MBBI, dl, TII.get(Alpha::LDA), Alpha::R30).addImm(NumBytes)
|
2005-07-07 19:52:58 +00:00
|
|
|
.addReg(Alpha::R30);
|
2005-03-04 21:40:02 +00:00
|
|
|
} else if (getUpper16(NumBytes) >= IMM_LOW) {
|
2009-02-13 02:30:42 +00:00
|
|
|
BuildMI(MBB, MBBI, dl, TII.get(Alpha::LDAH), Alpha::R30)
|
|
|
|
.addImm(getUpper16(NumBytes)).addReg(Alpha::R30);
|
|
|
|
BuildMI(MBB, MBBI, dl, TII.get(Alpha::LDA), Alpha::R30)
|
|
|
|
.addImm(getLower16(NumBytes)).addReg(Alpha::R30);
|
2005-01-26 21:54:09 +00:00
|
|
|
} else {
|
2006-12-07 22:21:48 +00:00
|
|
|
cerr << "Too big a stack frame at " << NumBytes << "\n";
|
2005-01-26 21:54:09 +00:00
|
|
|
abort();
|
|
|
|
}
|
2005-02-22 21:59:48 +00:00
|
|
|
|
|
|
|
//now if we need to, save the old FP and set the new
|
|
|
|
if (FP)
|
|
|
|
{
|
2009-02-13 02:30:42 +00:00
|
|
|
BuildMI(MBB, MBBI, dl, TII.get(Alpha::STQ))
|
2006-09-05 02:31:13 +00:00
|
|
|
.addReg(Alpha::R15).addImm(0).addReg(Alpha::R30);
|
2005-02-22 21:59:48 +00:00
|
|
|
//this must be the last instr in the prolog
|
2009-02-13 02:30:42 +00:00
|
|
|
BuildMI(MBB, MBBI, dl, TII.get(Alpha::BISr), Alpha::R15)
|
2006-09-05 02:31:13 +00:00
|
|
|
.addReg(Alpha::R30).addReg(Alpha::R30);
|
2005-02-22 21:59:48 +00:00
|
|
|
}
|
|
|
|
|
2005-01-22 23:41:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void AlphaRegisterInfo::emitEpilogue(MachineFunction &MF,
|
|
|
|
MachineBasicBlock &MBB) const {
|
|
|
|
const MachineFrameInfo *MFI = MF.getFrameInfo();
|
|
|
|
MachineBasicBlock::iterator MBBI = prior(MBB.end());
|
2008-02-20 11:22:39 +00:00
|
|
|
assert((MBBI->getOpcode() == Alpha::RETDAG ||
|
|
|
|
MBBI->getOpcode() == Alpha::RETDAGp)
|
2005-04-22 17:54:37 +00:00
|
|
|
&& "Can only insert epilog into returning blocks");
|
2009-02-23 00:42:30 +00:00
|
|
|
DebugLoc dl = MBBI->getDebugLoc();
|
2005-04-21 23:13:11 +00:00
|
|
|
|
2005-02-22 21:59:48 +00:00
|
|
|
bool FP = hasFP(MF);
|
2005-04-21 23:13:11 +00:00
|
|
|
|
2005-01-22 23:41:55 +00:00
|
|
|
// Get the number of bytes allocated from the FrameInfo...
|
2005-03-05 15:30:33 +00:00
|
|
|
long NumBytes = MFI->getStackSize();
|
2005-01-22 23:41:55 +00:00
|
|
|
|
2005-02-22 21:59:48 +00:00
|
|
|
//now if we need to, restore the old FP
|
2008-02-20 11:24:05 +00:00
|
|
|
if (FP) {
|
2005-02-24 18:36:32 +00:00
|
|
|
//copy the FP into the SP (discards allocas)
|
2009-02-13 02:30:42 +00:00
|
|
|
BuildMI(MBB, MBBI, dl, TII.get(Alpha::BISr), Alpha::R30).addReg(Alpha::R15)
|
2005-07-07 19:52:58 +00:00
|
|
|
.addReg(Alpha::R15);
|
2005-02-24 18:36:32 +00:00
|
|
|
//restore the FP
|
2009-02-13 02:30:42 +00:00
|
|
|
BuildMI(MBB, MBBI, dl, TII.get(Alpha::LDQ), Alpha::R15)
|
|
|
|
.addImm(0).addReg(Alpha::R15);
|
2005-02-22 21:59:48 +00:00
|
|
|
}
|
|
|
|
|
2008-02-20 11:24:05 +00:00
|
|
|
if (NumBytes != 0) {
|
|
|
|
if (NumBytes <= IMM_HIGH) {
|
2009-02-13 02:30:42 +00:00
|
|
|
BuildMI(MBB, MBBI, dl, TII.get(Alpha::LDA), Alpha::R30).addImm(NumBytes)
|
2008-02-20 11:24:05 +00:00
|
|
|
.addReg(Alpha::R30);
|
|
|
|
} else if (getUpper16(NumBytes) <= IMM_HIGH) {
|
2009-02-13 02:30:42 +00:00
|
|
|
BuildMI(MBB, MBBI, dl, TII.get(Alpha::LDAH), Alpha::R30)
|
2008-02-20 11:24:05 +00:00
|
|
|
.addImm(getUpper16(NumBytes)).addReg(Alpha::R30);
|
2009-02-13 02:30:42 +00:00
|
|
|
BuildMI(MBB, MBBI, dl, TII.get(Alpha::LDA), Alpha::R30)
|
2008-02-20 11:24:05 +00:00
|
|
|
.addImm(getLower16(NumBytes)).addReg(Alpha::R30);
|
|
|
|
} else {
|
|
|
|
cerr << "Too big a stack frame at " << NumBytes << "\n";
|
|
|
|
abort();
|
|
|
|
}
|
|
|
|
}
|
2005-01-22 23:41:55 +00:00
|
|
|
}
|
|
|
|
|
2006-04-07 16:34:46 +00:00
|
|
|
unsigned AlphaRegisterInfo::getRARegister() const {
|
|
|
|
assert(0 && "What is the return address register");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2006-03-28 13:48:33 +00:00
|
|
|
unsigned AlphaRegisterInfo::getFrameRegister(MachineFunction &MF) const {
|
2006-04-07 16:34:46 +00:00
|
|
|
return hasFP(MF) ? Alpha::R15 : Alpha::R30;
|
2006-03-23 18:12:57 +00:00
|
|
|
}
|
|
|
|
|
2007-02-21 22:54:50 +00:00
|
|
|
unsigned AlphaRegisterInfo::getEHExceptionRegister() const {
|
|
|
|
assert(0 && "What is the exception register");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
unsigned AlphaRegisterInfo::getEHHandlerRegister() const {
|
|
|
|
assert(0 && "What is the exception handler register");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2007-11-13 19:13:01 +00:00
|
|
|
int AlphaRegisterInfo::getDwarfRegNum(unsigned RegNum, bool isEH) const {
|
2007-11-11 19:50:10 +00:00
|
|
|
assert(0 && "What is the dwarf register number");
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2005-01-22 23:41:55 +00:00
|
|
|
#include "AlphaGenRegisterInfo.inc"
|
|
|
|
|
|
|
|
std::string AlphaRegisterInfo::getPrettyName(unsigned reg)
|
|
|
|
{
|
2008-02-26 21:47:57 +00:00
|
|
|
std::string s(RegisterDescriptors[reg].Name);
|
2005-01-22 23:41:55 +00:00
|
|
|
return s;
|
|
|
|
}
|