code cleanup for future optimization

This commit is contained in:
Stanislav Shwartsman 2009-03-10 21:43:11 +00:00
parent 07f811013c
commit 08de514d9c
12 changed files with 368 additions and 535 deletions

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// $Id: sse.cc,v 1.64 2009-01-16 18:18:58 sshwarts Exp $ // $Id: sse.cc,v 1.65 2009-03-10 21:43:11 sshwarts Exp $
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// //
// Copyright (c) 2003 Stanislav Shwartsman // Copyright (c) 2003 Stanislav Shwartsman
@ -652,7 +652,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PTEST_VdqWdq(bxInstruction_c *i)
(op2.xmm64u(1) & ~op1.xmm64u(1)) == 0) result |= EFlagsCFMask; (op2.xmm64u(1) & ~op1.xmm64u(1)) == 0) result |= EFlagsCFMask;
setEFlagsOSZAPC(result); setEFlagsOSZAPC(result);
#else #else
BX_INFO(("PTEST_VdqWdq: required SSE4, use --enable-sse option")); BX_INFO(("PTEST_VdqWdq: required SSE4, use --enable-sse option"));
exception(BX_UD_EXCEPTION, 0, 0); exception(BX_UD_EXCEPTION, 0, 0);

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// $Id: sse_move.cc,v 1.97 2009-01-16 18:18:58 sshwarts Exp $ // $Id: sse_move.cc,v 1.98 2009-03-10 21:43:11 sshwarts Exp $
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// //
// Copyright (c) 2003 Stanislav Shwartsman // Copyright (c) 2003 Stanislav Shwartsman
@ -835,7 +835,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MASKMOVDQU_VdqUdq(bxInstruction_c *i)
/* and write result back to the memory */ /* and write result back to the memory */
write_virtual_dqword(i->seg(), rdi, (Bit8u *) &temp); write_virtual_dqword(i->seg(), rdi, (Bit8u *) &temp);
#else #else
BX_INFO(("MASKMOVDQU_VdqUdq: required SSE2, use --enable-sse option")); BX_INFO(("MASKMOVDQU_VdqUdq: required SSE2, use --enable-sse option"));
exception(BX_UD_EXCEPTION, 0, 0); exception(BX_UD_EXCEPTION, 0, 0);
@ -1115,7 +1114,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::PMOVMSKB_GdUdq(bxInstruction_c *i)
/* now write result back to destination */ /* now write result back to destination */
BX_WRITE_32BIT_REGZ(i->nnn(), result); BX_WRITE_32BIT_REGZ(i->nnn(), result);
#else #else
BX_INFO(("PMOVMSKB_GdUdq: required SSE2, use --enable-sse option")); BX_INFO(("PMOVMSKB_GdUdq: required SSE2, use --enable-sse option"));
exception(BX_UD_EXCEPTION, 0, 0); exception(BX_UD_EXCEPTION, 0, 0);
@ -1379,7 +1377,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MOVNTDQA_VdqMdq(bxInstruction_c *i)
/* now write result back to destination */ /* now write result back to destination */
BX_WRITE_XMM_REG(i->nnn(), op); BX_WRITE_XMM_REG(i->nnn(), op);
#else #else
BX_INFO(("MOVNTDQA_VdqMdq: required SSE4, use --enable-sse option")); BX_INFO(("MOVNTDQA_VdqMdq: required SSE4, use --enable-sse option"));
exception(BX_UD_EXCEPTION, 0, 0); exception(BX_UD_EXCEPTION, 0, 0);

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// $Id: sse_pfp.cc,v 1.52 2009-01-16 18:18:58 sshwarts Exp $ // $Id: sse_pfp.cc,v 1.53 2009-03-10 21:43:11 sshwarts Exp $
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// //
// Copyright (c) 2003 Stanislav Shwartsman // Copyright (c) 2003 Stanislav Shwartsman
@ -415,7 +415,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTTSD2SI_GdWsd(bxInstruction_c *i)
BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags); BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags);
BX_WRITE_32BIT_REGZ(i->nnn(), result); BX_WRITE_32BIT_REGZ(i->nnn(), result);
} }
#else #else
BX_INFO(("CVTTSD2SI_GdWsd: required SSE2, use --enable-sse option")); BX_INFO(("CVTTSD2SI_GdWsd: required SSE2, use --enable-sse option"));
exception(BX_UD_EXCEPTION, 0, 0); exception(BX_UD_EXCEPTION, 0, 0);
@ -464,7 +463,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTTSS2SI_GdWss(bxInstruction_c *i)
BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags); BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags);
BX_WRITE_32BIT_REGZ(i->nnn(), result); BX_WRITE_32BIT_REGZ(i->nnn(), result);
} }
#else #else
BX_INFO(("CVTTSS2SI_GdWss: required SSE, use --enable-sse option")); BX_INFO(("CVTTSS2SI_GdWss: required SSE, use --enable-sse option"));
exception(BX_UD_EXCEPTION, 0, 0); exception(BX_UD_EXCEPTION, 0, 0);
@ -614,7 +612,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTSD2SI_GdWsd(bxInstruction_c *i)
BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags); BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags);
BX_WRITE_32BIT_REGZ(i->nnn(), result); BX_WRITE_32BIT_REGZ(i->nnn(), result);
} }
#else #else
BX_INFO(("CVTSD2SI_GdWsd: required SSE2, use --enable-sse option")); BX_INFO(("CVTSD2SI_GdWsd: required SSE2, use --enable-sse option"));
exception(BX_UD_EXCEPTION, 0, 0); exception(BX_UD_EXCEPTION, 0, 0);
@ -663,7 +660,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTSS2SI_GdWss(bxInstruction_c *i)
BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags); BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags);
BX_WRITE_32BIT_REGZ(i->nnn(), result); BX_WRITE_32BIT_REGZ(i->nnn(), result);
} }
#else #else
BX_INFO(("CVTSS2SI_GdWss: required SSE, use --enable-sse option")); BX_INFO(("CVTSS2SI_GdWss: required SSE, use --enable-sse option"));
exception(BX_UD_EXCEPTION, 0, 0); exception(BX_UD_EXCEPTION, 0, 0);
@ -709,7 +705,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTPS2PD_VpsWps(bxInstruction_c *i)
BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags); BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags);
BX_WRITE_XMM_REG(i->nnn(), result); BX_WRITE_XMM_REG(i->nnn(), result);
#else #else
BX_INFO(("CVTPS2PD_VpsWps: required SSE2, use --enable-sse option")); BX_INFO(("CVTPS2PD_VpsWps: required SSE2, use --enable-sse option"));
exception(BX_UD_EXCEPTION, 0, 0); exception(BX_UD_EXCEPTION, 0, 0);
@ -755,7 +750,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTPD2PS_VpdWpd(bxInstruction_c *i)
BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags); BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags);
BX_WRITE_XMM_REG(i->nnn(), result); BX_WRITE_XMM_REG(i->nnn(), result);
#else #else
BX_INFO(("CVTPD2PS_VpdWpd: required SSE2, use --enable-sse option")); BX_INFO(("CVTPD2PS_VpdWpd: required SSE2, use --enable-sse option"));
exception(BX_UD_EXCEPTION, 0, 0); exception(BX_UD_EXCEPTION, 0, 0);
@ -793,7 +787,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTSD2SS_VsdWsd(bxInstruction_c *i)
result = float64_to_float32(op, status_word); result = float64_to_float32(op, status_word);
BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags); BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags);
BX_WRITE_XMM_REG_LO_DWORD(i->nnn(), result); BX_WRITE_XMM_REG_LO_DWORD(i->nnn(), result);
#else #else
BX_INFO(("CVTSD2SS_VsdWsd: required SSE2, use --enable-sse option")); BX_INFO(("CVTSD2SS_VsdWsd: required SSE2, use --enable-sse option"));
exception(BX_UD_EXCEPTION, 0, 0); exception(BX_UD_EXCEPTION, 0, 0);
@ -829,7 +822,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CVTSS2SD_VssWss(bxInstruction_c *i)
result = float32_to_float64(op, status_word); result = float32_to_float64(op, status_word);
BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags); BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags);
BX_WRITE_XMM_REG_LO_QWORD(i->nnn(), result); BX_WRITE_XMM_REG_LO_QWORD(i->nnn(), result);
#else #else
BX_INFO(("CVTSS2SD_VssWss: required SSE2, use --enable-sse option")); BX_INFO(("CVTSS2SD_VssWss: required SSE2, use --enable-sse option"));
exception(BX_UD_EXCEPTION, 0, 0); exception(BX_UD_EXCEPTION, 0, 0);
@ -1294,7 +1286,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::SQRTPS_VpsWps(bxInstruction_c *i)
BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags); BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags);
BX_WRITE_XMM_REG(i->nnn(), op); BX_WRITE_XMM_REG(i->nnn(), op);
#else #else
BX_INFO(("SQRTPS_VpsWps: required SSE, use --enable-sse option")); BX_INFO(("SQRTPS_VpsWps: required SSE, use --enable-sse option"));
exception(BX_UD_EXCEPTION, 0, 0); exception(BX_UD_EXCEPTION, 0, 0);
@ -1337,7 +1328,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::SQRTPD_VpdWpd(bxInstruction_c *i)
BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags); BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags);
BX_WRITE_XMM_REG(i->nnn(), op); BX_WRITE_XMM_REG(i->nnn(), op);
#else #else
BX_INFO(("SQRTPD_VpdWpd: required SSE2, use --enable-sse option")); BX_INFO(("SQRTPD_VpdWpd: required SSE2, use --enable-sse option"));
exception(BX_UD_EXCEPTION, 0, 0); exception(BX_UD_EXCEPTION, 0, 0);
@ -1372,7 +1362,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::SQRTSD_VsdWsd(bxInstruction_c *i)
op = float64_sqrt(op, status_word); op = float64_sqrt(op, status_word);
BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags); BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags);
BX_WRITE_XMM_REG_LO_QWORD(i->nnn(), op); BX_WRITE_XMM_REG_LO_QWORD(i->nnn(), op);
#else #else
BX_INFO(("SQRTSD_VsdWsd: required SSE2, use --enable-sse option")); BX_INFO(("SQRTSD_VsdWsd: required SSE2, use --enable-sse option"));
exception(BX_UD_EXCEPTION, 0, 0); exception(BX_UD_EXCEPTION, 0, 0);
@ -1407,7 +1396,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::SQRTSS_VssWss(bxInstruction_c *i)
op = float32_sqrt(op, status_word); op = float32_sqrt(op, status_word);
BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags); BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags);
BX_WRITE_XMM_REG_LO_DWORD(i->nnn(), op); BX_WRITE_XMM_REG_LO_DWORD(i->nnn(), op);
#else #else
BX_INFO(("SQRTSS_VssWss: required SSE, use --enable-sse option")); BX_INFO(("SQRTSS_VssWss: required SSE, use --enable-sse option"));
exception(BX_UD_EXCEPTION, 0, 0); exception(BX_UD_EXCEPTION, 0, 0);
@ -1458,7 +1446,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::ADDPS_VpsWps(bxInstruction_c *i)
BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags); BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags);
BX_WRITE_XMM_REG(i->nnn(), op1); BX_WRITE_XMM_REG(i->nnn(), op1);
#else #else
BX_INFO(("ADDPS_VpsWps: required SSE, use --enable-sse option")); BX_INFO(("ADDPS_VpsWps: required SSE, use --enable-sse option"));
exception(BX_UD_EXCEPTION, 0, 0); exception(BX_UD_EXCEPTION, 0, 0);
@ -1503,7 +1490,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::ADDPD_VpdWpd(bxInstruction_c *i)
BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags); BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags);
BX_WRITE_XMM_REG(i->nnn(), op1); BX_WRITE_XMM_REG(i->nnn(), op1);
#else #else
BX_INFO(("ADDPD_VpdWpd: required SSE2, use --enable-sse option")); BX_INFO(("ADDPD_VpdWpd: required SSE2, use --enable-sse option"));
exception(BX_UD_EXCEPTION, 0, 0); exception(BX_UD_EXCEPTION, 0, 0);
@ -1544,7 +1530,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::ADDSD_VsdWsd(bxInstruction_c *i)
op1 = float64_add(op1, op2, status_word); op1 = float64_add(op1, op2, status_word);
BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags); BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags);
BX_WRITE_XMM_REG_LO_QWORD(i->nnn(), op1); BX_WRITE_XMM_REG_LO_QWORD(i->nnn(), op1);
#else #else
BX_INFO(("ADDSD_VsdWsd: required SSE2, use --enable-sse option")); BX_INFO(("ADDSD_VsdWsd: required SSE2, use --enable-sse option"));
exception(BX_UD_EXCEPTION, 0, 0); exception(BX_UD_EXCEPTION, 0, 0);
@ -1585,7 +1570,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::ADDSS_VssWss(bxInstruction_c *i)
op1 = float32_add(op1, op2, status_word); op1 = float32_add(op1, op2, status_word);
BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags); BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags);
BX_WRITE_XMM_REG_LO_DWORD(i->nnn(), op1); BX_WRITE_XMM_REG_LO_DWORD(i->nnn(), op1);
#else #else
BX_INFO(("ADDSS_VssWss: required SSE, use --enable-sse option")); BX_INFO(("ADDSS_VssWss: required SSE, use --enable-sse option"));
exception(BX_UD_EXCEPTION, 0, 0); exception(BX_UD_EXCEPTION, 0, 0);
@ -1636,7 +1620,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MULPS_VpsWps(bxInstruction_c *i)
BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags); BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags);
BX_WRITE_XMM_REG(i->nnn(), op1); BX_WRITE_XMM_REG(i->nnn(), op1);
#else #else
BX_INFO(("MULPS_VpsWps: required SSE, use --enable-sse option")); BX_INFO(("MULPS_VpsWps: required SSE, use --enable-sse option"));
exception(BX_UD_EXCEPTION, 0, 0); exception(BX_UD_EXCEPTION, 0, 0);
@ -1681,7 +1664,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MULPD_VpdWpd(bxInstruction_c *i)
BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags); BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags);
BX_WRITE_XMM_REG(i->nnn(), op1); BX_WRITE_XMM_REG(i->nnn(), op1);
#else #else
BX_INFO(("MULPD_VpdWpd: required SSE2, use --enable-sse option")); BX_INFO(("MULPD_VpdWpd: required SSE2, use --enable-sse option"));
exception(BX_UD_EXCEPTION, 0, 0); exception(BX_UD_EXCEPTION, 0, 0);
@ -1722,7 +1704,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MULSD_VsdWsd(bxInstruction_c *i)
op1 = float64_mul(op1, op2, status_word); op1 = float64_mul(op1, op2, status_word);
BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags); BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags);
BX_WRITE_XMM_REG_LO_QWORD(i->nnn(), op1); BX_WRITE_XMM_REG_LO_QWORD(i->nnn(), op1);
#else #else
BX_INFO(("MULSD_VsdWsd: required SSE2, use --enable-sse option")); BX_INFO(("MULSD_VsdWsd: required SSE2, use --enable-sse option"));
exception(BX_UD_EXCEPTION, 0, 0); exception(BX_UD_EXCEPTION, 0, 0);
@ -1763,7 +1744,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MULSS_VssWss(bxInstruction_c *i)
op1 = float32_mul(op1, op2, status_word); op1 = float32_mul(op1, op2, status_word);
BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags); BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags);
BX_WRITE_XMM_REG_LO_DWORD(i->nnn(), op1); BX_WRITE_XMM_REG_LO_DWORD(i->nnn(), op1);
#else #else
BX_INFO(("MULSS_VssWss: required SSE, use --enable-sse option")); BX_INFO(("MULSS_VssWss: required SSE, use --enable-sse option"));
exception(BX_UD_EXCEPTION, 0, 0); exception(BX_UD_EXCEPTION, 0, 0);
@ -1814,7 +1794,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::SUBPS_VpsWps(bxInstruction_c *i)
BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags); BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags);
BX_WRITE_XMM_REG(i->nnn(), op1); BX_WRITE_XMM_REG(i->nnn(), op1);
#else #else
BX_INFO(("SUBPS_VpsWps: required SSE, use --enable-sse option")); BX_INFO(("SUBPS_VpsWps: required SSE, use --enable-sse option"));
exception(BX_UD_EXCEPTION, 0, 0); exception(BX_UD_EXCEPTION, 0, 0);
@ -1859,7 +1838,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::SUBPD_VpdWpd(bxInstruction_c *i)
BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags); BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags);
BX_WRITE_XMM_REG(i->nnn(), op1); BX_WRITE_XMM_REG(i->nnn(), op1);
#else #else
BX_INFO(("SUBPD_VpdWpd: required SSE2, use --enable-sse option")); BX_INFO(("SUBPD_VpdWpd: required SSE2, use --enable-sse option"));
exception(BX_UD_EXCEPTION, 0, 0); exception(BX_UD_EXCEPTION, 0, 0);
@ -1900,7 +1878,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::SUBSD_VsdWsd(bxInstruction_c *i)
op1 = float64_sub(op1, op2, status_word); op1 = float64_sub(op1, op2, status_word);
BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags); BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags);
BX_WRITE_XMM_REG_LO_QWORD(i->nnn(), op1); BX_WRITE_XMM_REG_LO_QWORD(i->nnn(), op1);
#else #else
BX_INFO(("SUBSD_VsdWsd: required SSE2, use --enable-sse option")); BX_INFO(("SUBSD_VsdWsd: required SSE2, use --enable-sse option"));
exception(BX_UD_EXCEPTION, 0, 0); exception(BX_UD_EXCEPTION, 0, 0);
@ -1941,7 +1918,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::SUBSS_VssWss(bxInstruction_c *i)
op1 = float32_sub(op1, op2, status_word); op1 = float32_sub(op1, op2, status_word);
BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags); BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags);
BX_WRITE_XMM_REG_LO_DWORD(i->nnn(), op1); BX_WRITE_XMM_REG_LO_DWORD(i->nnn(), op1);
#else #else
BX_INFO(("SUBSS_VssWss: required SSE, use --enable-sse option")); BX_INFO(("SUBSS_VssWss: required SSE, use --enable-sse option"));
exception(BX_UD_EXCEPTION, 0, 0); exception(BX_UD_EXCEPTION, 0, 0);
@ -1997,7 +1973,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MINPS_VpsWps(bxInstruction_c *i)
BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags); BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags);
BX_WRITE_XMM_REG(i->nnn(), op1); BX_WRITE_XMM_REG(i->nnn(), op1);
#else #else
BX_INFO(("MINPS_VpsWps: required SSE, use --enable-sse option")); BX_INFO(("MINPS_VpsWps: required SSE, use --enable-sse option"));
exception(BX_UD_EXCEPTION, 0, 0); exception(BX_UD_EXCEPTION, 0, 0);
@ -2045,7 +2020,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MINPD_VpdWpd(bxInstruction_c *i)
BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags); BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags);
BX_WRITE_XMM_REG(i->nnn(), op1); BX_WRITE_XMM_REG(i->nnn(), op1);
#else #else
BX_INFO(("MINPD_VpdWpd: required SSE2, use --enable-sse option")); BX_INFO(("MINPD_VpdWpd: required SSE2, use --enable-sse option"));
exception(BX_UD_EXCEPTION, 0, 0); exception(BX_UD_EXCEPTION, 0, 0);
@ -2087,7 +2061,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MINSD_VsdWsd(bxInstruction_c *i)
BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags); BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags);
BX_WRITE_XMM_REG_LO_QWORD(i->nnn(), BX_WRITE_XMM_REG_LO_QWORD(i->nnn(),
(rc == float_relation_less) ? op1 : op2); (rc == float_relation_less) ? op1 : op2);
#else #else
BX_INFO(("MINSD_VsdWsd: required SSE2, use --enable-sse option")); BX_INFO(("MINSD_VsdWsd: required SSE2, use --enable-sse option"));
exception(BX_UD_EXCEPTION, 0, 0); exception(BX_UD_EXCEPTION, 0, 0);
@ -2129,7 +2102,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MINSS_VssWss(bxInstruction_c *i)
BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags); BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags);
BX_WRITE_XMM_REG_LO_DWORD(i->nnn(), BX_WRITE_XMM_REG_LO_DWORD(i->nnn(),
(rc == float_relation_less) ? op1 : op2); (rc == float_relation_less) ? op1 : op2);
#else #else
BX_INFO(("MINSS_VssWss: required SSE, use --enable-sse option")); BX_INFO(("MINSS_VssWss: required SSE, use --enable-sse option"));
exception(BX_UD_EXCEPTION, 0, 0); exception(BX_UD_EXCEPTION, 0, 0);
@ -2180,7 +2152,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::DIVPS_VpsWps(bxInstruction_c *i)
BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags); BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags);
BX_WRITE_XMM_REG(i->nnn(), op1); BX_WRITE_XMM_REG(i->nnn(), op1);
#else #else
BX_INFO(("DIVPS_VpsWps: required SSE, use --enable-sse option")); BX_INFO(("DIVPS_VpsWps: required SSE, use --enable-sse option"));
exception(BX_UD_EXCEPTION, 0, 0); exception(BX_UD_EXCEPTION, 0, 0);
@ -2225,7 +2196,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::DIVPD_VpdWpd(bxInstruction_c *i)
BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags); BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags);
BX_WRITE_XMM_REG(i->nnn(), op1); BX_WRITE_XMM_REG(i->nnn(), op1);
#else #else
BX_INFO(("DIVPD_VpdWpd: required SSE2, use --enable-sse option")); BX_INFO(("DIVPD_VpdWpd: required SSE2, use --enable-sse option"));
exception(BX_UD_EXCEPTION, 0, 0); exception(BX_UD_EXCEPTION, 0, 0);
@ -2266,7 +2236,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::DIVSD_VsdWsd(bxInstruction_c *i)
op1 = float64_div(op1, op2, status_word); op1 = float64_div(op1, op2, status_word);
BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags); BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags);
BX_WRITE_XMM_REG_LO_QWORD(i->nnn(), op1); BX_WRITE_XMM_REG_LO_QWORD(i->nnn(), op1);
#else #else
BX_INFO(("DIVSD_VsdWsd: required SSE2, use --enable-sse option")); BX_INFO(("DIVSD_VsdWsd: required SSE2, use --enable-sse option"));
exception(BX_UD_EXCEPTION, 0, 0); exception(BX_UD_EXCEPTION, 0, 0);
@ -2307,7 +2276,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::DIVSS_VssWss(bxInstruction_c *i)
op1 = float32_div(op1, op2, status_word); op1 = float32_div(op1, op2, status_word);
BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags); BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags);
BX_WRITE_XMM_REG_LO_DWORD(i->nnn(), op1); BX_WRITE_XMM_REG_LO_DWORD(i->nnn(), op1);
#else #else
BX_INFO(("DIVSS_VssWss: required SSE, use --enable-sse option")); BX_INFO(("DIVSS_VssWss: required SSE, use --enable-sse option"));
exception(BX_UD_EXCEPTION, 0, 0); exception(BX_UD_EXCEPTION, 0, 0);
@ -2363,7 +2331,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MAXPS_VpsWps(bxInstruction_c *i)
BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags); BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags);
BX_WRITE_XMM_REG(i->nnn(), op1); BX_WRITE_XMM_REG(i->nnn(), op1);
#else #else
BX_INFO(("MAXPS_VpsWps: required SSE, use --enable-sse option")); BX_INFO(("MAXPS_VpsWps: required SSE, use --enable-sse option"));
exception(BX_UD_EXCEPTION, 0, 0); exception(BX_UD_EXCEPTION, 0, 0);
@ -2411,7 +2378,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MAXPD_VpdWpd(bxInstruction_c *i)
BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags); BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags);
BX_WRITE_XMM_REG(i->nnn(), op1); BX_WRITE_XMM_REG(i->nnn(), op1);
#else #else
BX_INFO(("MAXPD_VpdWpd: required SSE2, use --enable-sse option")); BX_INFO(("MAXPD_VpdWpd: required SSE2, use --enable-sse option"));
exception(BX_UD_EXCEPTION, 0, 0); exception(BX_UD_EXCEPTION, 0, 0);
@ -2453,7 +2419,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MAXSD_VsdWsd(bxInstruction_c *i)
BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags); BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags);
BX_WRITE_XMM_REG_LO_QWORD(i->nnn(), BX_WRITE_XMM_REG_LO_QWORD(i->nnn(),
(rc == float_relation_greater) ? op1 : op2); (rc == float_relation_greater) ? op1 : op2);
#else #else
BX_INFO(("MAXSD_VsdWsd: required SSE2, use --enable-sse option")); BX_INFO(("MAXSD_VsdWsd: required SSE2, use --enable-sse option"));
exception(BX_UD_EXCEPTION, 0, 0); exception(BX_UD_EXCEPTION, 0, 0);
@ -2495,7 +2460,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::MAXSS_VssWss(bxInstruction_c *i)
BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags); BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags);
BX_WRITE_XMM_REG_LO_DWORD(i->nnn(), BX_WRITE_XMM_REG_LO_DWORD(i->nnn(),
(rc == float_relation_greater) ? op1 : op2); (rc == float_relation_greater) ? op1 : op2);
#else #else
BX_INFO(("MAXSS_VssWss: required SSE, use --enable-sse option")); BX_INFO(("MAXSS_VssWss: required SSE, use --enable-sse option"));
exception(BX_UD_EXCEPTION, 0, 0); exception(BX_UD_EXCEPTION, 0, 0);
@ -2540,7 +2504,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::HADDPD_VpdWpd(bxInstruction_c *i)
BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags); BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags);
BX_WRITE_XMM_REG(i->nnn(), op1); BX_WRITE_XMM_REG(i->nnn(), op1);
#else #else
BX_INFO(("HADDPD_VpdWpd: required SSE3, use --enable-sse option")); BX_INFO(("HADDPD_VpdWpd: required SSE3, use --enable-sse option"));
exception(BX_UD_EXCEPTION, 0, 0); exception(BX_UD_EXCEPTION, 0, 0);
@ -2591,7 +2554,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::HADDPS_VpsWps(bxInstruction_c *i)
BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags); BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags);
BX_WRITE_XMM_REG(i->nnn(), op1); BX_WRITE_XMM_REG(i->nnn(), op1);
#else #else
BX_INFO(("HADDPS_VpsWps: required SSE3, use --enable-sse option")); BX_INFO(("HADDPS_VpsWps: required SSE3, use --enable-sse option"));
exception(BX_UD_EXCEPTION, 0, 0); exception(BX_UD_EXCEPTION, 0, 0);
@ -2636,7 +2598,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::HSUBPD_VpdWpd(bxInstruction_c *i)
BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags); BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags);
BX_WRITE_XMM_REG(i->nnn(), op1); BX_WRITE_XMM_REG(i->nnn(), op1);
#else #else
BX_INFO(("HSUBPD_VpdWpd: required SSE3, use --enable-sse option")); BX_INFO(("HSUBPD_VpdWpd: required SSE3, use --enable-sse option"));
exception(BX_UD_EXCEPTION, 0, 0); exception(BX_UD_EXCEPTION, 0, 0);
@ -2687,7 +2648,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::HSUBPS_VpsWps(bxInstruction_c *i)
BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags); BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags);
BX_WRITE_XMM_REG(i->nnn(), op1); BX_WRITE_XMM_REG(i->nnn(), op1);
#else #else
BX_INFO(("HSUBPS_VpsWps: required SSE3, use --enable-sse option")); BX_INFO(("HSUBPS_VpsWps: required SSE3, use --enable-sse option"));
exception(BX_UD_EXCEPTION, 0, 0); exception(BX_UD_EXCEPTION, 0, 0);
@ -2765,7 +2725,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMPPS_VpsWpsIb(bxInstruction_c *i)
BX_CPU_THIS_PTR check_exceptionsSSE(status.float_exception_flags); BX_CPU_THIS_PTR check_exceptionsSSE(status.float_exception_flags);
BX_WRITE_XMM_REG(i->nnn(), op1); BX_WRITE_XMM_REG(i->nnn(), op1);
#else #else
BX_INFO(("CMPPS_VpsWpsIb: required SSE, use --enable-sse option")); BX_INFO(("CMPPS_VpsWpsIb: required SSE, use --enable-sse option"));
exception(BX_UD_EXCEPTION, 0, 0); exception(BX_UD_EXCEPTION, 0, 0);
@ -2831,7 +2790,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::CMPPD_VpdWpdIb(bxInstruction_c *i)
BX_CPU_THIS_PTR check_exceptionsSSE(status.float_exception_flags); BX_CPU_THIS_PTR check_exceptionsSSE(status.float_exception_flags);
BX_WRITE_XMM_REG(i->nnn(), op1); BX_WRITE_XMM_REG(i->nnn(), op1);
#else #else
BX_INFO(("CMPPD_VpdWpdIb: required SSE2, use --enable-sse option")); BX_INFO(("CMPPD_VpdWpdIb: required SSE2, use --enable-sse option"));
exception(BX_UD_EXCEPTION, 0, 0); exception(BX_UD_EXCEPTION, 0, 0);
@ -2996,7 +2954,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::ADDSUBPD_VpdWpd(bxInstruction_c *i)
BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags); BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags);
BX_WRITE_XMM_REG(i->nnn(), op1); BX_WRITE_XMM_REG(i->nnn(), op1);
#else #else
BX_INFO(("ADDSUBPD_VpdWpd: required SSE3, use --enable-sse option")); BX_INFO(("ADDSUBPD_VpdWpd: required SSE3, use --enable-sse option"));
exception(BX_UD_EXCEPTION, 0, 0); exception(BX_UD_EXCEPTION, 0, 0);
@ -3047,7 +3004,6 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::ADDSUBPS_VpsWps(bxInstruction_c *i)
BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags); BX_CPU_THIS_PTR check_exceptionsSSE(status_word.float_exception_flags);
BX_WRITE_XMM_REG(i->nnn(), op1); BX_WRITE_XMM_REG(i->nnn(), op1);
#else #else
BX_INFO(("ADDSUBPS_VpsWps: required SSE3, use --enable-sse option")); BX_INFO(("ADDSUBPS_VpsWps: required SSE3, use --enable-sse option"));
exception(BX_UD_EXCEPTION, 0, 0); exception(BX_UD_EXCEPTION, 0, 0);

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// $Id: fpu.cc,v 1.51 2009-02-08 17:29:34 sshwarts Exp $ // $Id: fpu.cc,v 1.52 2009-03-10 21:43:11 sshwarts Exp $
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// //
// Copyright (c) 2003 Stanislav Shwartsman // Copyright (c) 2003 Stanislav Shwartsman

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// $Id: fpu_arith.cc,v 1.16 2009-02-08 17:29:34 sshwarts Exp $ // $Id: fpu_arith.cc,v 1.17 2009-03-10 21:43:11 sshwarts Exp $
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// //
// Copyright (c) 2003 Stanislav Shwartsman // Copyright (c) 2003 Stanislav Shwartsman
@ -81,9 +81,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FADD_ST0_STj(bxInstruction_c *i)
floatx80 result = floatx80_add(a, b, status); floatx80 result = floatx80_add(a, b, status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
return;
BX_WRITE_FPU_REG(result, 0); BX_WRITE_FPU_REG(result, 0);
#else #else
BX_INFO(("FADD_ST0_STj: required FPU, configure --enable-fpu")); BX_INFO(("FADD_ST0_STj: required FPU, configure --enable-fpu"));
@ -113,12 +111,11 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FADD_STi_ST0(bxInstruction_c *i)
floatx80 result = floatx80_add(a, b, status); floatx80 result = floatx80_add(a, b, status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) {
return;
BX_WRITE_FPU_REG(result, i->rm()); BX_WRITE_FPU_REG(result, i->rm());
if (pop_stack) if (pop_stack)
BX_CPU_THIS_PTR the_i387.FPU_pop(); BX_CPU_THIS_PTR the_i387.FPU_pop();
}
#else #else
BX_INFO(("FADD(P)_STi_ST0: required FPU, configure --enable-fpu")); BX_INFO(("FADD(P)_STi_ST0: required FPU, configure --enable-fpu"));
#endif #endif
@ -144,9 +141,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FADD_SINGLE_REAL(bxInstruction_c *i)
floatx80 result = floatx80_add(BX_READ_FPU_REG(0), floatx80 result = floatx80_add(BX_READ_FPU_REG(0),
float32_to_floatx80(load_reg, status), status); float32_to_floatx80(load_reg, status), status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
return;
BX_WRITE_FPU_REG(result, 0); BX_WRITE_FPU_REG(result, 0);
#else #else
BX_INFO(("FADD_SINGLE_REAL: required FPU, configure --enable-fpu")); BX_INFO(("FADD_SINGLE_REAL: required FPU, configure --enable-fpu"));
@ -173,9 +168,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FADD_DOUBLE_REAL(bxInstruction_c *i)
floatx80 result = floatx80_add(BX_READ_FPU_REG(0), floatx80 result = floatx80_add(BX_READ_FPU_REG(0),
float64_to_floatx80(load_reg, status), status); float64_to_floatx80(load_reg, status), status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
return;
BX_WRITE_FPU_REG(result, 0); BX_WRITE_FPU_REG(result, 0);
#else #else
BX_INFO(("FADD_DOUBLE_REAL: required FPU, configure --enable-fpu")); BX_INFO(("FADD_DOUBLE_REAL: required FPU, configure --enable-fpu"));
@ -204,9 +197,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FIADD_WORD_INTEGER(bxInstruction_c *i)
floatx80 result = floatx80_add(a, b, status); floatx80 result = floatx80_add(a, b, status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
return;
BX_WRITE_FPU_REG(result, 0); BX_WRITE_FPU_REG(result, 0);
#else #else
BX_INFO(("FIADD_WORD_INTEGER: required FPU, configure --enable-fpu")); BX_INFO(("FIADD_WORD_INTEGER: required FPU, configure --enable-fpu"));
@ -235,9 +226,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FIADD_DWORD_INTEGER(bxInstruction_c *i)
floatx80 result = floatx80_add(a, b, status); floatx80 result = floatx80_add(a, b, status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
return;
BX_WRITE_FPU_REG(result, 0); BX_WRITE_FPU_REG(result, 0);
#else #else
BX_INFO(("FIADD_DWORD_INTEGER: required FPU, configure --enable-fpu")); BX_INFO(("FIADD_DWORD_INTEGER: required FPU, configure --enable-fpu"));
@ -265,9 +254,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FMUL_ST0_STj(bxInstruction_c *i)
floatx80 result = floatx80_mul(a, b, status); floatx80 result = floatx80_mul(a, b, status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
return;
BX_WRITE_FPU_REG(result, 0); BX_WRITE_FPU_REG(result, 0);
#else #else
BX_INFO(("FMUL_ST0_STj: required FPU, configure --enable-fpu")); BX_INFO(("FMUL_ST0_STj: required FPU, configure --enable-fpu"));
@ -297,12 +284,11 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FMUL_STi_ST0(bxInstruction_c *i)
floatx80 result = floatx80_mul(a, b, status); floatx80 result = floatx80_mul(a, b, status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) {
return;
BX_WRITE_FPU_REG(result, i->rm()); BX_WRITE_FPU_REG(result, i->rm());
if (pop_stack) if (pop_stack)
BX_CPU_THIS_PTR the_i387.FPU_pop(); BX_CPU_THIS_PTR the_i387.FPU_pop();
}
#else #else
BX_INFO(("FMUL(P)_STi_ST0: required FPU, configure --enable-fpu")); BX_INFO(("FMUL(P)_STi_ST0: required FPU, configure --enable-fpu"));
#endif #endif
@ -328,9 +314,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FMUL_SINGLE_REAL(bxInstruction_c *i)
floatx80 result = floatx80_mul(BX_READ_FPU_REG(0), floatx80 result = floatx80_mul(BX_READ_FPU_REG(0),
float32_to_floatx80(load_reg, status), status); float32_to_floatx80(load_reg, status), status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
return;
BX_WRITE_FPU_REG(result, 0); BX_WRITE_FPU_REG(result, 0);
#else #else
BX_INFO(("FMUL_SINGLE_REAL: required FPU, configure --enable-fpu")); BX_INFO(("FMUL_SINGLE_REAL: required FPU, configure --enable-fpu"));
@ -357,9 +341,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FMUL_DOUBLE_REAL(bxInstruction_c *i)
floatx80 result = floatx80_mul(BX_READ_FPU_REG(0), floatx80 result = floatx80_mul(BX_READ_FPU_REG(0),
float64_to_floatx80(load_reg, status), status); float64_to_floatx80(load_reg, status), status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
return;
BX_WRITE_FPU_REG(result, 0); BX_WRITE_FPU_REG(result, 0);
#else #else
BX_INFO(("FMUL_DOUBLE_REAL: required FPU, configure --enable-fpu")); BX_INFO(("FMUL_DOUBLE_REAL: required FPU, configure --enable-fpu"));
@ -388,9 +370,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FIMUL_WORD_INTEGER(bxInstruction_c *i)
floatx80 result = floatx80_mul(a, b, status); floatx80 result = floatx80_mul(a, b, status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
return;
BX_WRITE_FPU_REG(result, 0); BX_WRITE_FPU_REG(result, 0);
#else #else
BX_INFO(("FIMUL_WORD_INTEGER: required FPU, configure --enable-fpu")); BX_INFO(("FIMUL_WORD_INTEGER: required FPU, configure --enable-fpu"));
@ -419,9 +399,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FIMUL_DWORD_INTEGER(bxInstruction_c *i)
floatx80 result = floatx80_mul(a, b, status); floatx80 result = floatx80_mul(a, b, status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
return;
BX_WRITE_FPU_REG(result, 0); BX_WRITE_FPU_REG(result, 0);
#else #else
BX_INFO(("FIMUL_DWORD_INTEGER: required FPU, configure --enable-fpu")); BX_INFO(("FIMUL_DWORD_INTEGER: required FPU, configure --enable-fpu"));
@ -449,9 +427,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FSUB_ST0_STj(bxInstruction_c *i)
floatx80 result = floatx80_sub(a, b, status); floatx80 result = floatx80_sub(a, b, status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
return;
BX_WRITE_FPU_REG(result, 0); BX_WRITE_FPU_REG(result, 0);
#else #else
BX_INFO(("FSUB_ST0_STj: required FPU, configure --enable-fpu")); BX_INFO(("FSUB_ST0_STj: required FPU, configure --enable-fpu"));
@ -479,9 +455,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FSUBR_ST0_STj(bxInstruction_c *i)
floatx80 result = floatx80_sub(a, b, status); floatx80 result = floatx80_sub(a, b, status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
return;
BX_WRITE_FPU_REG(result, 0); BX_WRITE_FPU_REG(result, 0);
#else #else
BX_INFO(("FSUBR_ST0_STj: required FPU, configure --enable-fpu")); BX_INFO(("FSUBR_ST0_STj: required FPU, configure --enable-fpu"));
@ -511,13 +485,11 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FSUB_STi_ST0(bxInstruction_c *i)
floatx80 result = floatx80_sub(a, b, status); floatx80 result = floatx80_sub(a, b, status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) {
return;
BX_WRITE_FPU_REG(result, i->rm()); BX_WRITE_FPU_REG(result, i->rm());
if (pop_stack) if (pop_stack)
BX_CPU_THIS_PTR the_i387.FPU_pop(); BX_CPU_THIS_PTR the_i387.FPU_pop();
}
#else #else
BX_INFO(("FSUB(P)_STi_ST0: required FPU, configure --enable-fpu")); BX_INFO(("FSUB(P)_STi_ST0: required FPU, configure --enable-fpu"));
#endif #endif
@ -546,13 +518,11 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FSUBR_STi_ST0(bxInstruction_c *i)
floatx80 result = floatx80_sub(a, b, status); floatx80 result = floatx80_sub(a, b, status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) {
return;
BX_WRITE_FPU_REG(result, i->rm()); BX_WRITE_FPU_REG(result, i->rm());
if (pop_stack) if (pop_stack)
BX_CPU_THIS_PTR the_i387.FPU_pop(); BX_CPU_THIS_PTR the_i387.FPU_pop();
}
#else #else
BX_INFO(("FSUBR(P)_STi_ST0: required FPU, configure --enable-fpu")); BX_INFO(("FSUBR(P)_STi_ST0: required FPU, configure --enable-fpu"));
#endif #endif
@ -578,9 +548,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FSUB_SINGLE_REAL(bxInstruction_c *i)
floatx80 result = floatx80_sub(BX_READ_FPU_REG(0), floatx80 result = floatx80_sub(BX_READ_FPU_REG(0),
float32_to_floatx80(load_reg, status), status); float32_to_floatx80(load_reg, status), status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
return;
BX_WRITE_FPU_REG(result, 0); BX_WRITE_FPU_REG(result, 0);
#else #else
BX_INFO(("FSUB_SINGLE_REAL: required FPU, configure --enable-fpu")); BX_INFO(("FSUB_SINGLE_REAL: required FPU, configure --enable-fpu"));
@ -607,9 +575,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FSUBR_SINGLE_REAL(bxInstruction_c *i)
floatx80 result = floatx80_sub(float32_to_floatx80(load_reg, status), floatx80 result = floatx80_sub(float32_to_floatx80(load_reg, status),
BX_READ_FPU_REG(0), status); BX_READ_FPU_REG(0), status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
return;
BX_WRITE_FPU_REG(result, 0); BX_WRITE_FPU_REG(result, 0);
#else #else
BX_INFO(("FSUBR_SINGLE_REAL: required FPU, configure --enable-fpu")); BX_INFO(("FSUBR_SINGLE_REAL: required FPU, configure --enable-fpu"));
@ -636,9 +602,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FSUB_DOUBLE_REAL(bxInstruction_c *i)
floatx80 result = floatx80_sub(BX_READ_FPU_REG(0), floatx80 result = floatx80_sub(BX_READ_FPU_REG(0),
float64_to_floatx80(load_reg, status), status); float64_to_floatx80(load_reg, status), status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
return;
BX_WRITE_FPU_REG(result, 0); BX_WRITE_FPU_REG(result, 0);
#else #else
BX_INFO(("FSUB_DOUBLE_REAL: required FPU, configure --enable-fpu")); BX_INFO(("FSUB_DOUBLE_REAL: required FPU, configure --enable-fpu"));
@ -665,9 +629,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FSUBR_DOUBLE_REAL(bxInstruction_c *i)
floatx80 result = floatx80_sub(float64_to_floatx80(load_reg, status), floatx80 result = floatx80_sub(float64_to_floatx80(load_reg, status),
BX_READ_FPU_REG(0), status); BX_READ_FPU_REG(0), status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
return;
BX_WRITE_FPU_REG(result, 0); BX_WRITE_FPU_REG(result, 0);
#else #else
BX_INFO(("FSUBR_DOUBLE_REAL: required FPU, configure --enable-fpu")); BX_INFO(("FSUBR_DOUBLE_REAL: required FPU, configure --enable-fpu"));
@ -696,9 +658,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FISUB_WORD_INTEGER(bxInstruction_c *i)
floatx80 result = floatx80_sub(a, b, status); floatx80 result = floatx80_sub(a, b, status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
return;
BX_WRITE_FPU_REG(result, 0); BX_WRITE_FPU_REG(result, 0);
#else #else
BX_INFO(("FISUB_WORD_INTEGER: required FPU, configure --enable-fpu")); BX_INFO(("FISUB_WORD_INTEGER: required FPU, configure --enable-fpu"));
@ -727,9 +687,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FISUBR_WORD_INTEGER(bxInstruction_c *i)
floatx80 result = floatx80_sub(a, b, status); floatx80 result = floatx80_sub(a, b, status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
return;
BX_WRITE_FPU_REG(result, 0); BX_WRITE_FPU_REG(result, 0);
#else #else
BX_INFO(("FISUBR_WORD_INTEGER: required FPU, configure --enable-fpu")); BX_INFO(("FISUBR_WORD_INTEGER: required FPU, configure --enable-fpu"));
@ -759,9 +717,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FISUB_DWORD_INTEGER(bxInstruction_c *i)
floatx80 result = floatx80_sub(BX_READ_FPU_REG(0), floatx80 result = floatx80_sub(BX_READ_FPU_REG(0),
int32_to_floatx80(load_reg), status); int32_to_floatx80(load_reg), status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
return;
BX_WRITE_FPU_REG(result, 0); BX_WRITE_FPU_REG(result, 0);
#else #else
BX_INFO(("FISUB_DWORD_INTEGER: required FPU, configure --enable-fpu")); BX_INFO(("FISUB_DWORD_INTEGER: required FPU, configure --enable-fpu"));
@ -790,9 +746,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FISUBR_DWORD_INTEGER(bxInstruction_c *i)
floatx80 result = floatx80_sub(a, b, status); floatx80 result = floatx80_sub(a, b, status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
return;
BX_WRITE_FPU_REG(result, 0); BX_WRITE_FPU_REG(result, 0);
#else #else
BX_INFO(("FISUBR_DWORD_INTEGER: required FPU, configure --enable-fpu")); BX_INFO(("FISUBR_DWORD_INTEGER: required FPU, configure --enable-fpu"));
@ -820,9 +774,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FDIV_ST0_STj(bxInstruction_c *i)
floatx80 result = floatx80_div(a, b, status); floatx80 result = floatx80_div(a, b, status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
return;
BX_WRITE_FPU_REG(result, 0); BX_WRITE_FPU_REG(result, 0);
#else #else
BX_INFO(("FDIV_ST0_STj: required FPU, configure --enable-fpu")); BX_INFO(("FDIV_ST0_STj: required FPU, configure --enable-fpu"));
@ -850,9 +802,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FDIVR_ST0_STj(bxInstruction_c *i)
floatx80 result = floatx80_div(a, b, status); floatx80 result = floatx80_div(a, b, status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
return;
BX_WRITE_FPU_REG(result, 0); BX_WRITE_FPU_REG(result, 0);
#else #else
BX_INFO(("FDIVR_ST0_STj: required FPU, configure --enable-fpu")); BX_INFO(("FDIVR_ST0_STj: required FPU, configure --enable-fpu"));
@ -882,12 +832,11 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FDIV_STi_ST0(bxInstruction_c *i)
floatx80 result = floatx80_div(a, b, status); floatx80 result = floatx80_div(a, b, status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) {
return;
BX_WRITE_FPU_REG(result, i->rm()); BX_WRITE_FPU_REG(result, i->rm());
if (pop_stack) if (pop_stack)
BX_CPU_THIS_PTR the_i387.FPU_pop(); BX_CPU_THIS_PTR the_i387.FPU_pop();
}
#else #else
BX_INFO(("FDIV(P)_STi_ST0: required FPU, configure --enable-fpu")); BX_INFO(("FDIV(P)_STi_ST0: required FPU, configure --enable-fpu"));
#endif #endif
@ -916,12 +865,11 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FDIVR_STi_ST0(bxInstruction_c *i)
floatx80 result = floatx80_div(a, b, status); floatx80 result = floatx80_div(a, b, status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) {
return;
BX_WRITE_FPU_REG(result, i->rm()); BX_WRITE_FPU_REG(result, i->rm());
if (pop_stack) if (pop_stack)
BX_CPU_THIS_PTR the_i387.FPU_pop(); BX_CPU_THIS_PTR the_i387.FPU_pop();
}
#else #else
BX_INFO(("FDIVR(P)_STi_ST0: required FPU, configure --enable-fpu")); BX_INFO(("FDIVR(P)_STi_ST0: required FPU, configure --enable-fpu"));
#endif #endif
@ -947,9 +895,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FDIV_SINGLE_REAL(bxInstruction_c *i)
floatx80 result = floatx80_div(BX_READ_FPU_REG(0), floatx80 result = floatx80_div(BX_READ_FPU_REG(0),
float32_to_floatx80(load_reg, status), status); float32_to_floatx80(load_reg, status), status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
return;
BX_WRITE_FPU_REG(result, 0); BX_WRITE_FPU_REG(result, 0);
#else #else
BX_INFO(("FDIV_SINGLE_REAL: required FPU, configure --enable-fpu")); BX_INFO(("FDIV_SINGLE_REAL: required FPU, configure --enable-fpu"));
@ -976,9 +922,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FDIVR_SINGLE_REAL(bxInstruction_c *i)
floatx80 result = floatx80_div(float32_to_floatx80(load_reg, status), floatx80 result = floatx80_div(float32_to_floatx80(load_reg, status),
BX_READ_FPU_REG(0), status); BX_READ_FPU_REG(0), status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
return;
BX_WRITE_FPU_REG(result, 0); BX_WRITE_FPU_REG(result, 0);
#else #else
BX_INFO(("FDIVR_SINGLE_REAL: required FPU, configure --enable-fpu")); BX_INFO(("FDIVR_SINGLE_REAL: required FPU, configure --enable-fpu"));
@ -1005,9 +949,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FDIV_DOUBLE_REAL(bxInstruction_c *i)
floatx80 result = floatx80_div(BX_READ_FPU_REG(0), floatx80 result = floatx80_div(BX_READ_FPU_REG(0),
float64_to_floatx80(load_reg, status), status); float64_to_floatx80(load_reg, status), status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
return;
BX_WRITE_FPU_REG(result, 0); BX_WRITE_FPU_REG(result, 0);
#else #else
BX_INFO(("FDIV_DOUBLE_REAL: required FPU, configure --enable-fpu")); BX_INFO(("FDIV_DOUBLE_REAL: required FPU, configure --enable-fpu"));
@ -1034,9 +976,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FDIVR_DOUBLE_REAL(bxInstruction_c *i)
floatx80 result = floatx80_div(float64_to_floatx80(load_reg, status), floatx80 result = floatx80_div(float64_to_floatx80(load_reg, status),
BX_READ_FPU_REG(0), status); BX_READ_FPU_REG(0), status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
return;
BX_WRITE_FPU_REG(result, 0); BX_WRITE_FPU_REG(result, 0);
#else #else
BX_INFO(("FDIVR_DOUBLE_REAL: required FPU, configure --enable-fpu")); BX_INFO(("FDIVR_DOUBLE_REAL: required FPU, configure --enable-fpu"));
@ -1065,9 +1005,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FIDIV_WORD_INTEGER(bxInstruction_c *i)
floatx80 result = floatx80_div(a, b, status); floatx80 result = floatx80_div(a, b, status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
return;
BX_WRITE_FPU_REG(result, 0); BX_WRITE_FPU_REG(result, 0);
#else #else
BX_INFO(("FIDIV_WORD_INTEGER: required FPU, configure --enable-fpu")); BX_INFO(("FIDIV_WORD_INTEGER: required FPU, configure --enable-fpu"));
@ -1096,9 +1034,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FIDIVR_WORD_INTEGER(bxInstruction_c *i)
floatx80 result = floatx80_div(a, b, status); floatx80 result = floatx80_div(a, b, status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
return;
BX_WRITE_FPU_REG(result, 0); BX_WRITE_FPU_REG(result, 0);
#else #else
BX_INFO(("FIDIVR_WORD_INTEGER: required FPU, configure --enable-fpu")); BX_INFO(("FIDIVR_WORD_INTEGER: required FPU, configure --enable-fpu"));
@ -1127,9 +1063,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FIDIV_DWORD_INTEGER(bxInstruction_c *i)
floatx80 result = floatx80_div(a, b, status); floatx80 result = floatx80_div(a, b, status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
return;
BX_WRITE_FPU_REG(result, 0); BX_WRITE_FPU_REG(result, 0);
#else #else
BX_INFO(("FIDIV_DWORD_INTEGER: required FPU, configure --enable-fpu")); BX_INFO(("FIDIV_DWORD_INTEGER: required FPU, configure --enable-fpu"));
@ -1158,9 +1092,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FIDIVR_DWORD_INTEGER(bxInstruction_c *i)
floatx80 result = floatx80_div(a, b, status); floatx80 result = floatx80_div(a, b, status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
return;
BX_WRITE_FPU_REG(result, 0); BX_WRITE_FPU_REG(result, 0);
#else #else
BX_INFO(("FIDIVR_DWORD_INTEGER: required FPU, configure --enable-fpu")); BX_INFO(("FIDIVR_DWORD_INTEGER: required FPU, configure --enable-fpu"));
@ -1184,9 +1116,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FSQRT(bxInstruction_c *i)
floatx80 result = floatx80_sqrt(BX_READ_FPU_REG(0), status); floatx80 result = floatx80_sqrt(BX_READ_FPU_REG(0), status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
return;
BX_WRITE_FPU_REG(result, 0); BX_WRITE_FPU_REG(result, 0);
#else #else
BX_INFO(("FSQRT: required FPU, configure --enable-fpu")); BX_INFO(("FSQRT: required FPU, configure --enable-fpu"));
@ -1211,9 +1141,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FRNDINT(bxInstruction_c *i)
floatx80 result = floatx80_round_to_int(BX_READ_FPU_REG(0), status); floatx80 result = floatx80_round_to_int(BX_READ_FPU_REG(0), status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
return;
BX_WRITE_FPU_REG(result, 0); BX_WRITE_FPU_REG(result, 0);
#else #else
BX_INFO(("FRNDINT: required FPU, configure --enable-fpu")); BX_INFO(("FRNDINT: required FPU, configure --enable-fpu"));

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// $Id: fpu_compare.cc,v 1.20 2009-02-08 17:29:34 sshwarts Exp $ // $Id: fpu_compare.cc,v 1.21 2009-03-10 21:43:11 sshwarts Exp $
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// //
// Copyright (c) 2003 Stanislav Shwartsman // Copyright (c) 2003 Stanislav Shwartsman
@ -108,13 +108,11 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FCOM_STi(bxInstruction_c *i)
int rc = floatx80_compare(BX_READ_FPU_REG(0), BX_READ_FPU_REG(i->rm()), status); int rc = floatx80_compare(BX_READ_FPU_REG(0), BX_READ_FPU_REG(i->rm()), status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) {
return;
setcc(status_word_flags_fpu_compare(rc)); setcc(status_word_flags_fpu_compare(rc));
if (pop_stack) if (pop_stack)
BX_CPU_THIS_PTR the_i387.FPU_pop(); BX_CPU_THIS_PTR the_i387.FPU_pop();
}
#else #else
BX_INFO(("FCOM(P)_STi: required FPU, configure --enable-fpu")); BX_INFO(("FCOM(P)_STi: required FPU, configure --enable-fpu"));
#endif #endif
@ -148,13 +146,11 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FCOMI_ST0_STj(bxInstruction_c *i)
int rc = floatx80_compare(BX_READ_FPU_REG(0), BX_READ_FPU_REG(i->rm()), status); int rc = floatx80_compare(BX_READ_FPU_REG(0), BX_READ_FPU_REG(i->rm()), status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) {
return;
BX_CPU_THIS_PTR write_eflags_fpu_compare(rc); BX_CPU_THIS_PTR write_eflags_fpu_compare(rc);
if (pop_stack) if (pop_stack)
BX_CPU_THIS_PTR the_i387.FPU_pop(); BX_CPU_THIS_PTR the_i387.FPU_pop();
}
#else #else
BX_INFO(("FCOMI(P)_ST0_STj: required P6 FPU, configure --enable-fpu, cpu-level=6")); BX_INFO(("FCOMI(P)_ST0_STj: required P6 FPU, configure --enable-fpu, cpu-level=6"));
exception(BX_UD_EXCEPTION, 0, 0); exception(BX_UD_EXCEPTION, 0, 0);
@ -189,13 +185,11 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FUCOMI_ST0_STj(bxInstruction_c *i)
int rc = floatx80_compare_quiet(BX_READ_FPU_REG(0), BX_READ_FPU_REG(i->rm()), status); int rc = floatx80_compare_quiet(BX_READ_FPU_REG(0), BX_READ_FPU_REG(i->rm()), status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) {
return;
BX_CPU_THIS_PTR write_eflags_fpu_compare(rc); BX_CPU_THIS_PTR write_eflags_fpu_compare(rc);
if (pop_stack) if (pop_stack)
BX_CPU_THIS_PTR the_i387.FPU_pop(); BX_CPU_THIS_PTR the_i387.FPU_pop();
}
#else #else
BX_INFO(("FUCOMI(P)_ST0_STj: required P6 FPU, configure --enable-fpu, cpu-level=6")); BX_INFO(("FUCOMI(P)_ST0_STj: required P6 FPU, configure --enable-fpu, cpu-level=6"));
exception(BX_UD_EXCEPTION, 0, 0); exception(BX_UD_EXCEPTION, 0, 0);
@ -228,13 +222,11 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FUCOM_STi(bxInstruction_c *i)
int rc = floatx80_compare_quiet(BX_READ_FPU_REG(0), BX_READ_FPU_REG(i->rm()), status); int rc = floatx80_compare_quiet(BX_READ_FPU_REG(0), BX_READ_FPU_REG(i->rm()), status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) {
return;
setcc(status_word_flags_fpu_compare(rc)); setcc(status_word_flags_fpu_compare(rc));
if (pop_stack) if (pop_stack)
BX_CPU_THIS_PTR the_i387.FPU_pop(); BX_CPU_THIS_PTR the_i387.FPU_pop();
}
#else #else
BX_INFO(("FUCOM(P)_STi: required FPU, configure --enable-fpu")); BX_INFO(("FUCOM(P)_STi: required FPU, configure --enable-fpu"));
#endif #endif
@ -271,13 +263,11 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FCOM_SINGLE_REAL(bxInstruction_c *i)
int rc = floatx80_compare(BX_READ_FPU_REG(0), int rc = floatx80_compare(BX_READ_FPU_REG(0),
float32_to_floatx80(load_reg, status), status); float32_to_floatx80(load_reg, status), status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) {
return;
setcc(status_word_flags_fpu_compare(rc)); setcc(status_word_flags_fpu_compare(rc));
if (pop_stack) if (pop_stack)
BX_CPU_THIS_PTR the_i387.FPU_pop(); BX_CPU_THIS_PTR the_i387.FPU_pop();
}
#else #else
BX_INFO(("FCOM(P)_SINGLE_REAL: required FPU, configure --enable-fpu")); BX_INFO(("FCOM(P)_SINGLE_REAL: required FPU, configure --enable-fpu"));
#endif #endif
@ -314,13 +304,11 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FCOM_DOUBLE_REAL(bxInstruction_c *i)
int rc = floatx80_compare(BX_READ_FPU_REG(0), int rc = floatx80_compare(BX_READ_FPU_REG(0),
float64_to_floatx80(load_reg, status), status); float64_to_floatx80(load_reg, status), status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) {
return;
setcc(status_word_flags_fpu_compare(rc)); setcc(status_word_flags_fpu_compare(rc));
if (pop_stack) if (pop_stack)
BX_CPU_THIS_PTR the_i387.FPU_pop(); BX_CPU_THIS_PTR the_i387.FPU_pop();
}
#else #else
BX_INFO(("FCOM(P)_DOUBLE_REAL: required FPU, configure --enable-fpu")); BX_INFO(("FCOM(P)_DOUBLE_REAL: required FPU, configure --enable-fpu"));
#endif #endif
@ -357,13 +345,11 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FICOM_WORD_INTEGER(bxInstruction_c *i)
int rc = floatx80_compare(BX_READ_FPU_REG(0), int rc = floatx80_compare(BX_READ_FPU_REG(0),
int32_to_floatx80((Bit32s)(load_reg)), status); int32_to_floatx80((Bit32s)(load_reg)), status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) {
return;
setcc(status_word_flags_fpu_compare(rc)); setcc(status_word_flags_fpu_compare(rc));
if (pop_stack) if (pop_stack)
BX_CPU_THIS_PTR the_i387.FPU_pop(); BX_CPU_THIS_PTR the_i387.FPU_pop();
}
#else #else
BX_INFO(("FICOM(P)_WORD_INTEGER: required FPU, configure --enable-fpu")); BX_INFO(("FICOM(P)_WORD_INTEGER: required FPU, configure --enable-fpu"));
#endif #endif
@ -397,16 +383,13 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FICOM_DWORD_INTEGER(bxInstruction_c *i)
float_status_t status = float_status_t status =
FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word()); FPU_pre_exception_handling(BX_CPU_THIS_PTR the_i387.get_control_word());
int rc = floatx80_compare(BX_READ_FPU_REG(0), int rc = floatx80_compare(BX_READ_FPU_REG(0), int32_to_floatx80(load_reg), status);
int32_to_floatx80(load_reg), status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
return;
if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) {
setcc(status_word_flags_fpu_compare(rc)); setcc(status_word_flags_fpu_compare(rc));
if (pop_stack) if (pop_stack)
BX_CPU_THIS_PTR the_i387.FPU_pop(); BX_CPU_THIS_PTR the_i387.FPU_pop();
}
#else #else
BX_INFO(("FICOM(P)_DWORD_INTEGER: required FPU, configure --enable-fpu")); BX_INFO(("FICOM(P)_DWORD_INTEGER: required FPU, configure --enable-fpu"));
#endif #endif
@ -440,13 +423,11 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FCOMPP(bxInstruction_c *i)
int rc = floatx80_compare(BX_READ_FPU_REG(0), BX_READ_FPU_REG(1), status); int rc = floatx80_compare(BX_READ_FPU_REG(0), BX_READ_FPU_REG(1), status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) {
return;
setcc(status_word_flags_fpu_compare(rc)); setcc(status_word_flags_fpu_compare(rc));
BX_CPU_THIS_PTR the_i387.FPU_pop(); BX_CPU_THIS_PTR the_i387.FPU_pop();
BX_CPU_THIS_PTR the_i387.FPU_pop(); BX_CPU_THIS_PTR the_i387.FPU_pop();
}
#else #else
BX_INFO(("FCOMPP: required FPU, configure --enable-fpu")); BX_INFO(("FCOMPP: required FPU, configure --enable-fpu"));
#endif #endif
@ -478,13 +459,11 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FUCOMPP(bxInstruction_c *i)
int rc = floatx80_compare_quiet(BX_READ_FPU_REG(0), BX_READ_FPU_REG(1), status); int rc = floatx80_compare_quiet(BX_READ_FPU_REG(0), BX_READ_FPU_REG(1), status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) {
return;
setcc(status_word_flags_fpu_compare(rc)); setcc(status_word_flags_fpu_compare(rc));
BX_CPU_THIS_PTR the_i387.FPU_pop(); BX_CPU_THIS_PTR the_i387.FPU_pop();
BX_CPU_THIS_PTR the_i387.FPU_pop(); BX_CPU_THIS_PTR the_i387.FPU_pop();
}
#else #else
BX_INFO(("FUCOMPP: required FPU, configure --enable-fpu")); BX_INFO(("FUCOMPP: required FPU, configure --enable-fpu"));
#endif #endif
@ -552,9 +531,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FTST(bxInstruction_c *i)
int rc = floatx80_compare(BX_READ_FPU_REG(0), Const_Z, status); int rc = floatx80_compare(BX_READ_FPU_REG(0), Const_Z, status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
return;
setcc(status_word_flags_fpu_compare(rc)); setcc(status_word_flags_fpu_compare(rc));
#else #else
BX_INFO(("FTST: required FPU, configure --enable-fpu")); BX_INFO(("FTST: required FPU, configure --enable-fpu"));

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// $Id: fpu_const.cc,v 1.14 2009-02-08 17:29:34 sshwarts Exp $ // $Id: fpu_const.cc,v 1.15 2009-03-10 21:43:11 sshwarts Exp $
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// //
// Copyright (c) 2003 Stanislav Shwartsman // Copyright (c) 2003 Stanislav Shwartsman
@ -62,11 +62,11 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FLDL2T(bxInstruction_c *i)
if (! IS_TAG_EMPTY(-1)) if (! IS_TAG_EMPTY(-1))
{ {
BX_CPU_THIS_PTR FPU_stack_overflow(); BX_CPU_THIS_PTR FPU_stack_overflow();
return;
} }
else {
BX_CPU_THIS_PTR the_i387.FPU_push(); BX_CPU_THIS_PTR the_i387.FPU_push();
BX_WRITE_FPU_REG(FPU_round_const(Const_L2T, (FPU_CONTROL_WORD == FPU_RC_UP) ? 1 : 0), 0); BX_WRITE_FPU_REG(FPU_round_const(Const_L2T, (FPU_CONTROL_WORD == FPU_RC_UP) ? 1 : 0), 0);
}
#else #else
BX_INFO(("FLDL2T: required FPU, configure --enable-fpu")); BX_INFO(("FLDL2T: required FPU, configure --enable-fpu"));
#endif #endif
@ -82,11 +82,11 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FLDL2E(bxInstruction_c *i)
if (! IS_TAG_EMPTY(-1)) if (! IS_TAG_EMPTY(-1))
{ {
BX_CPU_THIS_PTR FPU_stack_overflow(); BX_CPU_THIS_PTR FPU_stack_overflow();
return;
} }
else {
BX_CPU_THIS_PTR the_i387.FPU_push(); BX_CPU_THIS_PTR the_i387.FPU_push();
BX_WRITE_FPU_REG(FPU_round_const(Const_L2E, DOWN_OR_CHOP() ? -1 : 0), 0); BX_WRITE_FPU_REG(FPU_round_const(Const_L2E, DOWN_OR_CHOP() ? -1 : 0), 0);
}
#else #else
BX_INFO(("FLDL2E: required FPU, configure --enable-fpu")); BX_INFO(("FLDL2E: required FPU, configure --enable-fpu"));
#endif #endif
@ -102,11 +102,11 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FLDPI(bxInstruction_c *i)
if (! IS_TAG_EMPTY(-1)) if (! IS_TAG_EMPTY(-1))
{ {
BX_CPU_THIS_PTR FPU_stack_overflow(); BX_CPU_THIS_PTR FPU_stack_overflow();
return;
} }
else {
BX_CPU_THIS_PTR the_i387.FPU_push(); BX_CPU_THIS_PTR the_i387.FPU_push();
BX_WRITE_FPU_REG(FPU_round_const(Const_PI, DOWN_OR_CHOP() ? -1 : 0), 0); BX_WRITE_FPU_REG(FPU_round_const(Const_PI, DOWN_OR_CHOP() ? -1 : 0), 0);
}
#else #else
BX_INFO(("FLDPI: required FPU, configure --enable-fpu")); BX_INFO(("FLDPI: required FPU, configure --enable-fpu"));
#endif #endif
@ -122,11 +122,11 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FLDLG2(bxInstruction_c *i)
if (! IS_TAG_EMPTY(-1)) if (! IS_TAG_EMPTY(-1))
{ {
BX_CPU_THIS_PTR FPU_stack_overflow(); BX_CPU_THIS_PTR FPU_stack_overflow();
return;
} }
else {
BX_CPU_THIS_PTR the_i387.FPU_push(); BX_CPU_THIS_PTR the_i387.FPU_push();
BX_WRITE_FPU_REG(FPU_round_const(Const_LG2, DOWN_OR_CHOP() ? -1 : 0), 0); BX_WRITE_FPU_REG(FPU_round_const(Const_LG2, DOWN_OR_CHOP() ? -1 : 0), 0);
}
#else #else
BX_INFO(("FLDLG2: required FPU, configure --enable-fpu")); BX_INFO(("FLDLG2: required FPU, configure --enable-fpu"));
#endif #endif
@ -142,11 +142,11 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FLDLN2(bxInstruction_c *i)
if (! IS_TAG_EMPTY(-1)) if (! IS_TAG_EMPTY(-1))
{ {
BX_CPU_THIS_PTR FPU_stack_overflow(); BX_CPU_THIS_PTR FPU_stack_overflow();
return;
} }
else {
BX_CPU_THIS_PTR the_i387.FPU_push(); BX_CPU_THIS_PTR the_i387.FPU_push();
BX_WRITE_FPU_REG(FPU_round_const(Const_LN2, DOWN_OR_CHOP() ? -1 : 0), 0); BX_WRITE_FPU_REG(FPU_round_const(Const_LN2, DOWN_OR_CHOP() ? -1 : 0), 0);
}
#else #else
BX_INFO(("FLDLN2: required FPU, configure --enable-fpu")); BX_INFO(("FLDLN2: required FPU, configure --enable-fpu"));
#endif #endif
@ -162,11 +162,11 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FLD1(bxInstruction_c *i)
if (! IS_TAG_EMPTY(-1)) if (! IS_TAG_EMPTY(-1))
{ {
BX_CPU_THIS_PTR FPU_stack_overflow(); BX_CPU_THIS_PTR FPU_stack_overflow();
return;
} }
else {
BX_CPU_THIS_PTR the_i387.FPU_push(); BX_CPU_THIS_PTR the_i387.FPU_push();
BX_WRITE_FPU_REG(Const_1, 0); BX_WRITE_FPU_REG(Const_1, 0);
}
#else #else
BX_INFO(("FLD1: required FPU, configure --enable-fpu")); BX_INFO(("FLD1: required FPU, configure --enable-fpu"));
#endif #endif
@ -182,11 +182,11 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FLDZ(bxInstruction_c *i)
if (! IS_TAG_EMPTY(-1)) if (! IS_TAG_EMPTY(-1))
{ {
BX_CPU_THIS_PTR FPU_stack_overflow(); BX_CPU_THIS_PTR FPU_stack_overflow();
return;
} }
else {
BX_CPU_THIS_PTR the_i387.FPU_push(); BX_CPU_THIS_PTR the_i387.FPU_push();
BX_WRITE_FPU_REG(Const_Z, 0); BX_WRITE_FPU_REG(Const_Z, 0);
}
#else #else
BX_INFO(("FLDZ: required FPU, configure --enable-fpu")); BX_INFO(("FLDZ: required FPU, configure --enable-fpu"));
#endif #endif

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// $Id: fpu_load_store.cc,v 1.31 2009-02-08 17:29:34 sshwarts Exp $ // $Id: fpu_load_store.cc,v 1.32 2009-03-10 21:43:11 sshwarts Exp $
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// //
// Copyright (c) 2003 Stanislav Shwartsman // Copyright (c) 2003 Stanislav Shwartsman
@ -85,11 +85,10 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FLD_SINGLE_REAL(bxInstruction_c *i)
// convert to floatx80 format // convert to floatx80 format
floatx80 result = float32_to_floatx80(load_reg, status); floatx80 result = float32_to_floatx80(load_reg, status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) {
return;
BX_CPU_THIS_PTR the_i387.FPU_push(); BX_CPU_THIS_PTR the_i387.FPU_push();
BX_WRITE_FPU_REG(result, 0); BX_WRITE_FPU_REG(result, 0);
}
#else #else
BX_INFO(("FLD_SINGLE_REAL: required FPU, configure --enable-fpu")); BX_INFO(("FLD_SINGLE_REAL: required FPU, configure --enable-fpu"));
#endif #endif
@ -115,11 +114,10 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FLD_DOUBLE_REAL(bxInstruction_c *i)
// convert to floatx80 format // convert to floatx80 format
floatx80 result = float64_to_floatx80(load_reg, status); floatx80 result = float64_to_floatx80(load_reg, status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) {
return;
BX_CPU_THIS_PTR the_i387.FPU_push(); BX_CPU_THIS_PTR the_i387.FPU_push();
BX_WRITE_FPU_REG(result, 0); BX_WRITE_FPU_REG(result, 0);
}
#else #else
BX_INFO(("FLD_DOUBLE_REAL: required FPU, configure --enable-fpu")); BX_INFO(("FLD_DOUBLE_REAL: required FPU, configure --enable-fpu"));
#endif #endif
@ -138,12 +136,11 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FLD_EXTENDED_REAL(bxInstruction_c *i)
if (! IS_TAG_EMPTY(-1)) { if (! IS_TAG_EMPTY(-1)) {
BX_CPU_THIS_PTR FPU_stack_overflow(); BX_CPU_THIS_PTR FPU_stack_overflow();
return;
} }
else {
BX_CPU_THIS_PTR the_i387.FPU_push(); BX_CPU_THIS_PTR the_i387.FPU_push();
BX_WRITE_FPU_REG(result, 0); BX_WRITE_FPU_REG(result, 0);
}
#else #else
BX_INFO(("FLD_EXTENDED_REAL: required FPU, configure --enable-fpu")); BX_INFO(("FLD_EXTENDED_REAL: required FPU, configure --enable-fpu"));
#endif #endif
@ -161,12 +158,12 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FILD_WORD_INTEGER(bxInstruction_c *i)
if (! IS_TAG_EMPTY(-1)) { if (! IS_TAG_EMPTY(-1)) {
BX_CPU_THIS_PTR FPU_stack_overflow(); BX_CPU_THIS_PTR FPU_stack_overflow();
return;
} }
else {
floatx80 result = int32_to_floatx80((Bit32s) load_reg); floatx80 result = int32_to_floatx80((Bit32s) load_reg);
BX_CPU_THIS_PTR the_i387.FPU_push(); BX_CPU_THIS_PTR the_i387.FPU_push();
BX_WRITE_FPU_REG(result, 0); BX_WRITE_FPU_REG(result, 0);
}
#else #else
BX_INFO(("FILD_WORD_INTEGER: required FPU, configure --enable-fpu")); BX_INFO(("FILD_WORD_INTEGER: required FPU, configure --enable-fpu"));
#endif #endif
@ -184,12 +181,12 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FILD_DWORD_INTEGER(bxInstruction_c *i)
if (! IS_TAG_EMPTY(-1)) { if (! IS_TAG_EMPTY(-1)) {
BX_CPU_THIS_PTR FPU_stack_overflow(); BX_CPU_THIS_PTR FPU_stack_overflow();
return;
} }
else {
floatx80 result = int32_to_floatx80(load_reg); floatx80 result = int32_to_floatx80(load_reg);
BX_CPU_THIS_PTR the_i387.FPU_push(); BX_CPU_THIS_PTR the_i387.FPU_push();
BX_WRITE_FPU_REG(result, 0); BX_WRITE_FPU_REG(result, 0);
}
#else #else
BX_INFO(("FILD_DWORD_INTEGER: required FPU, configure --enable-fpu")); BX_INFO(("FILD_DWORD_INTEGER: required FPU, configure --enable-fpu"));
#endif #endif
@ -207,12 +204,12 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FILD_QWORD_INTEGER(bxInstruction_c *i)
if (! IS_TAG_EMPTY(-1)) { if (! IS_TAG_EMPTY(-1)) {
BX_CPU_THIS_PTR FPU_stack_overflow(); BX_CPU_THIS_PTR FPU_stack_overflow();
return;
} }
else {
floatx80 result = int64_to_floatx80(load_reg); floatx80 result = int64_to_floatx80(load_reg);
BX_CPU_THIS_PTR the_i387.FPU_push(); BX_CPU_THIS_PTR the_i387.FPU_push();
BX_WRITE_FPU_REG(result, 0); BX_WRITE_FPU_REG(result, 0);
}
#else #else
BX_INFO(("FILD_QWORD_INTEGER: required FPU, configure --enable-fpu")); BX_INFO(("FILD_QWORD_INTEGER: required FPU, configure --enable-fpu"));
#endif #endif
@ -275,14 +272,14 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FST_STi(bxInstruction_c *i)
if (IS_TAG_EMPTY(0)) { if (IS_TAG_EMPTY(0)) {
BX_CPU_THIS_PTR FPU_stack_underflow(i->rm(), pop_stack); BX_CPU_THIS_PTR FPU_stack_underflow(i->rm(), pop_stack);
return;
} }
else {
floatx80 st0_reg = BX_READ_FPU_REG(0); floatx80 st0_reg = BX_READ_FPU_REG(0);
BX_WRITE_FPU_REG(st0_reg, i->rm()); BX_WRITE_FPU_REG(st0_reg, i->rm());
if (pop_stack) if (pop_stack)
BX_CPU_THIS_PTR the_i387.FPU_pop(); BX_CPU_THIS_PTR the_i387.FPU_pop();
}
#else #else
BX_INFO(("FST(P)_STi: required FPU, configure --enable-fpu")); BX_INFO(("FST(P)_STi: required FPU, configure --enable-fpu"));
#endif #endif

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// $Id: fpu_misc.cc,v 1.16 2009-02-08 17:29:34 sshwarts Exp $ // $Id: fpu_misc.cc,v 1.17 2009-03-10 21:43:11 sshwarts Exp $
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// //
// Copyright (c) 2003 Stanislav Shwartsman // Copyright (c) 2003 Stanislav Shwartsman
@ -75,13 +75,12 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FCHS(bxInstruction_c *i)
if (IS_TAG_EMPTY(0)) { if (IS_TAG_EMPTY(0)) {
BX_CPU_THIS_PTR FPU_stack_underflow(0); BX_CPU_THIS_PTR FPU_stack_underflow(0);
return;
} }
else {
clear_C1(); clear_C1();
floatx80 st0_reg = BX_READ_FPU_REG(0); floatx80 st0_reg = BX_READ_FPU_REG(0);
BX_WRITE_FPU_REG(floatx80_chs(st0_reg), 0); BX_WRITE_FPU_REG(floatx80_chs(st0_reg), 0);
}
#else #else
BX_INFO(("FCHS: required FPU, configure --enable-fpu")); BX_INFO(("FCHS: required FPU, configure --enable-fpu"));
#endif #endif
@ -95,13 +94,12 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FABS(bxInstruction_c *i)
if (IS_TAG_EMPTY(0)) { if (IS_TAG_EMPTY(0)) {
BX_CPU_THIS_PTR FPU_stack_underflow(0); BX_CPU_THIS_PTR FPU_stack_underflow(0);
return;
} }
else {
clear_C1(); clear_C1();
floatx80 st0_reg = BX_READ_FPU_REG(0); floatx80 st0_reg = BX_READ_FPU_REG(0);
BX_WRITE_FPU_REG(floatx80_abs(st0_reg), 0); BX_WRITE_FPU_REG(floatx80_abs(st0_reg), 0);
}
#else #else
BX_INFO(("FABS: required FPU, configure --enable-fpu")); BX_INFO(("FABS: required FPU, configure --enable-fpu"));
#endif #endif

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// $Id: fpu_tags.cc,v 1.9 2009-02-08 17:29:34 sshwarts Exp $ // $Id: fpu_tags.cc,v 1.10 2009-03-10 21:43:11 sshwarts Exp $
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// //
// Copyright (c) 2003 Stanislav Shwartsman // Copyright (c) 2003 Stanislav Shwartsman

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// $Id: fpu_trans.cc,v 1.20 2009-02-08 17:29:34 sshwarts Exp $ // $Id: fpu_trans.cc,v 1.21 2009-03-10 21:43:11 sshwarts Exp $
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// //
// Copyright (c) 2003 Stanislav Shwartsman // Copyright (c) 2003 Stanislav Shwartsman
@ -51,9 +51,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::F2XM1(bxInstruction_c *i)
floatx80 result = f2xm1(BX_READ_FPU_REG(0), status); floatx80 result = f2xm1(BX_READ_FPU_REG(0), status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
return;
BX_WRITE_FPU_REG(result, 0); BX_WRITE_FPU_REG(result, 0);
#else #else
BX_INFO(("F2XM1: required FPU, configure --enable-fpu")); BX_INFO(("F2XM1: required FPU, configure --enable-fpu"));
@ -79,11 +77,10 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FYL2X(bxInstruction_c *i)
floatx80 result = fyl2x(BX_READ_FPU_REG(0), BX_READ_FPU_REG(1), status); floatx80 result = fyl2x(BX_READ_FPU_REG(0), BX_READ_FPU_REG(1), status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) {
return;
BX_CPU_THIS_PTR the_i387.FPU_pop(); BX_CPU_THIS_PTR the_i387.FPU_pop();
BX_WRITE_FPU_REG(result, 0); BX_WRITE_FPU_REG(result, 0);
}
#else #else
BX_INFO(("FYL2X: required FPU, configure --enable-fpu")); BX_INFO(("FYL2X: required FPU, configure --enable-fpu"));
#endif #endif
@ -140,12 +137,11 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FPTAN(bxInstruction_c *i)
return; return;
} }
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) {
return;
BX_WRITE_FPU_REG(y, 0); BX_WRITE_FPU_REG(y, 0);
BX_CPU_THIS_PTR the_i387.FPU_push(); BX_CPU_THIS_PTR the_i387.FPU_push();
BX_WRITE_FPU_REG(Const_1, 0); BX_WRITE_FPU_REG(Const_1, 0);
}
#else #else
BX_INFO(("FPTAN: required FPU, configure --enable-fpu")); BX_INFO(("FPTAN: required FPU, configure --enable-fpu"));
#endif #endif
@ -170,11 +166,10 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FPATAN(bxInstruction_c *i)
floatx80 result = fpatan(BX_READ_FPU_REG(0), BX_READ_FPU_REG(1), status); floatx80 result = fpatan(BX_READ_FPU_REG(0), BX_READ_FPU_REG(1), status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) {
return;
BX_CPU_THIS_PTR the_i387.FPU_pop(); BX_CPU_THIS_PTR the_i387.FPU_pop();
BX_WRITE_FPU_REG(result, 0); BX_WRITE_FPU_REG(result, 0);
}
#else #else
BX_INFO(("FPATAN: required FPU, configure --enable-fpu")); BX_INFO(("FPATAN: required FPU, configure --enable-fpu"));
#endif #endif
@ -212,12 +207,11 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FXTRACT(bxInstruction_c *i)
floatx80 a = BX_READ_FPU_REG(0); floatx80 a = BX_READ_FPU_REG(0);
floatx80 b = floatx80_extract(a, status); floatx80 b = floatx80_extract(a, status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) {
return;
BX_WRITE_FPU_REG(b, 0); // exponent BX_WRITE_FPU_REG(b, 0); // exponent
BX_CPU_THIS_PTR the_i387.FPU_push(); BX_CPU_THIS_PTR the_i387.FPU_push();
BX_WRITE_FPU_REG(a, 0); // fraction BX_WRITE_FPU_REG(a, 0); // fraction
}
#else #else
BX_INFO(("FXTRACT: required FPU, configure --enable-fpu")); BX_INFO(("FXTRACT: required FPU, configure --enable-fpu"));
#endif #endif
@ -247,20 +241,17 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FPREM1(bxInstruction_c *i)
floatx80 result = floatx80_ieee754_remainder(a, b, quotient, status); floatx80 result = floatx80_ieee754_remainder(a, b, quotient, status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) {
return;
int cc = 0; int cc = 0;
if (quotient == (Bit64u) -1) cc = FPU_SW_C2; if (quotient == (Bit64u) -1) cc = FPU_SW_C2;
else else {
{
if (quotient & 1) cc |= FPU_SW_C1; if (quotient & 1) cc |= FPU_SW_C1;
if (quotient & 2) cc |= FPU_SW_C3; if (quotient & 2) cc |= FPU_SW_C3;
if (quotient & 4) cc |= FPU_SW_C0; if (quotient & 4) cc |= FPU_SW_C0;
} }
setcc(cc); setcc(cc);
BX_WRITE_FPU_REG(result, 0); BX_WRITE_FPU_REG(result, 0);
}
#else #else
BX_INFO(("FPREM1: required FPU, configure --enable-fpu")); BX_INFO(("FPREM1: required FPU, configure --enable-fpu"));
#endif #endif
@ -290,13 +281,10 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FPREM(bxInstruction_c *i)
floatx80 result = floatx80_remainder(a, b, quotient, status); floatx80 result = floatx80_remainder(a, b, quotient, status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) {
return;
int cc = 0; int cc = 0;
if (quotient == (Bit64u) -1) cc = FPU_SW_C2; if (quotient == (Bit64u) -1) cc = FPU_SW_C2;
else else {
{
if (quotient & 1) cc |= FPU_SW_C1; if (quotient & 1) cc |= FPU_SW_C1;
if (quotient & 2) cc |= FPU_SW_C3; if (quotient & 2) cc |= FPU_SW_C3;
if (quotient & 4) cc |= FPU_SW_C0; if (quotient & 4) cc |= FPU_SW_C0;
@ -304,6 +292,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FPREM(bxInstruction_c *i)
setcc(cc); setcc(cc);
BX_WRITE_FPU_REG(result, 0); BX_WRITE_FPU_REG(result, 0);
}
#else #else
BX_INFO(("FPREM: required FPU, configure --enable-fpu")); BX_INFO(("FPREM: required FPU, configure --enable-fpu"));
#endif #endif
@ -328,11 +317,10 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FYL2XP1(bxInstruction_c *i)
floatx80 result = fyl2xp1(BX_READ_FPU_REG(0), BX_READ_FPU_REG(1), status); floatx80 result = fyl2xp1(BX_READ_FPU_REG(0), BX_READ_FPU_REG(1), status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) {
return;
BX_CPU_THIS_PTR the_i387.FPU_pop(); BX_CPU_THIS_PTR the_i387.FPU_pop();
BX_WRITE_FPU_REG(result, 0); BX_WRITE_FPU_REG(result, 0);
}
#else #else
BX_INFO(("FYL2XP1: required FPU, configure --enable-fpu")); BX_INFO(("FYL2XP1: required FPU, configure --enable-fpu"));
#endif #endif
@ -376,12 +364,11 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FSINCOS(bxInstruction_c *i)
return; return;
} }
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) {
return;
BX_WRITE_FPU_REG(sin_y, 0); BX_WRITE_FPU_REG(sin_y, 0);
BX_CPU_THIS_PTR the_i387.FPU_push(); BX_CPU_THIS_PTR the_i387.FPU_push();
BX_WRITE_FPU_REG(cos_y, 0); BX_WRITE_FPU_REG(cos_y, 0);
}
#else #else
BX_INFO(("FSINCOS: required FPU, configure --enable-fpu")); BX_INFO(("FSINCOS: required FPU, configure --enable-fpu"));
#endif #endif
@ -406,9 +393,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FSCALE(bxInstruction_c *i)
floatx80 result = floatx80_scale(BX_READ_FPU_REG(0), BX_READ_FPU_REG(1), status); floatx80 result = floatx80_scale(BX_READ_FPU_REG(0), BX_READ_FPU_REG(1), status);
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
return;
BX_WRITE_FPU_REG(result, 0); BX_WRITE_FPU_REG(result, 0);
#else #else
BX_INFO(("FSCALE: required FPU, configure --enable-fpu")); BX_INFO(("FSCALE: required FPU, configure --enable-fpu"));
@ -439,9 +424,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FSIN(bxInstruction_c *i)
return; return;
} }
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
return;
BX_WRITE_FPU_REG(y, 0); BX_WRITE_FPU_REG(y, 0);
#else #else
BX_INFO(("FSIN: required FPU, configure --enable-fpu")); BX_INFO(("FSIN: required FPU, configure --enable-fpu"));
@ -472,9 +455,7 @@ void BX_CPP_AttrRegparmN(1) BX_CPU_C::FCOS(bxInstruction_c *i)
return; return;
} }
if (BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags)) if (! BX_CPU_THIS_PTR FPU_exception(status.float_exception_flags))
return;
BX_WRITE_FPU_REG(y, 0); BX_WRITE_FPU_REG(y, 0);
#else #else
BX_INFO(("FCOS: required FPU, configure --enable-fpu")); BX_INFO(("FCOS: required FPU, configure --enable-fpu"));