mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-22 04:22:57 +02:00
a1d10f171e
This patch includes all missing functionality needed to provide first compilation of a simple program that just returns from a function. I've added a test case that checks for "ret" instruction printed in assembly output. Patch by Andrei Grischenko (andrei.l.grischenko@intel.com) Differential revision: https://reviews.llvm.org/D39688 llvm-svn: 320035
56 lines
1.8 KiB
C++
56 lines
1.8 KiB
C++
//===-- Nios2RegisterInfo.cpp - Nios2 Register Information -== ------------===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This file contains the Nios2 implementation of the TargetRegisterInfo class.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#define DEBUG_TYPE "nios2-reg-info"
|
|
|
|
#include "Nios2RegisterInfo.h"
|
|
|
|
#include "Nios2.h"
|
|
#include "Nios2Subtarget.h"
|
|
|
|
#define GET_REGINFO_TARGET_DESC
|
|
#include "Nios2GenRegisterInfo.inc"
|
|
|
|
using namespace llvm;
|
|
|
|
Nios2RegisterInfo::Nios2RegisterInfo(const Nios2Subtarget &ST)
|
|
: Nios2GenRegisterInfo(Nios2::RA), Subtarget(ST) {}
|
|
|
|
const TargetRegisterClass *Nios2RegisterInfo::intRegClass(unsigned Size) const {
|
|
return &Nios2::CPURegsRegClass;
|
|
}
|
|
|
|
const MCPhysReg *
|
|
Nios2RegisterInfo::getCalleeSavedRegs(const MachineFunction *MF) const {
|
|
return CSR_SaveList;
|
|
}
|
|
|
|
BitVector Nios2RegisterInfo::getReservedRegs(const MachineFunction &MF) const {
|
|
static const MCPhysReg ReservedCPURegs[] = {Nios2::ZERO, Nios2::AT, Nios2::SP,
|
|
Nios2::RA, Nios2::PC, Nios2::GP};
|
|
BitVector Reserved(getNumRegs());
|
|
|
|
for (unsigned I = 0; I < array_lengthof(ReservedCPURegs); ++I)
|
|
Reserved.set(ReservedCPURegs[I]);
|
|
|
|
return Reserved;
|
|
}
|
|
|
|
void Nios2RegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II,
|
|
int SPAdj, unsigned FIOperandNum,
|
|
RegScavenger *RS) const {}
|
|
|
|
unsigned Nios2RegisterInfo::getFrameRegister(const MachineFunction &MF) const {
|
|
return Nios2::SP;
|
|
}
|