Make comment lines stick out less.
[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 (MachineFunction &MF,
41                             MachineBasicBlock::iterator MI) const;
42   void emitPrologue (MachineFunction &MF) const;
43   void emitEpilogue (MachineFunction &MF, MachineBasicBlock &MBB) const;
44 };
45
46 } // End llvm namespace
47
48 //===----------------------------------------------------------------------===//
49 //
50 // The second section of this file (immediately following) contains
51 // a *handwritten* SparcV9 unified register number enumeration, which
52 // provides a flat namespace containing all the SparcV9 unified
53 // register numbers.
54 //
55 // It would ordinarily be contained in the file SparcV9GenRegisterNames.inc
56 // if we were using TableGen to generate the register file description
57 // automatically.
58 //
59 //===----------------------------------------------------------------------===//
60
61 namespace llvm {
62   namespace SparcV9 {
63     enum {
64     // FIXME - Register 0 is not a "non-register" like it is on other targets!!
65
66     // SparcV9IntRegClass(IntRegClassID)
67     // - unified register numbers 0 ... 31 (32 regs)
68     /* 0  */ o0, o1, o2, o3, o4,
69     /* 5  */ o5, o7, l0, l1, l2,
70     /* 10 */ l3, l4, l5, l6, l7,
71     /* 15 */ i0, i1, i2, i3, i4,
72     /* 20 */ i5, i6, i7, g0, g1, // i6 is frame ptr, i7 is ret addr, g0 is zero 
73     /* 25 */ g2, g3, g4, g5, g6,
74     /* 30 */ g7, o6,             // o6 is stack ptr
75
76     // SparcV9FloatRegClass(FloatRegClassID)
77     // - regs 32 .. 63 are FPSingleRegType, 64 .. 95 are FPDoubleRegType
78     // - unified register numbers 32 ... 95 (64 regs)
79     /* 32 */ f0,  f1,  f2,
80     /* 35 */ f3,  f4,  f5,  f6,  f7,
81     /* 40 */ f8,  f9,  f10, f11, f12,
82     /* 45 */ f13, f14, f15, f16, f17,
83     /* 50 */ f18, f19, f20, f21, f22,
84     /* 55 */ f23, f24, f25, f26, f27,
85     /* 60 */ f28, f29, f30, f31, f32,
86     /* 65 */ f33, f34, f35, f36, f37,
87     /* 70 */ f38, f39, f40, f41, f42,
88     /* 75 */ f43, f44, f45, f46, f47,
89     /* 80 */ f48, f49, f50, f51, f52,
90     /* 85 */ f53, f54, f55, f56, f57,
91     /* 90 */ f58, f59, f60, f61, f62,
92     /* 95 */ f63,
93
94     // SparcV9IntCCRegClass(IntCCRegClassID) 
95     // - unified register numbers 96 ... 98 (3 regs)
96     /* 96 */ xcc, icc, ccr,
97
98     // SparcV9FloatCCRegClass(FloatCCRegClassID)
99     // - unified register numbers 99 ... 102 (4 regs)
100     /* 99 */ fcc0, fcc1, fcc2, fcc3,
101
102     // SparcV9SpecialRegClass(SpecialRegClassID)
103     // - unified register number 103  (1 reg)
104     /* 103 */ fsr
105     };
106   } // end namespace SparcV9
107 } // end namespace llvm
108
109 #endif // SPARCV9REGISTERINFO_H