summaryrefslogtreecommitdiff
path: root/src/arch/x86/regfile.cc
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2007-07-30 13:25:00 -0700
committerGabe Black <gblack@eecs.umich.edu>2007-07-30 13:25:00 -0700
commitda84aa95a99ef84ff10b7ce53156825e73d0b8e5 (patch)
treed815eb4f8ee8797f1de8e673987f466b1cb1731f /src/arch/x86/regfile.cc
parentd8beeff324f0d47927716e0081fe4a72c56601f7 (diff)
downloadgem5-da84aa95a99ef84ff10b7ce53156825e73d0b8e5.tar.xz
Make the register indices use the appropriate "fold" bit.
--HG-- extra : convert_revision : 89e15e2ef1f709f2c09238b78f94505ce8ef146d
Diffstat (limited to 'src/arch/x86/regfile.cc')
-rw-r--r--src/arch/x86/regfile.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/arch/x86/regfile.cc b/src/arch/x86/regfile.cc
index f54f531e2..96283cada 100644
--- a/src/arch/x86/regfile.cc
+++ b/src/arch/x86/regfile.cc
@@ -86,6 +86,7 @@
*/
#include "arch/x86/regfile.hh"
+#include "base/trace.hh"
#include "sim/serialize.hh"
#include "cpu/thread_context.hh"
@@ -209,8 +210,12 @@ void RegFile::setIntReg(int intReg, const IntReg &val)
int X86ISA::flattenIntIndex(ThreadContext * tc, int reg)
{
- //For right now, don't do any flattening
- return reg;
+ //If we need to fold over the index to match byte semantics, do that.
+ //Otherwise, just strip off any extra bits and pass it through.
+ if (reg & (1 << 6))
+ return (reg & ~(1 << 6) - 0x4);
+ else
+ return (reg & ~(1 << 6));
}
void RegFile::serialize(std::ostream &os)