Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(456)

Side by Side Diff: src/IceRegistersARM32.h

Issue 1535233002: Refactor PUSH/POP in ARM assemblers. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix remaining issues. Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/IceInstARM32.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 (void)RegNum; 150 (void)RegNum;
151 assert(RegNum >= 0); 151 assert(RegNum >= 0);
152 assert(RegNum < Reg_NUM); 152 assert(RegNum < Reg_NUM);
153 } 153 }
154 154
155 static inline bool isGPRegister(int32_t RegNum) { 155 static inline bool isGPRegister(int32_t RegNum) {
156 assertRegisterDefined(RegNum); 156 assertRegisterDefined(RegNum);
157 return Table[RegNum].IsGPR; 157 return Table[RegNum].IsGPR;
158 } 158 }
159 159
160 static constexpr inline SizeT getNumGPRegs() { 160 static constexpr SizeT getNumGPRegs() {
161 return 0 161 return 0
162 #define X(val, encode, name, cc_arg, scratch, preserved, stackptr, frameptr, \ 162 #define X(val, encode, name, cc_arg, scratch, preserved, stackptr, frameptr, \
163 isGPR, isInt, isI64Pair, isFP32, isFP64, isVec128, alias_init) \ 163 isGPR, isInt, isI64Pair, isFP32, isFP64, isVec128, alias_init) \
164 +(isGPR) 164 +(isGPR)
165 REGARM32_TABLE 165 REGARM32_TABLE
166 #undef X 166 #undef X
167 ; 167 ;
168 } 168 }
169 169
170 static inline GPRRegister getEncodedGPReg(int32_t RegNum) { 170 static inline GPRRegister getEncodedGPR(int32_t RegNum) {
171 assert(isGPRegister(RegNum)); 171 assert(isGPRegister(RegNum));
172 return GPRRegister(Table[RegNum].Encoding); 172 return GPRRegister(Table[RegNum].Encoding);
173 } 173 }
174 174
175 static constexpr SizeT getNumGPRs() {
176 return 0
177 #define X(val, encode, name, cc_arg, scratch, preserved, stackptr, frameptr, \
178 isGPR, isInt, isI64Pair, isFP32, isFP64, isVec128, alias_init) \
179 +(isGPR)
180 REGARM32_TABLE
181 #undef X
182 ;
183 }
184
185 static inline bool isGPR(SizeT RegNum) {
186 assertRegisterDefined(RegNum);
187 return Table[RegNum].IsGPR;
188 }
189
190 static inline IceString getGPRName(SizeT RegNum) {
191 assert(isGPR(RegNum));
192 return Table[RegNum].Name;
193 }
194
175 static inline GPRRegister getI64PairFirstGPRNum(int32_t RegNum) { 195 static inline GPRRegister getI64PairFirstGPRNum(int32_t RegNum) {
176 assert(isI64RegisterPair(RegNum)); 196 assert(isI64RegisterPair(RegNum));
177 return GPRRegister(Table[RegNum].Encoding); 197 return GPRRegister(Table[RegNum].Encoding);
178 } 198 }
179 199
180 static inline GPRRegister getI64PairSecondGPRNum(int32_t RegNum) { 200 static inline GPRRegister getI64PairSecondGPRNum(int32_t RegNum) {
181 assert(isI64RegisterPair(RegNum)); 201 assert(isI64RegisterPair(RegNum));
182 return GPRRegister(Table[RegNum].Encoding + 1); 202 return GPRRegister(Table[RegNum].Encoding + 1);
183 } 203 }
184 204
185 static inline bool isI64RegisterPair(int32_t RegNum) { 205 static inline bool isI64RegisterPair(int32_t RegNum) {
186 assertRegisterDefined(RegNum); 206 assertRegisterDefined(RegNum);
187 return Table[RegNum].IsI64Pair; 207 return Table[RegNum].IsI64Pair;
188 } 208 }
189 209
190 static inline bool isEncodedSReg(int32_t RegNum) { 210 static inline bool isEncodedSReg(int32_t RegNum) {
191 assertRegisterDefined(RegNum); 211 assertRegisterDefined(RegNum);
192 return Table[RegNum].IsFP32; 212 return Table[RegNum].IsFP32;
193 } 213 }
194 214
195 static constexpr inline SizeT getNumSRegs() { 215 static constexpr SizeT getNumSRegs() {
196 return 0 216 return 0
197 #define X(val, encode, name, cc_arg, scratch, preserved, stackptr, frameptr, \ 217 #define X(val, encode, name, cc_arg, scratch, preserved, stackptr, frameptr, \
198 isGPR, isInt, isI64Pair, isFP32, isFP64, isVec128, alias_init) \ 218 isGPR, isInt, isI64Pair, isFP32, isFP64, isVec128, alias_init) \
199 +(isFP32) 219 +(isFP32)
200 REGARM32_TABLE 220 REGARM32_TABLE
201 #undef X 221 #undef X
202 ; 222 ;
203 } 223 }
204 224
225 static inline IceString getSRegName(SizeT RegNum) {
226 assert(isEncodedSReg(RegNum));
227 return Table[RegNum].Name;
228 }
229
205 static inline SRegister getEncodedSReg(int32_t RegNum) { 230 static inline SRegister getEncodedSReg(int32_t RegNum) {
206 assert(isEncodedSReg(RegNum)); 231 assert(isEncodedSReg(RegNum));
207 return SRegister(Table[RegNum].Encoding); 232 return SRegister(Table[RegNum].Encoding);
208 } 233 }
209 234
210 static inline bool isEncodedDReg(int32_t RegNum) { 235 static inline bool isEncodedDReg(int32_t RegNum) {
211 assertRegisterDefined(RegNum); 236 assertRegisterDefined(RegNum);
212 return Table[RegNum].IsFP64; 237 return Table[RegNum].IsFP64;
213 } 238 }
214 239
(...skipping 28 matching lines...) Expand all
243 } 268 }
244 }; 269 };
245 270
246 // Extend enum RegClass with ARM32-specific register classes (if any). 271 // Extend enum RegClass with ARM32-specific register classes (if any).
247 enum RegClassARM32 : uint8_t { RCARM32_NUM = RC_Target }; 272 enum RegClassARM32 : uint8_t { RCARM32_NUM = RC_Target };
248 273
249 } // end of namespace ARM32 274 } // end of namespace ARM32
250 } // end of namespace Ice 275 } // end of namespace Ice
251 276
252 #endif // SUBZERO_SRC_ICEREGISTERSARM32_H 277 #endif // SUBZERO_SRC_ICEREGISTERSARM32_H
OLDNEW
« no previous file with comments | « src/IceInstARM32.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698