diff options
author | Andreas Sandberg <andreas@sandberg.pp.se> | 2013-09-30 11:51:25 +0200 |
---|---|---|
committer | Andreas Sandberg <andreas@sandberg.pp.se> | 2013-09-30 11:51:25 +0200 |
commit | c299dcedc6d73aab56d9c659623d7112c2e9c4bb (patch) | |
tree | 64aa1c869f4505bb8306da124fb081a23ae51167 /src/arch/x86/isa/microops/fpop.isa | |
parent | 469f2e31cfb5b50c52888684e47289921d42292a (diff) | |
download | gem5-c299dcedc6d73aab56d9c659623d7112c2e9c4bb.tar.xz |
x86: Fix re-entrancy problems in x87 store instructions
X87 store instructions typically loads and pops the top value of the
stack and stores it in memory. The current implementation pops the
stack at the same time as the floating point value is loaded to a
temporary register. This will corrupt the state of the x87 stack if
the store fails. This changeset introduces a pop87 micro-instruction
that pops the stack and uses this instruction in the affected
macro-instructions to pop the stack after storing the value to memory.
Diffstat (limited to 'src/arch/x86/isa/microops/fpop.isa')
-rw-r--r-- | src/arch/x86/isa/microops/fpop.isa | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/arch/x86/isa/microops/fpop.isa b/src/arch/x86/isa/microops/fpop.isa index 142138fb2..8a77914d9 100644 --- a/src/arch/x86/isa/microops/fpop.isa +++ b/src/arch/x86/isa/microops/fpop.isa @@ -411,4 +411,13 @@ let {{ class chsfp(FpUnaryOp): code = 'FpDestReg = (-1) * (FpSrcReg1);' flag_code = 'FSW = FSW & (~CC1Bit);' + + class Pop87(FpUnaryOp): + def __init__(self, spm=1, UpdateFTW=True): + super(Pop87, self).__init__( \ + "InstRegIndex(FLOATREG_MICROFP0)", \ + "InstRegIndex(FLOATREG_MICROFP0)", \ + spm=spm, SetStatus=False, UpdateFTW=UpdateFTW) + + code = '' }}; |