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

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: 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 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..e8075bb48d4f57eef3fc376f976e8143d07bf183 100644
--- a/src/IceRegistersARM32.h
+++ b/src/IceRegistersARM32.h
@@ -152,6 +152,15 @@ public:
return GPRRegister(Table[RegNum].Encoding);
}
+ static inline SizeT getNumGPRegs() {
+ return Reg_GPR_Last + 1 - Reg_GPR_First;
+ }
+
+ 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.
+ assert(RegNum <= getNumGPRegs());
+ return getRegName(Reg_GPR_First + RegNum);
+ }
+
static inline GPRRegister getI64PairFirstGPRNum(int32_t RegNum) {
assert(Reg_I64PAIR_First <= RegNum);
assert(RegNum <= Reg_I64PAIR_Last);
@@ -176,6 +185,11 @@ public:
return Reg_SREG_Last + 1 - Reg_SREG_First;
}
+ static inline IceString getSRegName(SizeT RegNum) {
+ assert(RegNum <= getNumSRegs());
+ return getRegName(Reg_SREG_First + RegNum);
+ }
+
static inline SRegister getEncodedSReg(int32_t RegNum) {
assert(Reg_SREG_First <= RegNum);
assert(RegNum <= Reg_SREG_Last);
« 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