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

Unified 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: Do some more cleanups. 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 side-by-side diff with in-line comments
Download patch
« src/IceInstARM32.cpp ('K') | « src/IceInstARM32.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceRegistersARM32.h
diff --git a/src/IceRegistersARM32.h b/src/IceRegistersARM32.h
index 0caa9ccdf4e225ccfd0e40bcd6838c36bbb4011b..2434a4d29d3acdd64335e3518e808f76b4ca1bc7 100644
--- a/src/IceRegistersARM32.h
+++ b/src/IceRegistersARM32.h
@@ -152,6 +152,21 @@ public:
return GPRRegister(Table[RegNum].Encoding);
}
+ static inline SizeT getNumGPRs() {
John 2016/01/11 13:40:36 You don't need this method if you use Table[] -- s
Karl 2016/01/11 17:59:44 This form is used because it allows it to be a con
+ return 0
+#define X(val, encode, name, cc_arg, scratch, preserved, stackptr, frameptr, \
+ isGPR, isInt, isI64Pair, isFP32, isFP64, isVec128, alias_init) \
+ +(isGPR)
+ REGARM32_TABLE
+#undef X
+ ;
+ }
+
+ static inline IceString getGPRName(SizeT RegNum) {
+ assert(RegNum <= getNumGPRs());
Jim Stichnoth 2016/01/10 18:22:00 Should this be "<" instead of "<=" ? (same commen
John 2016/01/11 13:40:36 Now that we have RegARM32::Table[], this should be
Karl 2016/01/11 17:59:44 As far as John's comment, I was making too many as
Karl 2016/01/11 17:59:44 Done.
+ return getRegName(Reg_GPR_First + RegNum);
+ }
+
static inline GPRRegister getI64PairFirstGPRNum(int32_t RegNum) {
assert(Reg_I64PAIR_First <= RegNum);
assert(RegNum <= Reg_I64PAIR_Last);
@@ -173,7 +188,18 @@ public:
}
static inline SizeT getNumSRegs() {
John 2016/01/11 13:40:36 can you remove inline here, and add constexpr? st
Karl 2016/01/11 17:59:44 Done.
- return Reg_SREG_Last + 1 - Reg_SREG_First;
+ return 0
+#define X(val, encode, name, cc_arg, scratch, preserved, stackptr, frameptr, \
+ isGPR, isInt, isI64Pair, isFP32, isFP64, isVec128, alias_init) \
+ +(isFP32)
+ REGARM32_TABLE
+#undef X
+ ;
+ }
+
+ static inline IceString getSRegName(SizeT RegNum) {
+ assert(RegNum <= getNumSRegs());
John 2016/01/11 13:40:36 Please use Table[]. assert(RegNum < Reg_NUM);
Karl 2016/01/11 17:59:44 Done.
+ return getRegName(Reg_SREG_First + RegNum);
}
static inline SRegister getEncodedSReg(int32_t RegNum) {
« 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