2003-04-23 00:21:34 +04:00
|
|
|
/////////////////////////////////////////////////////////////////////////
|
2008-04-03 22:13:26 +04:00
|
|
|
// $Id: fpu_emu.cc,v 1.8 2008-04-03 18:13:26 sshwarts Exp $
|
2005-03-19 23:44:01 +03:00
|
|
|
/////////////////////////////////////////////////////////////////////////
|
2001-04-10 05:04:59 +04:00
|
|
|
//
|
2007-10-16 02:07:52 +04:00
|
|
|
// Copyright (c) 2004 Stanislav Shwartsman
|
|
|
|
// Written by Stanislav Shwartsman [sshwarts at sourceforge net]
|
2001-04-10 05:04:59 +04:00
|
|
|
//
|
|
|
|
// This library is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU Lesser General Public
|
|
|
|
// License as published by the Free Software Foundation; either
|
|
|
|
// version 2 of the License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This library is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
// Lesser General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU Lesser General Public
|
|
|
|
// License along with this library; if not, write to the Free Software
|
|
|
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
2004-04-09 19:34:59 +04:00
|
|
|
/////////////////////////////////////////////////////////////////////////
|
2001-04-10 05:04:59 +04:00
|
|
|
|
2008-04-03 22:13:26 +04:00
|
|
|
#define NEED_CPU_REG_SHORTCUTS 1
|
2003-12-27 16:50:06 +03:00
|
|
|
#include "bochs.h"
|
2006-03-07 01:03:16 +03:00
|
|
|
#include "cpu.h"
|
2003-12-27 16:50:06 +03:00
|
|
|
#define LOG_THIS BX_CPU_THIS_PTR
|
2001-04-10 05:04:59 +04:00
|
|
|
|
2004-04-09 19:34:59 +04:00
|
|
|
/* 9B */
|
2008-03-23 00:29:41 +03:00
|
|
|
void BX_CPP_AttrRegparmN(1) BX_CPU_C::FWAIT(bxInstruction_c *i)
|
2003-12-27 16:50:06 +03:00
|
|
|
{
|
|
|
|
#if BX_SUPPORT_FPU
|
2007-07-09 19:16:14 +04:00
|
|
|
if (BX_CPU_THIS_PTR cr0.get_TS() && BX_CPU_THIS_PTR cr0.get_MP())
|
2004-01-18 19:42:05 +03:00
|
|
|
exception(BX_NM_EXCEPTION, 0, 0);
|
2003-12-27 16:50:06 +03:00
|
|
|
|
2004-02-13 00:34:28 +03:00
|
|
|
BX_CPU_THIS_PTR FPU_check_pending_exceptions();
|
2003-12-27 16:50:06 +03:00
|
|
|
#else
|
|
|
|
BX_INFO(("FWAIT: requred FPU, use --enable-fpu"));
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2004-04-09 19:34:59 +04:00
|
|
|
/* relevant only when FPU support is disabled */
|
|
|
|
#if BX_SUPPORT_FPU == 0
|
2008-03-23 00:29:41 +03:00
|
|
|
void BX_CPP_AttrRegparmN(1) BX_CPU_C::FPU_ESC(bxInstruction_c *i)
|
2003-12-27 16:50:06 +03:00
|
|
|
{
|
2007-07-09 19:16:14 +04:00
|
|
|
if (BX_CPU_THIS_PTR cr0.get_EM() || BX_CPU_THIS_PTR cr0.get_TS())
|
2004-04-09 19:34:59 +04:00
|
|
|
exception(BX_NM_EXCEPTION, 0, 0);
|
2003-12-27 16:50:06 +03:00
|
|
|
}
|
|
|
|
#endif
|