From: Bryce Lanham <blanham@gmail.com>
To: qemu-devel@nongnu.org
Cc: Laurent Vivier <laurent@vivier.eu>
Subject: [Qemu-devel] [PATCH 090/111] m68k: correctly define and manage NaN
Date: Wed, 17 Aug 2011 15:53:21 -0500 [thread overview]
Message-ID: <1313614410-29359-1-git-send-email-blanham@gmail.com> (raw)
From: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
fpu/softfloat-specialize.h | 5 +++++
target-m68k/helper.c | 12 +++++-------
target-m68k/translate.c | 1 -
3 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/fpu/softfloat-specialize.h b/fpu/softfloat-specialize.h
index e051549..4a4863c 100644
--- a/fpu/softfloat-specialize.h
+++ b/fpu/softfloat-specialize.h
@@ -85,9 +85,14 @@ const float64 float64_default_nan = const_float64(LIT64( 0xFFF8000000000000 ));
#define floatx80_default_nan_high 0x7FFF
#define floatx80_default_nan_low LIT64( 0xBFFFFFFFFFFFFFFF )
#else
+#if defined(TARGET_M68K)
+#define floatx80_default_nan_high 0x7FFF
+#define floatx80_default_nan_low LIT64( 0xFFFFFFFFFFFFFFFF )
+#else
#define floatx80_default_nan_high 0xFFFF
#define floatx80_default_nan_low LIT64( 0xC000000000000000 )
#endif
+#endif
const floatx80 floatx80_default_nan = make_floatx80(floatx80_default_nan_high,
floatx80_default_nan_low);
diff --git a/target-m68k/helper.c b/target-m68k/helper.c
index 533f33b..4edbc90 100644
--- a/target-m68k/helper.c
+++ b/target-m68k/helper.c
@@ -23,7 +23,6 @@
#include "config.h"
#include "cpu.h"
-#include "exec.h"
#include "qemu-common.h"
#include "gdbstub.h"
@@ -272,13 +271,12 @@ void cpu_reset(CPUM68KState *env)
m68k_switch_sp(env);
for (i = 0; i < 8; i++) {
- env->fregs[i].l.upper = floatx80_default_nan_high;
- env->fregs[i].l.lower = 0xffffffffffffffffULL;
+ env->fregs[i].d = floatx80_default_nan;
}
- env->fp0h = floatx80_default_nan_high;
- env->fp0l = 0xffffffffffffffffULL;
- env->fp1h = floatx80_default_nan_high;
- env->fp1l = 0xffffffffffffffffULL;
+ env->fp0h = floatx80_default_nan.high;
+ env->fp0l = floatx80_default_nan.low;
+ env->fp1h = floatx80_default_nan.high;
+ env->fp1l = floatx80_default_nan.low;
env->cc_op = CC_OP_FLAGS;
/* TODO: We should set PC from the interrupt vector. */
diff --git a/target-m68k/translate.c b/target-m68k/translate.c
index 70eba1a..b749a76 100644
--- a/target-m68k/translate.c
+++ b/target-m68k/translate.c
@@ -25,7 +25,6 @@
#include "config.h"
#include "cpu.h"
-#include "exec.h"
#include "disas.h"
#include "tcg-op.h"
#include "qemu-log.h"
--
1.7.2.3
next reply other threads:[~2011-08-17 20:53 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-17 20:53 Bryce Lanham [this message]
2011-08-17 20:53 ` [Qemu-devel] [PATCH 091/111] m68k: don't call gdb_register_coprocessor() twice Bryce Lanham
2011-08-17 20:53 ` [Qemu-devel] [PATCH 092/111] m68k: gdb FP registers are 96 bits Bryce Lanham
2011-08-17 20:53 ` [Qemu-devel] [PATCH 093/111] m68k: add exg instruction Bryce Lanham
2011-08-17 20:53 ` [Qemu-devel] [PATCH 094/111] m68k: define floatx80_default_inf_high and floatx80_default_inf_low Bryce Lanham
2011-08-17 20:53 ` [Qemu-devel] [PATCH 095/111] m68k: add bkpt instruction Bryce Lanham
2011-08-17 20:53 ` [Qemu-devel] [PATCH 096/111] m68k: correctly convert floatx80<->long double Bryce Lanham
2011-08-17 20:53 ` [Qemu-devel] [PATCH 097/111] m68k: use expl() to compute exp_FP0() Bryce Lanham
2011-08-17 20:53 ` [Qemu-devel] [PATCH 098/111] m68k: use exp2l() to compute exp2_FP0() Bryce Lanham
2011-08-17 20:53 ` [Qemu-devel] [PATCH 099/111] m68k: use logl() to compute ln_FP0() Bryce Lanham
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=1313614410-29359-1-git-send-email-blanham@gmail.com \
--to=blanham@gmail.com \
--cc=laurent@vivier.eu \
--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).