Revert previous and make frach be 0xc0000000 for NAN's generated by strtold()

as suggested by tron.
This commit is contained in:
christos 2011-06-05 14:43:12 +00:00
parent 7c78532f22
commit 33c7476cb2
4 changed files with 14 additions and 12 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: gd_qnan.h,v 1.1 2006/01/25 15:33:28 kleink Exp $ */ /* $NetBSD: gd_qnan.h,v 1.2 2011/06/05 14:43:12 christos Exp $ */
#define f_QNAN 0x7fc00000 #define f_QNAN 0x7fc00000
#define d_QNAN0 0x0 #define d_QNAN0 0x0
@ -6,6 +6,6 @@
#define ldus_QNAN0 0x0 #define ldus_QNAN0 0x0
#define ldus_QNAN1 0x0 #define ldus_QNAN1 0x0
#define ldus_QNAN2 0x0 #define ldus_QNAN2 0x0
#define ldus_QNAN3 0x4000 #define ldus_QNAN3 0xc000
#define ldus_QNAN4 0x7fff #define ldus_QNAN4 0x7fff
/* 2 bytes of tail padding follow, per i386 ABI */ /* 2 bytes of tail padding follow, per i386 ABI */

View File

@ -1,4 +1,4 @@
/* $NetBSD: isnanl.c,v 1.7 2011/06/04 15:45:41 christos Exp $ */ /* $NetBSD: isnanl.c,v 1.8 2011/06/05 14:43:13 christos Exp $ */
/* /*
* Copyright (c) 1992, 1993 * Copyright (c) 1992, 1993
@ -40,7 +40,7 @@
#if 0 #if 0
static char sccsid[] = "@(#)isinf.c 8.1 (Berkeley) 6/4/93"; static char sccsid[] = "@(#)isinf.c 8.1 (Berkeley) 6/4/93";
#else #else
__RCSID("$NetBSD: isnanl.c,v 1.7 2011/06/04 15:45:41 christos Exp $"); __RCSID("$NetBSD: isnanl.c,v 1.8 2011/06/05 14:43:13 christos Exp $");
#endif #endif
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
@ -58,6 +58,7 @@ __isnanl(long double x)
u.extu_ld = x; u.extu_ld = x;
return u.extu_ext.ext_exp == EXT_EXP_INFNAN && return (u.extu_ext.ext_exp == EXT_EXP_INFNAN &&
(u.extu_ext.ext_frach != 0 || u.extu_ext.ext_fracl != 0); (u.extu_ext.ext_frach & 0x80000000) != 0 &&
(u.extu_ext.ext_frach != 0x80000000 || u.extu_ext.ext_fracl != 0));
} }

View File

@ -1,4 +1,4 @@
/* $NetBSD: gd_qnan.h,v 1.2 2011/03/20 23:16:07 christos Exp $ */ /* $NetBSD: gd_qnan.h,v 1.3 2011/06/05 14:43:13 christos Exp $ */
#define f_QNAN 0x7fc00000 #define f_QNAN 0x7fc00000
#define d_QNAN0 0x0 #define d_QNAN0 0x0
@ -10,6 +10,6 @@
#define ldus_QNAN0 0x0 #define ldus_QNAN0 0x0
#define ldus_QNAN1 0x0 #define ldus_QNAN1 0x0
#define ldus_QNAN2 0x0 #define ldus_QNAN2 0x0
#define ldus_QNAN3 0x4000 #define ldus_QNAN3 0xc000
#define ldus_QNAN4 0x7fff #define ldus_QNAN4 0x7fff
/* 6 bytes of tail padding follow, per AMD64 ABI */ /* 6 bytes of tail padding follow, per AMD64 ABI */

View File

@ -1,4 +1,4 @@
/* $NetBSD: isnanl.c,v 1.7 2011/06/04 15:45:41 christos Exp $ */ /* $NetBSD: isnanl.c,v 1.8 2011/06/05 14:43:13 christos Exp $ */
/* /*
* Copyright (c) 1992, 1993 * Copyright (c) 1992, 1993
@ -40,7 +40,7 @@
#if 0 #if 0
static char sccsid[] = "@(#)isinf.c 8.1 (Berkeley) 6/4/93"; static char sccsid[] = "@(#)isinf.c 8.1 (Berkeley) 6/4/93";
#else #else
__RCSID("$NetBSD: isnanl.c,v 1.7 2011/06/04 15:45:41 christos Exp $"); __RCSID("$NetBSD: isnanl.c,v 1.8 2011/06/05 14:43:13 christos Exp $");
#endif #endif
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
@ -58,6 +58,7 @@ __isnanl(long double x)
u.extu_ld = x; u.extu_ld = x;
return u.extu_ext.ext_exp == EXT_EXP_INFNAN && return (u.extu_ext.ext_exp == EXT_EXP_INFNAN &&
(u.extu_ext.ext_frach != 0 || u.extu_ext.ext_fracl != 0); (u.extu_ext.ext_frach & 0x80000000) != 0 &&
(u.extu_ext.ext_frach != 0x80000000 || u.extu_ext.ext_fracl != 0));
} }