1 //===- SparcV8RegisterInfo.cpp - SparcV8 Register Information ---*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file was developed by the LLVM research group and is distributed under
6 // the University of Illinois Open Source License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file contains the SparcV8 implementation of the MRegisterInfo class.
12 //===----------------------------------------------------------------------===//
15 #include "SparcV8RegisterInfo.h"
16 #include "llvm/Type.h"
19 SparcV8RegisterInfo::SparcV8RegisterInfo()
20 : SparcV8GenRegisterInfo(V8::ADJCALLSTACKDOWN,
21 V8::ADJCALLSTACKUP) {}
23 int SparcV8RegisterInfo::storeRegToStackSlot(
24 MachineBasicBlock &MBB,
25 MachineBasicBlock::iterator MBBI,
26 unsigned SrcReg, int FrameIdx,
27 const TargetRegisterClass *RC) const
33 int SparcV8RegisterInfo::loadRegFromStackSlot(
34 MachineBasicBlock &MBB,
35 MachineBasicBlock::iterator MBBI,
36 unsigned DestReg, int FrameIdx,
37 const TargetRegisterClass *RC) const
43 int SparcV8RegisterInfo::copyRegToReg(MachineBasicBlock &MBB,
44 MachineBasicBlock::iterator MBBI,
45 unsigned DestReg, unsigned SrcReg,
46 const TargetRegisterClass *RC) const {
51 void SparcV8RegisterInfo::
52 eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,
53 MachineBasicBlock::iterator I) const {
58 SparcV8RegisterInfo::eliminateFrameIndex(MachineFunction &MF,
59 MachineBasicBlock::iterator II) const {
63 void SparcV8RegisterInfo::processFunctionBeforeFrameFinalized(
64 MachineFunction &MF) const {
68 void SparcV8RegisterInfo::emitPrologue(MachineFunction &MF) const {
72 void SparcV8RegisterInfo::emitEpilogue(MachineFunction &MF,
73 MachineBasicBlock &MBB) const {
78 #include "SparcV8GenRegisterInfo.inc"
80 const TargetRegisterClass*
81 SparcV8RegisterInfo::getRegClassForType(const Type* Ty) const {
82 switch (Ty->getPrimitiveID()) {
84 case Type::DoubleTyID:
85 assert(0 && "Floating point registers not supported yet!");
87 case Type::ULongTyID: assert(0 && "Long values can't fit in registers!");
88 default: assert(0 && "Invalid type to getClass!");
93 case Type::UShortTyID:
96 case Type::PointerTyID: return &IntRegsInstance;