Eliminate MachineFunction& argument from eliminateFrameIndex in x86 Target. Get...
[oota-llvm.git] / lib / Target / SparcV9 / SparcV9RegisterInfo.h
1 //===- SparcV9RegisterInfo.h - SparcV9 Register Information Impl -*- C++ -*-==//
2 // 
3 //                     The LLVM Compiler Infrastructure
4 //
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.
7 // 
8 //===----------------------------------------------------------------------===//
9 //
10 // This file contains the SparcV9 implementation of the MRegisterInfo class.
11 // It also contains stuff needed to instantiate that class, which would
12 // ordinarily be provided by TableGen.
13 //
14 //===----------------------------------------------------------------------===//
15
16 #ifndef SPARCV9REGISTERINFO_H
17 #define SPARCV9REGISTERINFO_H
18
19 #include "llvm/Target/MRegisterInfo.h"
20
21 namespace llvm {
22
23 struct SparcV9RegisterInfo : public MRegisterInfo {
24   SparcV9RegisterInfo ();
25   const unsigned *getCalleeSaveRegs() const;
26
27   // The rest of these are stubs... for now.
28   int storeRegToStackSlot (MachineBasicBlock &MBB,
29                            MachineBasicBlock::iterator MI,
30                            unsigned SrcReg, int FrameIndex,
31                            const TargetRegisterClass *RC) const;
32   int loadRegFromStackSlot (MachineBasicBlock &MBB,
33                             MachineBasicBlock::iterator MI,
34                             unsigned DestReg, int FrameIndex,
35                             const TargetRegisterClass *RC) const;
36   int copyRegToReg (MachineBasicBlock &MBB,
37                     MachineBasicBlock::iterator MI,
38                     unsigned DestReg, unsigned SrcReg,
39                     const TargetRegisterClass *RC) const;
40   void eliminateFrameIndex (MachineBasicBlock::iterator MI) const;
41   void emitPrologue (MachineFunction &MF) const;
42   void emitEpilogue (MachineFunction &MF, MachineBasicBlock &MBB) const;
43 };
44
45 } // End llvm namespace
46
47 //===----------------------------------------------------------------------===//
48 //
49 // The second section of this file (immediately following) contains
50 // a *handwritten* SparcV9 unified register number enumeration, which
51 // provides a flat namespace containing all the SparcV9 unified
52 // register numbers.
53 //
54 // It would ordinarily be contained in the file SparcV9GenRegisterNames.inc
55 // if we were using TableGen to generate the register file description
56 // automatically.
57 //
58 //===----------------------------------------------------------------------===//
59
60 namespace llvm {
61   namespace SparcV9 {
62     enum {
63     // FIXME - Register 0 is not a "non-register" like it is on other targets!!
64
65     // SparcV9IntRegClass(IntRegClassID)
66     // - unified register numbers 0 ... 31 (32 regs)
67     /* 0  */ o0, o1, o2, o3, o4,
68     /* 5  */ o5, o7, l0, l1, l2,
69     /* 10 */ l3, l4, l5, l6, l7,
70     /* 15 */ i0, i1, i2, i3, i4,
71     /* 20 */ i5, i6, i7, g0, g1, // i6 is frame ptr, i7 is ret addr, g0 is zero 
72     /* 25 */ g2, g3, g4, g5, g6,
73     /* 30 */ g7, o6,             // o6 is stack ptr
74
75     // SparcV9FloatRegClass(FloatRegClassID)
76     // - regs 32 .. 63 are FPSingleRegType, 64 .. 95 are FPDoubleRegType
77     // - unified register numbers 32 ... 95 (64 regs)
78     /* 32 */ f0,  f1,  f2,
79     /* 35 */ f3,  f4,  f5,  f6,  f7,
80     /* 40 */ f8,  f9,  f10, f11, f12,
81     /* 45 */ f13, f14, f15, f16, f17,
82     /* 50 */ f18, f19, f20, f21, f22,
83     /* 55 */ f23, f24, f25, f26, f27,
84     /* 60 */ f28, f29, f30, f31, f32,
85     /* 65 */ f33, f34, f35, f36, f37,
86     /* 70 */ f38, f39, f40, f41, f42,
87     /* 75 */ f43, f44, f45, f46, f47,
88     /* 80 */ f48, f49, f50, f51, f52,
89     /* 85 */ f53, f54, f55, f56, f57,
90     /* 90 */ f58, f59, f60, f61, f62,
91     /* 95 */ f63,
92
93     // SparcV9IntCCRegClass(IntCCRegClassID) 
94     // - unified register numbers 96 ... 98 (3 regs)
95     /* 96 */ xcc, icc, ccr,
96
97     // SparcV9FloatCCRegClass(FloatCCRegClassID)
98     // - unified register numbers 99 ... 102 (4 regs)
99     /* 99 */ fcc0, fcc1, fcc2, fcc3,
100
101     // SparcV9SpecialRegClass(SpecialRegClassID)
102     // - unified register number 103  (1 reg)
103     /* 103 */ fsr
104     };
105   } // end namespace SparcV9
106 } // end namespace llvm
107
108 #endif // SPARCV9REGISTERINFO_H