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

Unified Diff: src/IceRegistersMIPS32.h

Issue 1993993004: Subzero, MIPS32: Introduction of floating point registers (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Added floating point register pairs Created 4 years, 7 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
« no previous file with comments | « src/IceInstMIPS32.def ('k') | src/IceTargetLoweringMIPS32.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceRegistersMIPS32.h
diff --git a/src/IceRegistersMIPS32.h b/src/IceRegistersMIPS32.h
index 4e14387039e50429a97012ab31c4f72aa48622d0..023132c233e7f30cdd9a8b2485a0c1dfc97b7492 100644
--- a/src/IceRegistersMIPS32.h
+++ b/src/IceRegistersMIPS32.h
@@ -50,6 +50,18 @@ enum GPRRegister {
Encoded_Not_GPR = -1
};
+/// An enum of FPR Registers. The enum value does match the encoding used
+/// to binary encode register operands in instructions.
+enum FPRRegister {
+#define X(val, encode, name, scratch, preserved, stackptr, frameptr, isInt, \
+ isI64Pair, isFP32, isFP64, isVec128, alias_init) \
+ \
+ Encoded_##val = encode,
+ REGMIPS32_FPR_TABLE
+#undef X
+ Encoded_Not_FPR = -1
+};
+
// TODO(jvoung): Floating point and vector registers...
// Need to model overlap and difference in encoding too.
@@ -59,6 +71,22 @@ static inline GPRRegister getEncodedGPR(RegNumT RegNum) {
return GPRRegister(RegNum - Reg_GPR_First);
}
+static inline bool isGPRReg(RegNumT RegNum) {
+ return (int(Reg_GPR_First) <= int(RegNum)) &&
+ (unsigned(RegNum) <= Reg_GPR_Last);
+}
+
+static inline FPRRegister getEncodedFPR(RegNumT RegNum) {
+ assert(int(Reg_FPR_First) <= int(RegNum));
+ assert(unsigned(RegNum) <= Reg_FPR_Last);
+ return FPRRegister(RegNum - Reg_FPR_First);
+}
+
+static inline bool isFPRReg(RegNumT RegNum) {
+ return (int(Reg_FPR_First) <= int(RegNum)) &&
+ (unsigned(RegNum) <= Reg_FPR_Last);
+}
+
const char *getRegName(RegNumT RegNum);
} // end of namespace RegMIPS32
« no previous file with comments | « src/IceInstMIPS32.def ('k') | src/IceTargetLoweringMIPS32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698