1 //===-- Nios2RegisterInfo.cpp - Nios2 Register Information -== ------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file contains the Nios2 implementation of the TargetRegisterInfo class.
12 //===----------------------------------------------------------------------===//
14 #define DEBUG_TYPE "nios2-reg-info"
16 #include "Nios2RegisterInfo.h"
19 #include "Nios2Subtarget.h"
21 #define GET_REGINFO_TARGET_DESC
22 #include "Nios2GenRegisterInfo.inc"
26 Nios2RegisterInfo::Nios2RegisterInfo(const Nios2Subtarget &ST)
27 : Nios2GenRegisterInfo(Nios2::RA), Subtarget(ST) {}
29 const TargetRegisterClass *Nios2RegisterInfo::intRegClass(unsigned Size) const {
30 return &Nios2::CPURegsRegClass;
34 Nios2RegisterInfo::getCalleeSavedRegs(const MachineFunction *MF) const {
38 BitVector Nios2RegisterInfo::getReservedRegs(const MachineFunction &MF) const {
39 static const MCPhysReg ReservedCPURegs[] = {Nios2::ZERO, Nios2::AT, Nios2::SP,
40 Nios2::RA, Nios2::PC, Nios2::GP};
41 BitVector Reserved(getNumRegs());
43 for (unsigned I = 0; I < array_lengthof(ReservedCPURegs); ++I)
44 Reserved.set(ReservedCPURegs[I]);
49 void Nios2RegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II,
50 int SPAdj, unsigned FIOperandNum,
51 RegScavenger *RS) const {}
53 unsigned Nios2RegisterInfo::getFrameRegister(const MachineFunction &MF) const {