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

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: Refactor and fix trivial bug (insertion of newline for vpush). 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
« src/IceInstARM32.cpp ('K') | « 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 REGARM32_TABLE 145 REGARM32_TABLE
146 #undef X 146 #undef X
147 }; 147 };
148 148
149 static inline GPRRegister getEncodedGPR(int32_t RegNum) { 149 static inline GPRRegister getEncodedGPR(int32_t RegNum) {
150 assert(Reg_GPR_First <= RegNum); 150 assert(Reg_GPR_First <= RegNum);
151 assert(RegNum <= Reg_GPR_Last); 151 assert(RegNum <= Reg_GPR_Last);
152 return GPRRegister(Table[RegNum].Encoding); 152 return GPRRegister(Table[RegNum].Encoding);
153 } 153 }
154 154
155 static inline SizeT getNumGPRegs() {
156 return Reg_GPR_Last + 1 - Reg_GPR_First;
157 }
158
159 static inline IceString getGPRegName(SizeT RegNum) {
John 2016/01/06 16:10:21 All throughout this file GPRs are named GPRs, not
Karl 2016/01/06 23:21:58 Done.
160 assert(RegNum <= getNumGPRegs());
161 return getRegName(Reg_GPR_First + RegNum);
162 }
163
155 static inline GPRRegister getI64PairFirstGPRNum(int32_t RegNum) { 164 static inline GPRRegister getI64PairFirstGPRNum(int32_t RegNum) {
156 assert(Reg_I64PAIR_First <= RegNum); 165 assert(Reg_I64PAIR_First <= RegNum);
157 assert(RegNum <= Reg_I64PAIR_Last); 166 assert(RegNum <= Reg_I64PAIR_Last);
158 return GPRRegister(Table[RegNum].Encoding); 167 return GPRRegister(Table[RegNum].Encoding);
159 } 168 }
160 169
161 static inline GPRRegister getI64PairSecondGPRNum(int32_t RegNum) { 170 static inline GPRRegister getI64PairSecondGPRNum(int32_t RegNum) {
162 assert(Reg_I64PAIR_First <= RegNum); 171 assert(Reg_I64PAIR_First <= RegNum);
163 assert(RegNum <= Reg_I64PAIR_Last); 172 assert(RegNum <= Reg_I64PAIR_Last);
164 return GPRRegister(Table[RegNum].Encoding + 1); 173 return GPRRegister(Table[RegNum].Encoding + 1);
165 } 174 }
166 175
167 static inline bool isI64RegisterPair(int32_t RegNum) { 176 static inline bool isI64RegisterPair(int32_t RegNum) {
168 return Table[RegNum].IsI64Pair; 177 return Table[RegNum].IsI64Pair;
169 } 178 }
170 179
171 static inline bool isEncodedSReg(int32_t RegNum) { 180 static inline bool isEncodedSReg(int32_t RegNum) {
172 return Table[RegNum].IsFP32; 181 return Table[RegNum].IsFP32;
173 } 182 }
174 183
175 static inline SizeT getNumSRegs() { 184 static inline SizeT getNumSRegs() {
176 return Reg_SREG_Last + 1 - Reg_SREG_First; 185 return Reg_SREG_Last + 1 - Reg_SREG_First;
177 } 186 }
178 187
188 static inline IceString getSRegName(SizeT RegNum) {
189 assert(RegNum <= getNumSRegs());
190 return getRegName(Reg_SREG_First + RegNum);
191 }
192
179 static inline SRegister getEncodedSReg(int32_t RegNum) { 193 static inline SRegister getEncodedSReg(int32_t RegNum) {
180 assert(Reg_SREG_First <= RegNum); 194 assert(Reg_SREG_First <= RegNum);
181 assert(RegNum <= Reg_SREG_Last); 195 assert(RegNum <= Reg_SREG_Last);
182 return SRegister(Table[RegNum].Encoding); 196 return SRegister(Table[RegNum].Encoding);
183 } 197 }
184 198
185 static inline DRegister getEncodedDReg(int32_t RegNum) { 199 static inline DRegister getEncodedDReg(int32_t RegNum) {
186 assert(Reg_DREG_First <= RegNum); 200 assert(Reg_DREG_First <= RegNum);
187 assert(RegNum <= Reg_DREG_Last); 201 assert(RegNum <= Reg_DREG_Last);
188 return DRegister(Table[RegNum].Encoding); 202 return DRegister(Table[RegNum].Encoding);
(...skipping 11 matching lines...) Expand all
200 } 214 }
201 }; 215 };
202 216
203 // Extend enum RegClass with ARM32-specific register classes (if any). 217 // Extend enum RegClass with ARM32-specific register classes (if any).
204 enum RegClassARM32 : uint8_t { RCARM32_NUM = RC_Target }; 218 enum RegClassARM32 : uint8_t { RCARM32_NUM = RC_Target };
205 219
206 } // end of namespace ARM32 220 } // end of namespace ARM32
207 } // end of namespace Ice 221 } // end of namespace Ice
208 222
209 #endif // SUBZERO_SRC_ICEREGISTERSARM32_H 223 #endif // SUBZERO_SRC_ICEREGISTERSARM32_H
OLDNEW
« src/IceInstARM32.cpp ('K') | « src/IceInstARM32.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698