summaryrefslogtreecommitdiff
path: root/src/arch/x86/faults.cc
diff options
context:
space:
mode:
authorAndreas Sandberg <andreas@sandberg.pp.se>2013-06-18 16:36:08 +0200
committerAndreas Sandberg <andreas@sandberg.pp.se>2013-06-18 16:36:08 +0200
commitd06064c38613662dfbf68a701052278b4018de8c (patch)
treecc7870da633caf1c52abbd624c37754fe5a99b52 /src/arch/x86/faults.cc
parenta8e8c4f433fb3cce354950ba72136b84abb78015 (diff)
downloadgem5-d06064c38613662dfbf68a701052278b4018de8c.tar.xz
x86: Add support for maintaining the x87 tag word
The current implementation of the x87 never updates the x87 tag word. This is currently not a big issue since the simulated x87 never checks for stack overflows, however this becomes an issue when switching between a virtualized CPU and a simulated CPU. This changeset adds support, which is enabled by default, for updating the tag register to every floating point microop that updates the stack top using the spm mechanism. The new tag words is generated by the helper function X86ISA::genX87Tags(). This function is currently limited to flagging a stack position as valid or invalid and does not try to distinguish between the valid, zero, and special states.
Diffstat (limited to 'src/arch/x86/faults.cc')
-rw-r--r--src/arch/x86/faults.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/arch/x86/faults.cc b/src/arch/x86/faults.cc
index 995326562..aa859052e 100644
--- a/src/arch/x86/faults.cc
+++ b/src/arch/x86/faults.cc
@@ -270,6 +270,9 @@ namespace X86ISA
tc->setMiscReg(MISCREG_MXCSR, 0x1f80);
+ // Flag all elements on the x87 stack as empty.
+ tc->setMiscReg(MISCREG_FTW, 0xFFFF);
+
// Update the handy M5 Reg.
tc->setMiscReg(MISCREG_M5_REG, 0);
MicroPC entry = X86ISAInst::RomLabels::extern_label_initIntHalt;