zpu: wip eke out some simple instructions for load/store/add
[llvm/zpu.git] / lib / Target / PTX / PTXRegisterInfo.h
bloba658c9258f0ef9534f2483196d2fb8c3efda13d2
1 //===- PTXRegisterInfo.h - PTX Register Information Impl --------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file contains the PTX implementation of the MRegisterInfo class.
12 //===----------------------------------------------------------------------===//
14 #ifndef PTX_REGISTER_INFO_H
15 #define PTX_REGISTER_INFO_H
17 #include "llvm/Support/ErrorHandling.h"
18 #include "llvm/ADT/BitVector.h"
20 #include "PTXGenRegisterInfo.h.inc"
22 namespace llvm {
23 class PTXTargetMachine;
24 class MachineFunction;
26 struct PTXRegisterInfo : public PTXGenRegisterInfo {
27 PTXRegisterInfo(PTXTargetMachine &TM,
28 const TargetInstrInfo &TII) {}
30 virtual const unsigned
31 *getCalleeSavedRegs(const MachineFunction *MF = 0) const {
32 static const unsigned CalleeSavedRegs[] = { 0 };
33 return CalleeSavedRegs; // save nothing
36 virtual BitVector getReservedRegs(const MachineFunction &MF) const {
37 BitVector Reserved(getNumRegs());
38 return Reserved; // reserve no regs
41 virtual bool hasFP(const MachineFunction &MF) const { return false; }
43 virtual void eliminateFrameIndex(MachineBasicBlock::iterator MI,
44 int SPAdj,
45 RegScavenger *RS = NULL) const {
46 llvm_unreachable("PTX does not support general function call");
49 virtual void emitPrologue(MachineFunction &MF) const {}
50 virtual void emitEpilogue(MachineFunction &MF,
51 MachineBasicBlock &MBB) const {}
53 virtual unsigned getFrameRegister(const MachineFunction &MF) const {
54 llvm_unreachable("PTX does not have a frame register");
55 return 0;
58 virtual unsigned getRARegister() const {
59 llvm_unreachable("PTX does not have a return address register");
60 return 0;
63 virtual int getDwarfRegNum(unsigned RegNum, bool isEH) const {
64 return PTXGenRegisterInfo::getDwarfRegNumFull(RegNum, 0);
66 }; // struct PTXRegisterInfo
67 } // namespace llvm
69 #endif // PTX_REGISTER_INFO_H