summaryrefslogtreecommitdiff
path: root/src/arch/x86/regfile.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/x86/regfile.cc')
-rw-r--r--src/arch/x86/regfile.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/arch/x86/regfile.cc b/src/arch/x86/regfile.cc
index 96283cada..889f2f5cd 100644
--- a/src/arch/x86/regfile.cc
+++ b/src/arch/x86/regfile.cc
@@ -85,6 +85,7 @@
* Authors: Gabe Black
*/
+#include "arch/x86/floatregs.hh"
#include "arch/x86/regfile.hh"
#include "base/trace.hh"
#include "sim/serialize.hh"
@@ -218,6 +219,15 @@ int X86ISA::flattenIntIndex(ThreadContext * tc, int reg)
return (reg & ~(1 << 6));
}
+int X86ISA::flattenFloatIndex(ThreadContext * tc, int reg)
+{
+ if (reg > NUM_FLOATREGS) {
+ int top = tc->readMiscRegNoEffect(MISCREG_X87_TOP);
+ reg = FLOATREG_STACK(reg - NUM_FLOATREGS, top);
+ }
+ return reg;
+}
+
void RegFile::serialize(std::ostream &os)
{
intRegFile.serialize(os);