diff options
author | Gabe Black <gblack@eecs.umich.edu> | 2007-09-19 18:26:42 -0700 |
---|---|---|
committer | Gabe Black <gblack@eecs.umich.edu> | 2007-09-19 18:26:42 -0700 |
commit | f3f3747431e001dc6c80da5b6489516b610c22d6 (patch) | |
tree | 24fcbc928df1619a82dbfd9ffa6d6f6809f509f6 /src/arch/x86/regfile.cc | |
parent | a54ae9f92b6000e8aaf5e056deaead8725c25a74 (diff) | |
download | gem5-f3f3747431e001dc6c80da5b6489516b610c22d6.tar.xz |
X86: Put in the foundation for x87 stack based fp registers.
--HG--
extra : convert_revision : 940f92efd4a9dc59106e991cc6d9836861ab69de
Diffstat (limited to 'src/arch/x86/regfile.cc')
-rw-r--r-- | src/arch/x86/regfile.cc | 10 |
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); |