All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Vivier <laurent@vivier.eu>
To: qemu-devel@nongnu.org
Cc: Aurelien Jarno <aurelien@aurel32.net>,
	Richard Henderson <rth@twiddle.net>,
	Laurent Vivier <laurent@vivier.eu>
Subject: [Qemu-devel] [PATCH v2 02/16] softloat: disable floatx80_invalid_encoding() for m68k
Date: Mon, 30 Jan 2017 19:16:20 +0100	[thread overview]
Message-ID: <20170130181634.13934-3-laurent@vivier.eu> (raw)
In-Reply-To: <20170130181634.13934-1-laurent@vivier.eu>

According to the comment, this definition of invalid encoding is given
by intel developer's manual, and doesn't work with the behavior
of 680x0 FPU.

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 fpu/softfloat.c         | 20 ++++++++++++++++++++
 include/fpu/softfloat.h | 15 ---------------
 2 files changed, 20 insertions(+), 15 deletions(-)

diff --git a/fpu/softfloat.c b/fpu/softfloat.c
index c295f31..3aa05c1 100644
--- a/fpu/softfloat.c
+++ b/fpu/softfloat.c
@@ -4799,6 +4799,26 @@ int float64_unordered_quiet(float64 a, float64 b, float_status *status)
 }
 
 /*----------------------------------------------------------------------------
+| Return whether the given value is an invalid floatx80 encoding.
+| Invalid floatx80 encodings arise when the integer bit is not set, but
+| the exponent is not zero. The only times the integer bit is permitted to
+| be zero is in subnormal numbers and the value zero.
+| This includes what the Intel software developer's manual calls pseudo-NaNs,
+| pseudo-infinities and un-normal numbers. It does not include
+| pseudo-denormals, which must still be correctly handled as inputs even
+| if they are never generated as outputs.
+*----------------------------------------------------------------------------*/
+static inline bool floatx80_invalid_encoding(floatx80 a)
+{
+#if defined(TARGET_M68K)
+    return 0;
+#else
+    return (a.low & (1ULL << 63)) == 0 && (a.high & 0x7FFF) != 0;
+#endif
+}
+
+
+/*----------------------------------------------------------------------------
 | Returns the result of converting the extended double-precision floating-
 | point value `a' to the 32-bit two's complement integer format.  The
 | conversion is performed according to the IEC/IEEE Standard for Binary
diff --git a/include/fpu/softfloat.h b/include/fpu/softfloat.h
index 14f8383..1bde349 100644
--- a/include/fpu/softfloat.h
+++ b/include/fpu/softfloat.h
@@ -658,21 +658,6 @@ static inline int floatx80_is_any_nan(floatx80 a)
     return ((a.high & 0x7fff) == 0x7fff) && (a.low<<1);
 }
 
-/*----------------------------------------------------------------------------
-| Return whether the given value is an invalid floatx80 encoding.
-| Invalid floatx80 encodings arise when the integer bit is not set, but
-| the exponent is not zero. The only times the integer bit is permitted to
-| be zero is in subnormal numbers and the value zero.
-| This includes what the Intel software developer's manual calls pseudo-NaNs,
-| pseudo-infinities and un-normal numbers. It does not include
-| pseudo-denormals, which must still be correctly handled as inputs even
-| if they are never generated as outputs.
-*----------------------------------------------------------------------------*/
-static inline bool floatx80_invalid_encoding(floatx80 a)
-{
-    return (a.low & (1ULL << 63)) == 0 && (a.high & 0x7FFF) != 0;
-}
-
 #define floatx80_zero make_floatx80(0x0000, 0x0000000000000000LL)
 #define floatx80_one make_floatx80(0x3fff, 0x8000000000000000LL)
 #define floatx80_ln2 make_floatx80(0x3ffe, 0xb17217f7d1cf79acLL)
-- 
2.9.3

  parent reply	other threads:[~2017-01-30 18:17 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-30 18:16 [Qemu-devel] [PATCH v2 00/16] target-m68k: implement 680x0 FPU Laurent Vivier
2017-01-30 18:16 ` [Qemu-devel] [PATCH v2 01/16] softfloat: define 680x0 specific values Laurent Vivier
2017-01-30 19:19   ` Peter Maydell
2017-01-30 18:16 ` Laurent Vivier [this message]
2017-01-30 19:15   ` [Qemu-devel] [PATCH v2 02/16] softloat: disable floatx80_invalid_encoding() for m68k Peter Maydell
2017-01-30 22:47     ` Andreas Schwab
2017-01-30 18:16 ` [Qemu-devel] [PATCH v2 03/16] target-m68k: move FPU helpers to fpu_helper.c Laurent Vivier
2017-01-30 18:16 ` [Qemu-devel] [PATCH v2 04/16] target-m68k: define ext_opsize Laurent Vivier
2017-01-30 18:16 ` [Qemu-devel] [PATCH v2 05/16] target-m68k: use floatx80 internally Laurent Vivier
2017-01-30 18:16 ` [Qemu-devel] [PATCH v2 06/16] target-m68k: add FPCR and FPSR Laurent Vivier
2017-01-30 18:16 ` [Qemu-devel] [PATCH v2 07/16] target-m68k: manage FPU exceptions Laurent Vivier
2017-01-30 18:16 ` [Qemu-devel] [PATCH v2 08/16] target-m68k: define 96bit FP registers for gdb on 680x0 Laurent Vivier
2017-01-30 18:16 ` [Qemu-devel] [PATCH v2 09/16] target-m68k: add fmovem Laurent Vivier
2017-01-30 18:16 ` [Qemu-devel] [PATCH v2 10/16] target-m68k: add fscc Laurent Vivier
2017-01-30 18:16 ` [Qemu-devel] [PATCH v2 11/16] target-m68k: add fmovecr Laurent Vivier
2017-01-30 18:16 ` [Qemu-devel] [PATCH v2 12/16] target-m68k: add fscale, fgetman, fgetexp and fmod Laurent Vivier
2017-01-30 18:16 ` [Qemu-devel] [PATCH v2 13/16] target-m68k: add fsglmul and fsgldiv Laurent Vivier
2017-01-30 18:16 ` [Qemu-devel] [PATCH v2 14/16] target-m68k: add explicit single and double precision operations Laurent Vivier
2017-01-30 18:16 ` [Qemu-devel] [PATCH v2 15/16] target-m68k: add more FPU instructions Laurent Vivier
2017-01-30 18:16 ` [Qemu-devel] [PATCH v2 16/16] target-m68k: add fsincos Laurent Vivier
2017-01-30 18:44 ` [Qemu-devel] [PATCH v2 00/16] target-m68k: implement 680x0 FPU Andreas Schwab
2017-01-30 18:47 ` no-reply

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=20170130181634.13934-3-laurent@vivier.eu \
    --to=laurent@vivier.eu \
    --cc=aurelien@aurel32.net \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.