This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.24-609-gf5ee536


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  f5ee5362bf8c50e5a85bf758f3f5d91f262a446f (commit)
      from  2b18fe78fe7217430ed42d3284636c732793e352 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=f5ee5362bf8c50e5a85bf758f3f5d91f262a446f

commit f5ee5362bf8c50e5a85bf758f3f5d91f262a446f
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Wed Jan 4 17:15:39 2017 +0000

    Make MIPS soft-fp preserve NaN payloads for NAN2008.
    
    This corresponds to a patch applied to libgcc.  In glibc it doesn't
    actually affect much (only fma, I think).
    
    The MIPS sfp-machine.h files have an _FP_CHOOSENAN implementation
    which emulates hardware semantics of not preserving signaling NaN
    payloads for an operation with two NaN arguments (although that
    doesn't suffice to avoid sNaN payload preservation in any case with
    just one NaN argument).
    
    However, those are only hardware semantics in the legacy NaN case; in
    the NAN2008 case, the architecture documentation says hardware
    preserves payloads in such cases.  Furthermore, this implementation
    assumes legacy NaN semantics, so in the NAN2008 case the
    implementation actually has the effect of preserving sNaN payloads but
    not preserving qNaN payloads, when both should be preserved.
    
    This patch fixes the code just to copy from the first argument.
    
    Tested for mips64 soft-float.
    
    	* sysdeps/mips/mips32/sfp-machine.h (_FP_CHOOSENAN): Always
    	preserve NaN payload if [__mips_nan2008].
    	* sysdeps/mips/mips64/sfp-machine.h (_FP_CHOOSENAN): Likewise.

diff --git a/ChangeLog b/ChangeLog
index 32dee3f..0278dff 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2017-01-04  Joseph Myers  <joseph@codesourcery.com>
 
+	* sysdeps/mips/mips32/sfp-machine.h (_FP_CHOOSENAN): Always
+	preserve NaN payload if [__mips_nan2008].
+	* sysdeps/mips/mips64/sfp-machine.h (_FP_CHOOSENAN): Likewise.
+
 	[BZ #21022]
 	* sysdeps/microblaze/backtrace.c (get_frame_size): Make static.
 
diff --git a/sysdeps/mips/mips32/sfp-machine.h b/sysdeps/mips/mips32/sfp-machine.h
index 4e23aa8..5215655 100644
--- a/sysdeps/mips/mips32/sfp-machine.h
+++ b/sysdeps/mips/mips32/sfp-machine.h
@@ -41,9 +41,20 @@
 # define _FP_QNANNEGATEDP 1
 #endif
 
+#ifdef __mips_nan2008
+/* NaN payloads should be preserved for NAN2008.  */
+# define _FP_CHOOSENAN(fs, wc, R, X, Y, OP)	\
+  do						\
+    {						\
+      R##_s = X##_s;				\
+      _FP_FRAC_COPY_##wc (R, X);		\
+      R##_c = FP_CLS_NAN;			\
+    }						\
+  while (0)
+#else
 /* From my experiments it seems X is chosen unless one of the
    NaNs is sNaN,  in which case the result is NANSIGN/NANFRAC.  */
-#define _FP_CHOOSENAN(fs, wc, R, X, Y, OP)			\
+# define _FP_CHOOSENAN(fs, wc, R, X, Y, OP)			\
   do {								\
     if ((_FP_FRAC_HIGH_RAW_##fs(X) |				\
 	 _FP_FRAC_HIGH_RAW_##fs(Y)) & _FP_QNANBIT_##fs)		\
@@ -58,6 +69,7 @@
       }								\
     R##_c = FP_CLS_NAN;						\
   } while (0)
+#endif
 
 #define FP_EX_INVALID           (1 << 4)
 #define FP_EX_DIVZERO           (1 << 3)
diff --git a/sysdeps/mips/mips64/sfp-machine.h b/sysdeps/mips/mips64/sfp-machine.h
index 708afc7..35cc4dd 100644
--- a/sysdeps/mips/mips64/sfp-machine.h
+++ b/sysdeps/mips/mips64/sfp-machine.h
@@ -44,9 +44,20 @@
 # define _FP_QNANNEGATEDP 1
 #endif
 
+#ifdef __mips_nan2008
+/* NaN payloads should be preserved for NAN2008.  */
+# define _FP_CHOOSENAN(fs, wc, R, X, Y, OP)	\
+  do						\
+    {						\
+      R##_s = X##_s;				\
+      _FP_FRAC_COPY_##wc (R, X);		\
+      R##_c = FP_CLS_NAN;			\
+    }						\
+  while (0)
+#else
 /* From my experiments it seems X is chosen unless one of the
    NaNs is sNaN,  in which case the result is NANSIGN/NANFRAC.  */
-#define _FP_CHOOSENAN(fs, wc, R, X, Y, OP)			\
+# define _FP_CHOOSENAN(fs, wc, R, X, Y, OP)			\
   do {								\
     if ((_FP_FRAC_HIGH_RAW_##fs(X) |				\
 	 _FP_FRAC_HIGH_RAW_##fs(Y)) & _FP_QNANBIT_##fs)		\
@@ -61,6 +72,7 @@
       }								\
     R##_c = FP_CLS_NAN;						\
   } while (0)
+#endif
 
 #define _FP_DECL_EX		fpu_control_t _fcw
 

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                         |    4 ++++
 sysdeps/mips/mips32/sfp-machine.h |   14 +++++++++++++-
 sysdeps/mips/mips64/sfp-machine.h |   14 +++++++++++++-
 3 files changed, 30 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]