summaryrefslogtreecommitdiff
path: root/src/arch/x86/registers.hh
diff options
context:
space:
mode:
authorSteve Reinhardt <steve.reinhardt@amd.com>2013-10-15 14:22:43 -0400
committerSteve Reinhardt <steve.reinhardt@amd.com>2013-10-15 14:22:43 -0400
commita830e63de71e5929b8ff8e334bc872faa9193a8b (patch)
tree64346e0672e36c08a6a8efa6e3ebb3ed875e6fa8 /src/arch/x86/registers.hh
parent9bd017b8aee1432b78361da89ce4980dabb70084 (diff)
downloadgem5-a830e63de71e5929b8ff8e334bc872faa9193a8b.tar.xz
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
Diffstat (limited to 'src/arch/x86/registers.hh')
-rw-r--r--src/arch/x86/registers.hh24
1 files changed, 8 insertions, 16 deletions
diff --git a/src/arch/x86/registers.hh b/src/arch/x86/registers.hh
index 20385a960..e811ed2d3 100644
--- a/src/arch/x86/registers.hh
+++ b/src/arch/x86/registers.hh
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2007 The Hewlett-Packard Development Company
+ * Copyright (c) 2013 Advanced Micro Devices, Inc.
* All rights reserved.
*
* The license below extends only to copyright in the software and shall
@@ -50,7 +51,6 @@ namespace X86ISA
using X86ISAInst::MaxInstSrcRegs;
using X86ISAInst::MaxInstDestRegs;
using X86ISAInst::MaxMiscDestRegs;
-const int NumMiscArchRegs = NUM_MISCREGS;
const int NumMiscRegs = NUM_MISCREGS;
const int NumIntArchRegs = NUM_INTREGS;
@@ -58,26 +58,18 @@ const int NumIntRegs =
NumIntArchRegs + NumMicroIntRegs +
NumPseudoIntRegs + NumImplicitIntRegs;
-//Each 128 bit xmm register is broken into two effective 64 bit registers.
+// 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;
-const int NumFloatArchRegs = NumFloatRegs + 8;
+ NumMMXRegs + 2 * NumXMMRegs + NumMicroFpRegs + 8;
// These enumerate all the registers for dependence tracking.
enum DependenceTags {
- //There are 16 microcode registers at the moment. This is an
- //unusually large constant to make sure there isn't overflow.
+ // FP_Base_DepTag must be large enough to be bigger than any integer
+ // register index which has the IntFoldBit (1 << 6) set. To be safe
+ // we just start at (1 << 7) == 128.
FP_Base_DepTag = 128,
- Ctrl_Base_DepTag =
- FP_Base_DepTag +
- //mmx/x87 registers
- 8 +
- //xmm registers
- 16 * 2 +
- //The microcode fp registers
- 8 +
- //The indices that are mapped over the fp stack
- 8,
+ Ctrl_Base_DepTag = FP_Base_DepTag + NumFloatRegs,
Max_DepTag = Ctrl_Base_DepTag + NumMiscRegs
};