This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: [PATCH] MIPS: NaN encoding fixes and IEEE 754-2008 updates
- From: Sebastian Huber <sebastian dot huber at embedded-brains dot de>
- To: newlib at sourceware dot org
- Date: Wed, 19 Mar 2014 07:58:22 +0100
- Subject: Re: [PATCH] MIPS: NaN encoding fixes and IEEE 754-2008 updates
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot DEB dot 1 dot 10 dot 1403182220010 dot 23119 at tp dot orcam dot me dot uk>
On 2014-03-19 01:06, Maciej W. Rozycki wrote:
Index: newlib-fsf-trunk-quilt/newlib/libm/common/s_nan.c
===================================================================
--- newlib-fsf-trunk-quilt.orig/newlib/libm/common/s_nan.c 2014-03-10 18:58:42.000000000 +0000
+++ newlib-fsf-trunk-quilt/newlib/libm/common/s_nan.c 2014-03-10 21:26:11.748926514 +0000
@@ -41,7 +41,13 @@ QUICKREF
{
double x;
+#if defined(__GNUC__) && \
+ ( (__GNUC__ >= 4) || \
+ ( (__GNUC__ >= 3) && defined(__GNUC_MINOR__) && (__GNUC_MINOR__ >= 3) ) )
+ x = __builtin_nan("");
+#else
INSERT_WORDS(x,0x7ff80000,0);
+#endif
return x;
}
Maybe it makes sense to use the __GNUC_PREREQ__(ma, mi) macro here defined in
<sys/features.h>.
--
Sebastian Huber, embedded brains GmbH
Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone : +49 89 189 47 41-16
Fax : +49 89 189 47 41-09
E-Mail : sebastian.huber@embedded-brains.de
PGP : Public key available on request.
Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.