Gabe Black has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/41742 )

Change subject: arch-x86: Move (most) non-public values out of registers.hh.
......................................................................

arch-x86: Move (most) non-public values out of registers.hh.

The unnecessary DependenceTags is already being removed by another
pending change, and so is left in place for that to remove. Once that's
happened, the regs/*.hh includes can be removed, and there may be other
include related tangles to sort out.

Change-Id: I1c02aa8fd2f2045017609b70523b3519c2a92b03
---
M src/arch/x86/linux/linux.hh
M src/arch/x86/process.cc
M src/arch/x86/registers.hh
M src/arch/x86/regs/float.hh
M src/arch/x86/regs/int.hh
M src/arch/x86/utility.cc
6 files changed, 20 insertions(+), 19 deletions(-)



diff --git a/src/arch/x86/linux/linux.hh b/src/arch/x86/linux/linux.hh
index 697892c..5b46aa1 100644
--- a/src/arch/x86/linux/linux.hh
+++ b/src/arch/x86/linux/linux.hh
@@ -62,7 +62,7 @@
         }

         if (stack)
-            ctc->setIntReg(X86ISA::StackPointerReg, stack);
+            ctc->setIntReg(X86ISA::INTREG_RSP, stack);
     }

     class SyscallABI {};
diff --git a/src/arch/x86/process.cc b/src/arch/x86/process.cc
index 925c836..cb69af9 100644
--- a/src/arch/x86/process.cc
+++ b/src/arch/x86/process.cc
@@ -978,7 +978,7 @@

     ThreadContext *tc = system->threads[contextIds[0]];
     // Set the stack pointer register
-    tc->setIntReg(StackPointerReg, stack_min);
+    tc->setIntReg(INTREG_RSP, stack_min);

// There doesn't need to be any segment base added in since we're dealing
     // with the flat segmentation model.
diff --git a/src/arch/x86/registers.hh b/src/arch/x86/registers.hh
index 572fa3d..e7c1d9f 100644
--- a/src/arch/x86/registers.hh
+++ b/src/arch/x86/registers.hh
@@ -41,23 +41,14 @@

 #include "arch/generic/vec_pred_reg.hh"
 #include "arch/generic/vec_reg.hh"
-#include "arch/x86/regs/int.hh"
 #include "arch/x86/regs/ccr.hh"
+#include "arch/x86/regs/float.hh"
+#include "arch/x86/regs/int.hh"
 #include "arch/x86/regs/misc.hh"
-#include "arch/x86/x86_traits.hh"

 namespace X86ISA
 {

-const int NumIntArchRegs = NUM_INTREGS;
-const int NumIntRegs = NumIntArchRegs + NumMicroIntRegs + NumImplicitIntRegs;
-const int NumCCRegs = NUM_CCREGS;
-
-// Each 128 bit xmm register is broken into two effective 64 bit registers.
-// Add 8 for the indices that are mapped over the fp stack
-const int NumFloatRegs =
-    NumMMXRegs + 2 * NumXMMRegs + NumMicroFpRegs + 8;
-
 // These enumerate all the registers for dependence tracking.
 enum DependenceTags {
     // FP_Reg_Base must be large enough to be bigger than any integer
@@ -65,14 +56,12 @@
     // we just start at (1 << 7) == 128.
     FP_Reg_Base = 128,
     CC_Reg_Base = FP_Reg_Base + NumFloatRegs,
-    Misc_Reg_Base = CC_Reg_Base + NumCCRegs,
+    Misc_Reg_Base = CC_Reg_Base + NUM_CCREGS,
     Max_Reg_Index = Misc_Reg_Base + NUM_MISCREGS
 };

-// semantically meaningful register indices
-//There is no such register in X86
+// There is no such register in X86.
 const int ZeroReg = NUM_INTREGS;
-const int StackPointerReg = INTREG_RSP;

 // Not applicable to x86
 using VecElem = ::DummyVecElem;
diff --git a/src/arch/x86/regs/float.hh b/src/arch/x86/regs/float.hh
index 6cba603..963c111 100644
--- a/src/arch/x86/regs/float.hh
+++ b/src/arch/x86/regs/float.hh
@@ -148,6 +148,11 @@
     {
         return FLOATREG_FPR((top + index + 8) % 8);
     }
+
+ // Each 128 bit xmm register is broken into two effective 64 bit registers.
+    // Add 8 for the indices that are mapped over the fp stack
+    const int NumFloatRegs =
+        NumMMXRegs + 2 * NumXMMRegs + NumMicroFpRegs + 8;
 }

 #endif // __ARCH_X86_FLOATREGS_HH__
diff --git a/src/arch/x86/regs/int.hh b/src/arch/x86/regs/int.hh
index aa26224..87b3190 100644
--- a/src/arch/x86/regs/int.hh
+++ b/src/arch/x86/regs/int.hh
@@ -169,6 +169,10 @@
             index = (index - 4) | foldBit;
         return (IntRegIndex)index;
     }
+
+    const int NumIntArchRegs = NUM_INTREGS;
+    const int NumIntRegs =
+        NumIntArchRegs + NumMicroIntRegs + NumImplicitIntRegs;
 }

 #endif // __ARCH_X86_INTREGS_HH__
diff --git a/src/arch/x86/utility.cc b/src/arch/x86/utility.cc
index c664620..2872557 100644
--- a/src/arch/x86/utility.cc
+++ b/src/arch/x86/utility.cc
@@ -40,7 +40,10 @@

 #include "arch/x86/interrupts.hh"
 #include "arch/x86/mmu.hh"
-#include "arch/x86/registers.hh"
+#include "arch/x86/regs/ccr.hh"
+#include "arch/x86/regs/float.hh"
+#include "arch/x86/regs/int.hh"
+#include "arch/x86/regs/misc.hh"
 #include "arch/x86/x86_traits.hh"
 #include "cpu/base.hh"
 #include "fputils/fp80.h"
@@ -79,7 +82,7 @@
     for (int i = 0; i < NumFloatRegs; ++i)
          dest->setFloatRegFlat(i, src->readFloatRegFlat(i));
     //copy condition-code regs
-    for (int i = 0; i < NumCCRegs; ++i)
+    for (int i = 0; i < NUM_CCREGS; ++i)
          dest->setCCRegFlat(i, src->readCCRegFlat(i));
     copyMiscRegs(src, dest);
     dest->pcState(src->pcState());

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/41742
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I1c02aa8fd2f2045017609b70523b3519c2a92b03
Gerrit-Change-Number: 41742
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to