changeset 62de7e765286 in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=62de7e765286
description:
        X86: Set up a named constant for the "fold bit" for int register 
indices.

diffstat:

5 files changed, 10 insertions(+), 7 deletions(-)
src/arch/x86/insts/microregop.cc  |    2 +-
src/arch/x86/insts/static_inst.cc |    4 ++--
src/arch/x86/insts/static_inst.hh |    6 +++---
src/arch/x86/intregs.hh           |    3 +++
src/arch/x86/isa.hh               |    2 +-

diffs (81 lines):

diff -r c3058964d06f -r 62de7e765286 src/arch/x86/insts/microregop.cc
--- a/src/arch/x86/insts/microregop.cc  Fri Jul 17 00:29:56 2009 -0700
+++ b/src/arch/x86/insts/microregop.cc  Fri Jul 17 18:49:22 2009 -0700
@@ -67,7 +67,7 @@
             bool subtract) const
     {
         DPRINTF(X86, "flagMask = %#x\n", flagMask);
-        if (_destRegIdx[0] & (1 << 6)) {
+        if (_destRegIdx[0] & IntFoldBit) {
             _dest >>= 8;
         }
         uint64_t flags = oldFlags & ~flagMask;
diff -r c3058964d06f -r 62de7e765286 src/arch/x86/insts/static_inst.cc
--- a/src/arch/x86/insts/static_inst.cc Fri Jul 17 00:29:56 2009 -0700
+++ b/src/arch/x86/insts/static_inst.cc Fri Jul 17 18:49:22 2009 -0700
@@ -149,8 +149,8 @@
 
         if (reg < FP_Base_DepTag) {
             const char * suffix = "";
-            bool fold = reg & (1 << 6);
-            reg &= ~(1 << 6);
+            bool fold = reg & IntFoldBit;
+            reg &= ~IntFoldBit;
 
             if(fold)
                 suffix = "h";
diff -r c3058964d06f -r 62de7e765286 src/arch/x86/insts/static_inst.hh
--- a/src/arch/x86/insts/static_inst.hh Fri Jul 17 00:29:56 2009 -0700
+++ b/src/arch/x86/insts/static_inst.hh Fri Jul 17 18:49:22 2009 -0700
@@ -108,7 +108,7 @@
         inline uint64_t merge(uint64_t into, uint64_t val, int size) const
         {
             X86IntReg reg = into;
-            if(_destRegIdx[0] & (1 << 6))
+            if(_destRegIdx[0] & IntFoldBit)
             {
                 reg.H = val;
                 return reg;
@@ -139,7 +139,7 @@
         {
             X86IntReg reg = from;
             DPRINTF(X86, "Picking with size %d\n", size);
-            if(_srcRegIdx[idx] & (1 << 6))
+            if(_srcRegIdx[idx] & IntFoldBit)
                 return reg.H;
             switch(size)
             {
@@ -160,7 +160,7 @@
         {
             X86IntReg reg = from;
             DPRINTF(X86, "Picking with size %d\n", size);
-            if(_srcRegIdx[idx] & (1 << 6))
+            if(_srcRegIdx[idx] & IntFoldBit)
                 return reg.SH;
             switch(size)
             {
diff -r c3058964d06f -r 62de7e765286 src/arch/x86/intregs.hh
--- a/src/arch/x86/intregs.hh   Fri Jul 17 00:29:56 2009 -0700
+++ b/src/arch/x86/intregs.hh   Fri Jul 17 18:49:22 2009 -0700
@@ -167,6 +167,9 @@
         NUM_INTREGS
     };
 
+    // This needs to be large enough to miss all the other bits of an index.
+    static const IntRegIndex IntFoldBit = (IntRegIndex)(1 << 6);
+
     inline static IntRegIndex
     INTREG_MICRO(int index)
     {
diff -r c3058964d06f -r 62de7e765286 src/arch/x86/isa.hh
--- a/src/arch/x86/isa.hh       Fri Jul 17 00:29:56 2009 -0700
+++ b/src/arch/x86/isa.hh       Fri Jul 17 18:49:22 2009 -0700
@@ -69,7 +69,7 @@
         int
         flattenIntIndex(int reg)
         {
-            return reg & ~(1 << 6);
+            return reg & ~IntFoldBit;
         }
 
         int
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to