OLD | NEW |
1 //===- subzero/src/IceRegistersARM32.h - Register information ---*- C++ -*-===// | 1 //===- subzero/src/IceRegistersARM32.h - Register information ---*- C++ -*-===// |
2 // | 2 // |
3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 /// | 9 /// |
10 /// \file | 10 /// \file |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 static inline GPRRegister getI64PairSecondGPRNum(int32_t RegNum) { | 97 static inline GPRRegister getI64PairSecondGPRNum(int32_t RegNum) { |
98 assert(Reg_I64PAIR_First <= RegNum); | 98 assert(Reg_I64PAIR_First <= RegNum); |
99 assert(RegNum <= Reg_I64PAIR_Last); | 99 assert(RegNum <= Reg_I64PAIR_Last); |
100 return GPRRegister(2 * (RegNum - Reg_I64PAIR_First + Reg_GPR_First) + 1); | 100 return GPRRegister(2 * (RegNum - Reg_I64PAIR_First + Reg_GPR_First) + 1); |
101 } | 101 } |
102 | 102 |
103 static inline bool isI64RegisterPair(int32_t RegNum) { | 103 static inline bool isI64RegisterPair(int32_t RegNum) { |
104 return Reg_I64PAIR_First <= RegNum && RegNum <= Reg_I64PAIR_Last; | 104 return Reg_I64PAIR_First <= RegNum && RegNum <= Reg_I64PAIR_Last; |
105 } | 105 } |
106 | 106 |
| 107 static inline bool isEncodedSReg(int32_t RegNum) { |
| 108 return Reg_SREG_First <= RegNum && RegNum <= Reg_SREG_Last; |
| 109 } |
| 110 |
| 111 static inline SizeT getNumSRegs() { |
| 112 return Reg_SREG_Last + 1 - Reg_SREG_First; |
| 113 } |
| 114 |
107 static inline SRegister getEncodedSReg(int32_t RegNum) { | 115 static inline SRegister getEncodedSReg(int32_t RegNum) { |
108 assert(Reg_SREG_First <= RegNum); | 116 assert(Reg_SREG_First <= RegNum); |
109 assert(RegNum <= Reg_SREG_Last); | 117 assert(RegNum <= Reg_SREG_Last); |
110 return SRegister(RegNum - Reg_SREG_First); | 118 return SRegister(RegNum - Reg_SREG_First); |
111 } | 119 } |
112 | 120 |
113 static inline DRegister getEncodedDReg(int32_t RegNum) { | 121 static inline DRegister getEncodedDReg(int32_t RegNum) { |
114 assert(Reg_DREG_First <= RegNum); | 122 assert(Reg_DREG_First <= RegNum); |
115 assert(RegNum <= Reg_DREG_Last); | 123 assert(RegNum <= Reg_DREG_Last); |
116 return DRegister(RegNum - Reg_DREG_First); | 124 return DRegister(RegNum - Reg_DREG_First); |
117 } | 125 } |
118 | 126 |
119 static inline QRegister getEncodedQReg(int32_t RegNum) { | 127 static inline QRegister getEncodedQReg(int32_t RegNum) { |
120 assert(Reg_QREG_First <= RegNum); | 128 assert(Reg_QREG_First <= RegNum); |
121 assert(RegNum <= Reg_QREG_Last); | 129 assert(RegNum <= Reg_QREG_Last); |
122 return QRegister(RegNum - Reg_QREG_First); | 130 return QRegister(RegNum - Reg_QREG_First); |
123 } | 131 } |
124 | 132 |
125 static const char *RegNames[]; | 133 static const char *RegNames[]; |
126 }; | 134 }; |
127 | 135 |
128 // Extend enum RegClass with ARM32-specific register classes (if any). | 136 // Extend enum RegClass with ARM32-specific register classes (if any). |
129 enum RegClassARM32 : uint8_t { RCARM32_NUM = RC_Target }; | 137 enum RegClassARM32 : uint8_t { RCARM32_NUM = RC_Target }; |
130 | 138 |
131 } // end of namespace Ice | 139 } // end of namespace Ice |
132 | 140 |
133 #endif // SUBZERO_SRC_ICEREGISTERSARM32_H | 141 #endif // SUBZERO_SRC_ICEREGISTERSARM32_H |
OLD | NEW |