From f3f3747431e001dc6c80da5b6489516b610c22d6 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Wed, 19 Sep 2007 18:26:42 -0700 Subject: X86: Put in the foundation for x87 stack based fp registers. --HG-- extra : convert_revision : 940f92efd4a9dc59106e991cc6d9836861ab69de --- src/arch/x86/regfile.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/arch/x86/regfile.cc') 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); -- cgit v1.2.3