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

Unified Diff: src/IceRegistersARM32.h

Issue 1540653003: Add VADD instruction to the ARM integrated assembler. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fix nits and show extracted DART code. Created 5 years 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
Index: src/IceRegistersARM32.h
diff --git a/src/IceRegistersARM32.h b/src/IceRegistersARM32.h
index d601e734b19e334ea40a571d756a8a3c3ce3cbdb..2e022429b55d2e8f3e3c44ebdbcf98d1473ba6d9 100644
--- a/src/IceRegistersARM32.h
+++ b/src/IceRegistersARM32.h
@@ -82,6 +82,10 @@ public:
Encoded_Not_QReg = -1
};
+ static inline SizeT getNumGPRRegs() {
+ return Reg_GPR_Last + 1 - Reg_GPR_First;
+ }
+
static inline GPRRegister getEncodedGPR(int32_t RegNum) {
assert(Reg_GPR_First <= RegNum);
assert(RegNum <= Reg_GPR_Last);
@@ -113,15 +117,23 @@ public:
}
static inline SRegister getEncodedSReg(int32_t RegNum) {
- assert(Reg_SREG_First <= RegNum);
- assert(RegNum <= Reg_SREG_Last);
+ assert(isEncodedSReg(RegNum));
return SRegister(RegNum - Reg_SREG_First);
}
+ // Note: D registers are listed from largest to smallest.
Jim Stichnoth 2015/12/19 15:31:25 We should not be assuming any ordering (including
Karl 2016/01/05 20:24:31 If you note the functions above this one, ALL of t
+
+ static inline bool isEncodedDReg(int32_t RegNum) {
+ return Reg_DREG_First >= RegNum && RegNum >= Reg_DREG_Last;
+ }
+
+ static inline SizeT getNumDRegs() {
+ return Reg_DREG_First + 1 - Reg_DREG_Last;
+ }
+
static inline DRegister getEncodedDReg(int32_t RegNum) {
- assert(Reg_DREG_First <= RegNum);
- assert(RegNum <= Reg_DREG_Last);
- return DRegister(RegNum - Reg_DREG_First);
+ assert(isEncodedDReg(RegNum));
+ return DRegister(Reg_DREG_First - RegNum);
}
static inline QRegister getEncodedQReg(int32_t RegNum) {

Powered by Google App Engine
This is Rietveld 408576698