X86: Set up a named constant for the "fold bit" for int register indices.
authorGabe Black <gblack@eecs.umich.edu>
Sat, 18 Jul 2009 01:49:22 +0000 (18:49 -0700)
committerGabe Black <gblack@eecs.umich.edu>
Sat, 18 Jul 2009 01:49:22 +0000 (18:49 -0700)
src/arch/x86/insts/microregop.cc
src/arch/x86/insts/static_inst.cc
src/arch/x86/insts/static_inst.hh
src/arch/x86/intregs.hh
src/arch/x86/isa.hh

index 2ea975746bf63d35f4339662e2a10ebd3049446c..2edd3ba87c73b6ecfaa40a114dc3b633da7c5c1f 100644 (file)
@@ -67,7 +67,7 @@ namespace X86ISA
             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;
index 0820a47d4126f0d17fc6bff585b851e2018433d4..4f48c4c594aac905b61979ec8a615415ef102bea 100644 (file)
@@ -149,8 +149,8 @@ namespace X86ISA
 
         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";
index 4ca7a4984945512189ebb5ce458c2d77d5a5e833..32065f7c0e2fbf0f3ec41fbaf4ddaaae0a677d8a 100644 (file)
@@ -108,7 +108,7 @@ namespace X86ISA
         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 @@ namespace X86ISA
         {
             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 @@ namespace X86ISA
         {
             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)
             {
index 627d7062f4bcaf9e62c6d64db4d03f2eaee816d7..2c6d871edc5d43c7a88a95390870cd9a2ceb6e70 100644 (file)
@@ -167,6 +167,9 @@ namespace X86ISA
         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)
     {
index 8d3b110c6e98c3d330149f7e5360f009d3bfb419..9a1880062d4b77a83cdbe0aecefcc4d8eee73c83 100644 (file)
@@ -69,7 +69,7 @@ namespace X86ISA
         int
         flattenIntIndex(int reg)
         {
-            return reg & ~(1 << 6);
+            return reg & ~IntFoldBit;
         }
 
         int