From a830e63de71e5929b8ff8e334bc872faa9193a8b Mon Sep 17 00:00:00 2001 From: Steve Reinhardt Date: Tue, 15 Oct 2013 14:22:43 -0400 Subject: isa: clean up register constants Clean up and add some consistency to the *_Base_DepTag constants as well as some related register constants: - Get rid of NumMiscArchRegs, TotalArchRegs, and TotalDataRegs since they're never used and not always defined - Set FP_Base_DepTag = NumIntRegs when possible (i.e., every case except x86) - Set Ctrl_Base_DepTag = FP_Base_DepTag + NumFloatRegs (this was true before, but wasn't always expressed that way) - Drastically reduce the number of arbitrary constants appearing in these calculations --- src/arch/sparc/miscregs.hh | 1 - src/arch/sparc/registers.hh | 14 +++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'src/arch/sparc') diff --git a/src/arch/sparc/miscregs.hh b/src/arch/sparc/miscregs.hh index 7008b6b36..b55fb7d44 100644 --- a/src/arch/sparc/miscregs.hh +++ b/src/arch/sparc/miscregs.hh @@ -155,7 +155,6 @@ struct STS }; -const int NumMiscArchRegs = MISCREG_NUMMISCREGS; const int NumMiscRegs = MISCREG_NUMMISCREGS; } diff --git a/src/arch/sparc/registers.hh b/src/arch/sparc/registers.hh index 8c61a070c..ffcfafcba 100644 --- a/src/arch/sparc/registers.hh +++ b/src/arch/sparc/registers.hh @@ -57,13 +57,6 @@ typedef union typedef uint16_t RegIndex; -// These enumerate all the registers for dependence tracking. -enum DependenceTags { - FP_Base_DepTag = 32*3+9, - Ctrl_Base_DepTag = FP_Base_DepTag + 64, - Max_DepTag = Ctrl_Base_DepTag + NumMiscRegs -}; - // semantically meaningful register indices const int ZeroReg = 0; // architecturally meaningful // the rest of these depend on the ABI @@ -80,6 +73,13 @@ const int NumIntRegs = (MaxGL + 1) * 8 + NWindows * 16 + NumMicroIntRegs; const int TotalNumRegs = NumIntRegs + NumFloatRegs + NumMiscRegs; +// These enumerate all the registers for dependence tracking. +enum DependenceTags { + FP_Base_DepTag = NumIntRegs, + Ctrl_Base_DepTag = FP_Base_DepTag + NumFloatRegs, + Max_DepTag = Ctrl_Base_DepTag + NumMiscRegs +}; + } // namespace SparcISA #endif -- cgit v1.2.3