From df378285f8e2aaf8e1a1bd54f862ed7c7a073e28 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Fri, 17 Jul 2009 00:29:42 -0700 Subject: X86: Shift some register flattening work into the decoder. --- src/arch/x86/intregs.hh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/arch/x86/intregs.hh') 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; } }; -- cgit v1.2.3