summaryrefslogtreecommitdiff
path: root/src/arch/x86/intregs.hh
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2009-07-17 00:29:42 -0700
committerGabe Black <gblack@eecs.umich.edu>2009-07-17 00:29:42 -0700
commitdf378285f8e2aaf8e1a1bd54f862ed7c7a073e28 (patch)
treea1b329e2b480c008e539ab3d432a151c3ab5a514 /src/arch/x86/intregs.hh
parente557b4beb570c2019d01da6cb1036dad5853cb60 (diff)
downloadgem5-df378285f8e2aaf8e1a1bd54f862ed7c7a073e28.tar.xz
X86: Shift some register flattening work into the decoder.
Diffstat (limited to 'src/arch/x86/intregs.hh')
-rw-r--r--src/arch/x86/intregs.hh6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/arch/x86/intregs.hh b/src/arch/x86/intregs.hh
index 6f252392e..627d7062f 100644
--- a/src/arch/x86/intregs.hh
+++ b/src/arch/x86/intregs.hh
@@ -60,6 +60,8 @@
#include "arch/x86/x86_traits.hh"
#include "base/bitunion.hh"
+#include "base/misc.hh"
+#include "sim/core.hh"
namespace X86ISA
{
@@ -187,7 +189,9 @@ namespace X86ISA
inline static IntRegIndex
INTREG_FOLDED(int index, int foldBit)
{
- return (IntRegIndex)(((index & 0x1C) == 4 ? foldBit : 0) | index);
+ if ((index & 0x1C) == 4 && foldBit)
+ index = (index - 4) | foldBit;
+ return (IntRegIndex)index;
}
};