update checking for pending FPU exceptions code

This commit is contained in:
Stanislav Shwartsman 2004-01-31 13:43:26 +00:00
parent fd0a5cac9b
commit 9120961241
3 changed files with 18 additions and 4 deletions

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: cpu.h,v 1.157 2004-01-29 17:49:03 mcb30 Exp $
// $Id: cpu.h,v 1.158 2004-01-31 13:43:25 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001 MandrakeSoft S.A.
@ -2082,6 +2082,7 @@ union {
#if BX_SUPPORT_FPU
BX_SMF void prepareFPU(void);
BX_SMF void FPU_check_pending_exceptions(void);
BX_SMF void print_state_FPU(void);
#endif

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: fpu.cc,v 1.6 2004-01-18 16:42:05 cbothamy Exp $
// $Id: fpu.cc,v 1.7 2004-01-31 13:43:26 sshwarts Exp $
/////////////////////////////////////////////////////////////////////////
// Copyright (C) 2001 MandrakeSoft S.A.
//
@ -38,6 +38,20 @@ void BX_CPU_C::prepareFPU(void)
exception(BX_NM_EXCEPTION, 0, 0);
}
}
void BX_CPU_C::FPU_check_pending_exceptions(void)
{
if (BX_CPU_THIS_PTR cr0.ne == 0)
{
// MSDOS compatibility external interrupt (IRQ13)
BX_INFO (("math_abort: MSDOS compatibility FPU exception"));
DEV_pic_raise_irq(13);
}
else
{
exception(BX_MF_EXCEPTION, 0, 0);
}
}
#endif
void BX_CPU_C::FWAIT(bxInstruction_c *i)

View File

@ -110,8 +110,7 @@ void BX_CPU_C::prepareMMX(void)
void BX_CPU_C::prepareFPU2MMX(void)
{
/* check floating point status word for a pending FPU exceptions */
if(FPU_PARTIAL_STATUS & FPU_SW_SUMMARY)
exception(BX_MF_EXCEPTION, 0, 0);
FPU_check_pending_exceptions();
FPU_TAG_WORD = 0;
FPU_TOS = 0; /* reset FPU Top-Of-Stack */