From: Aurelien Jarno <aurelien@aurel32.net>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [4168] Always enable precise emulation when softfloat is used
Date: Mon, 07 Apr 2008 21:00:51 +0000 [thread overview]
Message-ID: <E1JiySR-0003u3-JD@cvs.savannah.gnu.org> (raw)
Revision: 4168
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4168
Author: aurel32
Date: 2008-04-07 21:00:51 +0000 (Mon, 07 Apr 2008)
Log Message:
-----------
Always enable precise emulation when softfloat is used
The patch below changes the way to enable softfloat on the PPC target. It
is now enabled when softfloat is used. The rationale behind this change
is that persons who want precise emulation prefer precision over emulation
speed.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Modified Paths:
--------------
trunk/target-ppc/exec.h
trunk/target-ppc/op.c
trunk/target-ppc/op_helper.c
trunk/target-ppc/op_helper.h
Modified: trunk/target-ppc/exec.h
===================================================================
--- trunk/target-ppc/exec.h 2008-04-07 20:31:02 UTC (rev 4167)
+++ trunk/target-ppc/exec.h 2008-04-07 21:00:51 UTC (rev 4168)
@@ -27,10 +27,6 @@
#include "cpu.h"
#include "exec-all.h"
-/* For normal operations, precise emulation should not be needed */
-//#define USE_PRECISE_EMULATION 1
-#define USE_PRECISE_EMULATION 0
-
register struct CPUPPCState *env asm(AREG0);
#if TARGET_LONG_BITS > HOST_LONG_BITS
/* no registers can be used */
Modified: trunk/target-ppc/op.c
===================================================================
--- trunk/target-ppc/op.c 2008-04-07 20:31:02 UTC (rev 4167)
+++ trunk/target-ppc/op.c 2008-04-07 21:00:51 UTC (rev 4168)
@@ -1716,7 +1716,7 @@
/* fadd - fadd. */
void OPPROTO op_fadd (void)
{
-#if USE_PRECISE_EMULATION
+#ifdef CONFIG_SOFTFLOAT
do_fadd();
#else
FT0 = float64_add(FT0, FT1, &env->fp_status);
@@ -1727,7 +1727,7 @@
/* fsub - fsub. */
void OPPROTO op_fsub (void)
{
-#if USE_PRECISE_EMULATION
+#ifdef CONFIG_SOFTFLOAT
do_fsub();
#else
FT0 = float64_sub(FT0, FT1, &env->fp_status);
@@ -1738,7 +1738,7 @@
/* fmul - fmul. */
void OPPROTO op_fmul (void)
{
-#if USE_PRECISE_EMULATION
+#ifdef CONFIG_SOFTFLOAT
do_fmul();
#else
FT0 = float64_mul(FT0, FT1, &env->fp_status);
@@ -1749,7 +1749,7 @@
/* fdiv - fdiv. */
void OPPROTO op_fdiv (void)
{
-#if USE_PRECISE_EMULATION
+#ifdef CONFIG_SOFTFLOAT
do_fdiv();
#else
FT0 = float64_div(FT0, FT1, &env->fp_status);
@@ -1796,7 +1796,7 @@
/* fmadd - fmadd. */
void OPPROTO op_fmadd (void)
{
-#if USE_PRECISE_EMULATION
+#ifdef CONFIG_SOFTFLOAT
do_fmadd();
#else
FT0 = float64_mul(FT0, FT1, &env->fp_status);
@@ -1808,7 +1808,7 @@
/* fmsub - fmsub. */
void OPPROTO op_fmsub (void)
{
-#if USE_PRECISE_EMULATION
+#ifdef CONFIG_SOFTFLOAT
do_fmsub();
#else
FT0 = float64_mul(FT0, FT1, &env->fp_status);
@@ -1835,7 +1835,7 @@
/* frsp - frsp. */
void OPPROTO op_frsp (void)
{
-#if USE_PRECISE_EMULATION
+#ifdef CONFIG_SOFTFLOAT
do_frsp();
#else
FT0 = float64_to_float32(FT0, &env->fp_status);
Modified: trunk/target-ppc/op_helper.c
===================================================================
--- trunk/target-ppc/op_helper.c 2008-04-07 20:31:02 UTC (rev 4167)
+++ trunk/target-ppc/op_helper.c 2008-04-07 21:00:51 UTC (rev 4168)
@@ -922,7 +922,7 @@
}
#endif
-#if USE_PRECISE_EMULATION
+#ifdef CONFIG_SOFTFLOAT
void do_fadd (void)
{
if (unlikely(float64_is_signaling_nan(FT0) ||
@@ -989,7 +989,7 @@
FT0 = float64_div(FT0, FT1, &env->fp_status);
}
}
-#endif /* USE_PRECISE_EMULATION */
+#endif /* CONFIG_SOFTFLOAT */
void do_fctiw (void)
{
@@ -1003,7 +1003,7 @@
fload_invalid_op_excp(POWERPC_EXCP_FP_VXCVI);
} else {
p.ll = float64_to_int32(FT0, &env->fp_status);
-#if USE_PRECISE_EMULATION
+#ifdef CONFIG_SOFTFLOAT
/* XXX: higher bits are not supposed to be significant.
* to make tests easier, return the same as a real PowerPC 750
*/
@@ -1025,7 +1025,7 @@
fload_invalid_op_excp(POWERPC_EXCP_FP_VXCVI);
} else {
p.ll = float64_to_int32_round_to_zero(FT0, &env->fp_status);
-#if USE_PRECISE_EMULATION
+#ifdef CONFIG_SOFTFLOAT
/* XXX: higher bits are not supposed to be significant.
* to make tests easier, return the same as a real PowerPC 750
*/
@@ -1114,7 +1114,7 @@
do_fri(float_round_down);
}
-#if USE_PRECISE_EMULATION
+#ifdef CONFIG_SOFTFLOAT
void do_fmadd (void)
{
if (unlikely(float64_is_signaling_nan(FT0) ||
@@ -1164,7 +1164,7 @@
#endif
}
}
-#endif /* USE_PRECISE_EMULATION */
+#endif /* CONFIG_SOFTFLOAT */
void do_fnmadd (void)
{
@@ -1174,7 +1174,7 @@
/* sNaN operation */
fload_invalid_op_excp(POWERPC_EXCP_FP_VXSNAN);
} else {
-#if USE_PRECISE_EMULATION
+#ifdef CONFIG_SOFTFLOAT
#ifdef FLOAT128
/* This is the way the PowerPC specification defines it */
float128 ft0_128, ft1_128;
@@ -1206,7 +1206,7 @@
/* sNaN operation */
fload_invalid_op_excp(POWERPC_EXCP_FP_VXSNAN);
} else {
-#if USE_PRECISE_EMULATION
+#ifdef CONFIG_SOFTFLOAT
#ifdef FLOAT128
/* This is the way the PowerPC specification defines it */
float128 ft0_128, ft1_128;
@@ -1230,7 +1230,7 @@
}
}
-#if USE_PRECISE_EMULATION
+#ifdef CONFIG_SOFTFLOAT
void do_frsp (void)
{
if (unlikely(float64_is_signaling_nan(FT0))) {
@@ -1240,7 +1240,7 @@
FT0 = float64_to_float32(FT0, &env->fp_status);
}
}
-#endif /* USE_PRECISE_EMULATION */
+#endif /* CONFIG_SOFTFLOAT */
void do_fsqrt (void)
{
@@ -1295,7 +1295,7 @@
/* Zero reciprocal */
float_zero_divide_excp();
} else if (likely(isnormal(FT0))) {
-#if USE_PRECISE_EMULATION
+#ifdef CONFIG_SOFTFLOAT
FT0 = float64_div(1.0, FT0, &env->fp_status);
FT0 = float64_to_float32(FT0, &env->fp_status);
#else
Modified: trunk/target-ppc/op_helper.h
===================================================================
--- trunk/target-ppc/op_helper.h 2008-04-07 20:31:02 UTC (rev 4167)
+++ trunk/target-ppc/op_helper.h 2008-04-07 21:00:51 UTC (rev 4168)
@@ -98,7 +98,7 @@
#ifdef CONFIG_SOFTFLOAT
void do_float_check_status (void);
#endif
-#if USE_PRECISE_EMULATION
+#ifdef CONFIG_SOFTFLOAT
void do_fadd (void);
void do_fsub (void);
void do_fmul (void);
@@ -109,13 +109,13 @@
void do_fres (void);
void do_frsqrte (void);
void do_fsel (void);
-#if USE_PRECISE_EMULATION
+#ifdef CONFIG_SOFTFLOAT
void do_fmadd (void);
void do_fmsub (void);
#endif
void do_fnmadd (void);
void do_fnmsub (void);
-#if USE_PRECISE_EMULATION
+#ifdef CONFIG_SOFTFLOAT
void do_frsp (void);
#endif
void do_fctiw (void);
reply other threads:[~2008-04-07 21:00 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1JiySR-0003u3-JD@cvs.savannah.gnu.org \
--to=aurelien@aurel32.net \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).