public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Remove unused NaN's integer representation definitions
@ 2018-08-17 9:37 Corinna Vinschen
0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2018-08-17 9:37 UTC (permalink / raw)
To: newlib-cvs
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=4c8fa88e4da3afdcb48236a4317beb303c4bd955
commit 4c8fa88e4da3afdcb48236a4317beb303c4bd955
Author: Masamichi Hosoda <trueroad@trueroad.jp>
Date: Thu Aug 16 09:46:43 2018 +0900
Remove unused NaN's integer representation definitions
By previous commit, strto{d|ld} ("nan")
does not use the definition of NaN.
There is no other function that uses the definitions.
This commit remove the definitions.
Diff:
---
newlib/libc/stdlib/gd_qnan.h | 53 ---------------------------------------
newlib/libc/stdlib/gdtoa-gethex.c | 1 -
newlib/libc/stdlib/mprec.h | 33 ------------------------
newlib/libc/stdlib/strtod.c | 9 ++++++-
newlib/libc/stdlib/strtodg.c | 1 -
newlib/libc/stdlib/strtorx.c | 4 ---
6 files changed, 8 insertions(+), 93 deletions(-)
diff --git a/newlib/libc/stdlib/gd_qnan.h b/newlib/libc/stdlib/gd_qnan.h
deleted file mode 100644
index b775f82..0000000
--- a/newlib/libc/stdlib/gd_qnan.h
+++ /dev/null
@@ -1,53 +0,0 @@
-#ifdef __IEEE_BIG_ENDIAN
-
-#if !defined(__mips)
-#define f_QNAN 0x7fc00000
-#define d_QNAN0 0x7ff80000
-#define d_QNAN1 0x0
-#define ld_QNAN0 0x7ff80000
-#define ld_QNAN1 0x0
-#define ld_QNAN2 0x0
-#define ld_QNAN3 0x0
-#define ldus_QNAN0 0x7ff8
-#define ldus_QNAN1 0x0
-#define ldus_QNAN2 0x0
-#define ldus_QNAN3 0x0
-#define ldus_QNAN4 0x0
-#elif defined(__mips_nan2008)
-#define f_QNAN 0x7fc00000
-#define d_QNAN0 0x7ff80000
-#define d_QNAN1 0x0
-#else
-#define f_QNAN 0x7fbfffff
-#define d_QNAN0 0x7ff7ffff
-#define d_QNAN1 0xffffffff
-#endif
-
-#elif defined(__IEEE_LITTLE_ENDIAN)
-
-#if !defined(__mips)
-#define f_QNAN 0xffc00000
-#define d_QNAN0 0x0
-#define d_QNAN1 0xfff80000
-#define ld_QNAN0 0x0
-#define ld_QNAN1 0xc0000000
-#define ld_QNAN2 0xffff
-#define ld_QNAN3 0x0
-#define ldus_QNAN0 0x0
-#define ldus_QNAN1 0x0
-#define ldus_QNAN2 0x0
-#define ldus_QNAN3 0xc000
-#define ldus_QNAN4 0xffff
-#elif defined(__mips_nan2008)
-#define f_QNAN 0x7fc00000
-#define d_QNAN0 0x0
-#define d_QNAN1 0x7ff80000
-#else
-#define f_QNAN 0x7fbfffff
-#define d_QNAN0 0xffffffff
-#define d_QNAN1 0x7ff7ffff
-#endif
-
-#else
-#error IEEE endian not defined
-#endif
diff --git a/newlib/libc/stdlib/gdtoa-gethex.c b/newlib/libc/stdlib/gdtoa-gethex.c
index 939e0dd..d160015 100644
--- a/newlib/libc/stdlib/gdtoa-gethex.c
+++ b/newlib/libc/stdlib/gdtoa-gethex.c
@@ -35,7 +35,6 @@ THIS SOFTWARE.
#include <locale.h>
#include "mprec.h"
#include "gdtoa.h"
-#include "gd_qnan.h"
#if !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__) && !defined(_SMALL_HEXDIG)
const unsigned char __hexdig[256]=
diff --git a/newlib/libc/stdlib/mprec.h b/newlib/libc/stdlib/mprec.h
index 7baec83..7e9a88b 100644
--- a/newlib/libc/stdlib/mprec.h
+++ b/newlib/libc/stdlib/mprec.h
@@ -265,39 +265,6 @@ typedef union { double d; __ULong i[2]; } U;
#define INFNAN_CHECK
#endif
-/*
- * NAN_WORD0 and NAN_WORD1 are only referenced in strtod.c. Prior to
- * 20050115, they used to be hard-wired here (to 0x7ff80000 and 0,
- * respectively), but now are determined by compiling and running
- * qnan.c to generate gd_qnan.h, which specifies d_QNAN0 and d_QNAN1.
- * Formerly gdtoaimp.h recommended supplying suitable -DNAN_WORD0=...
- * and -DNAN_WORD1=... values if necessary. This should still work.
- * (On HP Series 700/800 machines, -DNAN_WORD0=0x7ff40000 works.)
- */
-#ifdef IEEE_Arith
-#ifdef IEEE_MC68k
-#define _0 0
-#define _1 1
-#ifndef NAN_WORD0
-#define NAN_WORD0 d_QNAN0
-#endif
-#ifndef NAN_WORD1
-#define NAN_WORD1 d_QNAN1
-#endif
-#else
-#define _0 1
-#define _1 0
-#ifndef NAN_WORD0
-#define NAN_WORD0 d_QNAN1
-#endif
-#ifndef NAN_WORD1
-#define NAN_WORD1 d_QNAN0
-#endif
-#endif
-#else
-#undef INFNAN_CHECK
-#endif
-
#ifdef RND_PRODQUOT
#define rounded_product(a,b) a = rnd_prod(a, b)
#define rounded_quotient(a,b) a = rnd_quot(a, b)
diff --git a/newlib/libc/stdlib/strtod.c b/newlib/libc/stdlib/strtod.c
index d70d2c2..3164e30 100644
--- a/newlib/libc/stdlib/strtod.c
+++ b/newlib/libc/stdlib/strtod.c
@@ -137,7 +137,6 @@ THIS SOFTWARE.
#include <string.h>
#include "mprec.h"
#include "gdtoa.h"
-#include "gd_qnan.h"
#include "../locale/setlocale.h"
/* #ifndef NO_FENV_H */
@@ -172,6 +171,14 @@ static const double tinytens[] = { 1e-16, 1e-32,
#define Rounding Flt_Rounds
#endif
+#ifdef IEEE_MC68k
+#define _0 0
+#define _1 1
+#else
+#define _0 1
+#define _1 0
+#endif
+
#ifdef Avoid_Underflow /*{*/
static double
sulp (U x,
diff --git a/newlib/libc/stdlib/strtodg.c b/newlib/libc/stdlib/strtodg.c
index 4ac1f8e..c8e581c 100644
--- a/newlib/libc/stdlib/strtodg.c
+++ b/newlib/libc/stdlib/strtodg.c
@@ -35,7 +35,6 @@ THIS SOFTWARE.
#include <string.h>
#include "mprec.h"
#include "gdtoa.h"
-#include "gd_qnan.h"
#include "locale.h"
diff --git a/newlib/libc/stdlib/strtorx.c b/newlib/libc/stdlib/strtorx.c
index f923fdf..a35dabe 100644
--- a/newlib/libc/stdlib/strtorx.c
+++ b/newlib/libc/stdlib/strtorx.c
@@ -35,13 +35,9 @@ THIS SOFTWARE.
#include <string.h>
#include "mprec.h"
#include "gdtoa.h"
-#include "gd_qnan.h"
#if defined (_HAVE_LONG_DOUBLE) && !defined (_LDBL_EQ_DBL)
-#undef _0
-#undef _1
-
/* one or the other of IEEE_MC68k or IEEE_8087 should be #defined */
#ifdef IEEE_MC68k
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2018-08-17 9:37 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-17 9:37 [newlib-cygwin] Remove unused NaN's integer representation definitions Corinna Vinschen
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 read-only IMAP folder(s) and NNTP newsgroup(s).