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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
139 { \ | 139 { \ |
140 name, encode, cc_arg, scratch, preserved, stackptr, frameptr, isGPR, \ | 140 name, encode, cc_arg, scratch, preserved, stackptr, frameptr, isGPR, \ |
141 isInt, isI64Pair, isFP32, isFP64, isVec128, \ | 141 isInt, isI64Pair, isFP32, isFP64, isVec128, \ |
142 (SizeOf alias_init).size(), alias_init \ | 142 (SizeOf alias_init).size(), alias_init \ |
143 } \ | 143 } \ |
144 , | 144 , |
145 REGARM32_TABLE | 145 REGARM32_TABLE |
146 #undef X | 146 #undef X |
147 }; | 147 }; |
148 | 148 |
149 enum RegClass { | |
Jim Stichnoth
2016/01/13 16:24:54
FWIW, there is already Ice::RegClass defined in Ic
Karl
2016/01/14 18:27:19
Changed to use TypeToRegisterSet vectors for this
| |
150 RegClass_GP, | |
151 RegClass_GPPair, | |
152 RegClass_S, | |
153 RegClass_D, | |
154 RegClass_Q, | |
155 RegClass_Other, | |
156 // Defines the number of RegClass'es | |
157 Num_RegClasses | |
Jim Stichnoth
2016/01/13 16:24:54
Usually this dummy value is named something like R
Karl
2016/01/14 18:27:19
Done.
| |
158 }; | |
159 | |
149 static inline void assertRegisterDefined(int32_t RegNum) { | 160 static inline void assertRegisterDefined(int32_t RegNum) { |
150 (void)RegNum; | 161 (void)RegNum; |
151 assert(RegNum >= 0); | 162 assert(RegNum >= 0); |
152 assert(RegNum < Reg_NUM); | 163 assert(RegNum < Reg_NUM); |
153 } | 164 } |
154 | 165 |
166 static RegClass getRegClass(int32_t RegNum) { | |
Jim Stichnoth
2016/01/13 16:24:54
I'm not sure why some of these functions are "stat
Karl
2016/01/14 18:27:19
The inline's are removed. I left removing class Re
| |
167 assert(RegNum >= 0); | |
168 assert(RegNum < Reg_NUM); | |
169 if (Table[RegNum].IsGPR) | |
170 return RegClass_GP; | |
171 if (Table[RegNum].IsI64Pair) | |
172 return RegClass_GPPair; | |
173 if (Table[RegNum].IsFP32) | |
174 return RegClass_S; | |
175 if (Table[RegNum].IsFP64) | |
176 return RegClass_D; | |
177 if (Table[RegNum].IsVec128) | |
178 return RegClass_Q; | |
179 return RegClass_Other; | |
180 } | |
181 | |
155 static inline bool isGPRegister(int32_t RegNum) { | 182 static inline bool isGPRegister(int32_t RegNum) { |
156 assertRegisterDefined(RegNum); | 183 assertRegisterDefined(RegNum); |
157 return Table[RegNum].IsGPR; | 184 return Table[RegNum].IsGPR; |
158 } | 185 } |
159 | 186 |
160 static constexpr SizeT getNumGPRegs() { | 187 static constexpr SizeT getNumGPRegs() { |
161 return 0 | 188 return 0 |
162 #define X(val, encode, name, cc_arg, scratch, preserved, stackptr, frameptr, \ | 189 #define X(val, encode, name, cc_arg, scratch, preserved, stackptr, frameptr, \ |
163 isGPR, isInt, isI64Pair, isFP32, isFP64, isVec128, alias_init) \ | 190 isGPR, isInt, isI64Pair, isFP32, isFP64, isVec128, alias_init) \ |
164 +(isGPR) | 191 +(isGPR) |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
268 } | 295 } |
269 }; | 296 }; |
270 | 297 |
271 // Extend enum RegClass with ARM32-specific register classes (if any). | 298 // Extend enum RegClass with ARM32-specific register classes (if any). |
272 enum RegClassARM32 : uint8_t { RCARM32_NUM = RC_Target }; | 299 enum RegClassARM32 : uint8_t { RCARM32_NUM = RC_Target }; |
273 | 300 |
274 } // end of namespace ARM32 | 301 } // end of namespace ARM32 |
275 } // end of namespace Ice | 302 } // end of namespace Ice |
276 | 303 |
277 #endif // SUBZERO_SRC_ICEREGISTERSARM32_H | 304 #endif // SUBZERO_SRC_ICEREGISTERSARM32_H |
OLD | NEW |