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 release/2.27/master updated. glibc-2.27-35-gdf3ff4e


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, release/2.27/master has been updated
       via  df3ff4e49d4ee3cbbdaeb0b1cb5dc2344c08be98 (commit)
       via  aab08776cc8f6dbafaa6efcb7e1bb374a21ab823 (commit)
       via  94145309f5beff5f495c443fb544d604515b07d0 (commit)
      from  3b922526415d1af93fe5a0e3caf7e6a790cb1619 (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=df3ff4e49d4ee3cbbdaeb0b1cb5dc2344c08be98

commit df3ff4e49d4ee3cbbdaeb0b1cb5dc2344c08be98
Author: DJ Delorie <dj@redhat.com>
Date:   Fri Feb 23 16:08:08 2018 -0500

    Update ChangeLog for BZ 22884 - riscv fmax/fmin
    
    (cherry picked from commit 7e04eb2932d3126c721ee2bc0d664a5bbea2f41f)

diff --git a/ChangeLog b/ChangeLog
index 394f670..23ff0ea 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 2018-02-22  Andrew Waterman <andrew@sifive.com>
 
+	[BZ # 22884]
 	* sysdeps/riscv/rvd/s_fmax.c (__fmax): Handle sNaNs correctly.
 	* sysdeps/riscv/rvd/s_fmin.c (__fmin): Likewise.
 	* sysdeps/riscv/rvf/s_fmaxf.c (__fmaxf): Likewise.

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

commit aab08776cc8f6dbafaa6efcb7e1bb374a21ab823
Author: Andrew Waterman <andrew@sifive.com>
Date:   Thu Feb 22 14:31:54 2018 -0500

    RISC-V: fmax/fmin: Handle signalling NaNs correctly.
    
    RISC-V's fmax(sNAN,4) returns 4 but glibc expects it to return qNAN.
    
    	* sysdeps/riscv/rvd/s_fmax.c (__fmax): Handle sNaNs correctly.
    	* sysdeps/riscv/rvd/s_fmin.c (__fmin): Likewise.
    	* sysdeps/riscv/rvf/s_fmaxf.c (__fmaxf): Likewise.
    	* sysdeps/riscv/rvf/s_fminf.c (__fminf): Likewise.
    
    (cherry picked from commit fdcc625376505eacb1125a6aeba57501407a30ec)

diff --git a/ChangeLog b/ChangeLog
index 8b859f6..394f670 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2018-02-22  Andrew Waterman <andrew@sifive.com>
+
+	* sysdeps/riscv/rvd/s_fmax.c (__fmax): Handle sNaNs correctly.
+	* sysdeps/riscv/rvd/s_fmin.c (__fmin): Likewise.
+	* sysdeps/riscv/rvf/s_fmaxf.c (__fmaxf): Likewise.
+	* sysdeps/riscv/rvf/s_fminf.c (__fminf): Likewise.
+
 2018-02-22  DJ Delorie  <dj@delorie.com>
 
 	* sysdeps/riscv/tls-macros.h: Do not initialize $gp.
diff --git a/sysdeps/riscv/rvd/s_fmax.c b/sysdeps/riscv/rvd/s_fmax.c
index ef8f134..22e91bf 100644
--- a/sysdeps/riscv/rvd/s_fmax.c
+++ b/sysdeps/riscv/rvd/s_fmax.c
@@ -17,12 +17,19 @@
    <http://www.gnu.org/licenses/>.  */
 
 #include <math.h>
+#include <math_private.h>
 #include <libm-alias-double.h>
 
 double
 __fmax (double x, double y)
 {
-  asm ("fmax.d %0, %1, %2" : "=f" (x) : "f" (x), "f" (y));
-  return x;
+  double res;
+
+  if (__glibc_unlikely ((_FCLASS (x) | _FCLASS (y)) & _FCLASS_SNAN))
+    return x + y;
+  else
+    asm ("fmax.d %0, %1, %2" : "=f" (res) : "f" (x), "f" (y));
+
+  return res;
 }
 libm_alias_double (__fmax, fmax)
diff --git a/sysdeps/riscv/rvd/s_fmin.c b/sysdeps/riscv/rvd/s_fmin.c
index c6ff24c..7b35230 100644
--- a/sysdeps/riscv/rvd/s_fmin.c
+++ b/sysdeps/riscv/rvd/s_fmin.c
@@ -17,12 +17,19 @@
    <http://www.gnu.org/licenses/>.  */
 
 #include <math.h>
+#include <math_private.h>
 #include <libm-alias-double.h>
 
 double
 __fmin (double x, double y)
 {
-  asm ("fmin.d %0, %1, %2" : "=f" (x) : "f" (x), "f" (y));
-  return x;
+  double res;
+
+  if (__glibc_unlikely ((_FCLASS (x) | _FCLASS (y)) & _FCLASS_SNAN))
+    return x + y;
+  else
+    asm ("fmin.d %0, %1, %2" : "=f" (res) : "f" (x), "f" (y));
+
+  return res;
 }
 libm_alias_double (__fmin, fmin)
diff --git a/sysdeps/riscv/rvf/s_fmaxf.c b/sysdeps/riscv/rvf/s_fmaxf.c
index 3293f2f..63f7e3d 100644
--- a/sysdeps/riscv/rvf/s_fmaxf.c
+++ b/sysdeps/riscv/rvf/s_fmaxf.c
@@ -17,12 +17,19 @@
    <http://www.gnu.org/licenses/>.  */
 
 #include <math.h>
+#include <math_private.h>
 #include <libm-alias-float.h>
 
 float
 __fmaxf (float x, float y)
 {
-  asm ("fmax.s %0, %1, %2" : "=f" (x) : "f" (x), "f" (y));
-  return x;
+  float res;
+
+  if (__glibc_unlikely ((_FCLASS (x) | _FCLASS (y)) & _FCLASS_SNAN))
+    return x + y;
+  else
+    asm ("fmax.s %0, %1, %2" : "=f" (res) : "f" (x), "f" (y));
+
+  return res;
 }
 libm_alias_float (__fmax, fmax)
diff --git a/sysdeps/riscv/rvf/s_fminf.c b/sysdeps/riscv/rvf/s_fminf.c
index e4411f0..82cca4e 100644
--- a/sysdeps/riscv/rvf/s_fminf.c
+++ b/sysdeps/riscv/rvf/s_fminf.c
@@ -17,12 +17,19 @@
    <http://www.gnu.org/licenses/>.  */
 
 #include <math.h>
+#include <math_private.h>
 #include <libm-alias-float.h>
 
 float
 __fminf (float x, float y)
 {
-  asm ("fmin.s %0, %1, %2" : "=f" (x) : "f" (x), "f" (y));
-  return x;
+  float res;
+
+  if (__glibc_unlikely ((_FCLASS (x) | _FCLASS (y)) & _FCLASS_SNAN))
+    return x + y;
+  else
+    asm ("fmin.s %0, %1, %2" : "=f" (res) : "f" (x), "f" (y));
+
+  return res;
 }
 libm_alias_float (__fmin, fmin)

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=94145309f5beff5f495c443fb544d604515b07d0

commit 94145309f5beff5f495c443fb544d604515b07d0
Author: DJ Delorie <dj@redhat.com>
Date:   Thu Feb 22 14:28:47 2018 -0500

    RISC-V: Do not initialize $gp in TLS macros.
    
    RISC-V TLS doesn't require GP to be initialized, and doing so breaks
    TLS in a shared object.
    
    (cherry picked from commit 8090720a87e42fddc31396f6126112d4b8014d8e)

diff --git a/ChangeLog b/ChangeLog
index 1707592..8b859f6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2018-02-22  DJ Delorie  <dj@delorie.com>
+
+	* sysdeps/riscv/tls-macros.h: Do not initialize $gp.
+
 2018-03-16  Rafal Luzynski  <digitalfreak@lingonborough.com>
 
 	[BZ #22963]
diff --git a/sysdeps/riscv/tls-macros.h b/sysdeps/riscv/tls-macros.h
index 5433ed9..7f0dd92 100644
--- a/sysdeps/riscv/tls-macros.h
+++ b/sysdeps/riscv/tls-macros.h
@@ -23,19 +23,9 @@
 #include <sysdep.h>
 #include "dl-tls.h"
 
-#define LOAD_GP						\
-	".option push\n\t"				\
-	".option norelax\n\t"				\
-	"la gp, __global_pointer$\n\t"			\
-	".option pop\n\t"
-
-#define UNLOAD_GP
-
 #define TLS_GD(x)					\
 	({ void *__result;				\
-	asm (LOAD_GP					\
-	     "la.tls.gd %0, " #x "\n\t"			\
-	     UNLOAD_GP					\
+	asm ("la.tls.gd %0, " #x "\n\t"			\
 	     : "=r" (__result));			\
 	__tls_get_addr (__result); })
 
@@ -43,19 +33,15 @@
 
 #define TLS_IE(x)					\
 	({ void *__result;				\
-	asm (LOAD_GP					\
-	     "la.tls.ie %0, " #x "\n\t"			\
+	asm ("la.tls.ie %0, " #x "\n\t"			\
 	     "add %0, %0, tp\n\t"			\
-	     UNLOAD_GP					\
 	     : "=r" (__result));			\
 	__result; })
 
 #define TLS_LE(x)					\
 	({ void *__result;				\
-	asm (LOAD_GP					\
-	     "lui %0, %%tprel_hi(" #x ")\n\t"		\
+	asm ("lui %0, %%tprel_hi(" #x ")\n\t"		\
 	     "add %0, %0, tp, %%tprel_add(" #x ")\n\t"	\
 	     "addi %0, %0, %%tprel_lo(" #x ")\n\t"	\
-	     UNLOAD_GP					\
 	     : "=r" (__result));			\
 	__result; })

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

Summary of changes:
 ChangeLog                   |   12 ++++++++++++
 sysdeps/riscv/rvd/s_fmax.c  |   11 +++++++++--
 sysdeps/riscv/rvd/s_fmin.c  |   11 +++++++++--
 sysdeps/riscv/rvf/s_fmaxf.c |   11 +++++++++--
 sysdeps/riscv/rvf/s_fminf.c |   11 +++++++++--
 sysdeps/riscv/tls-macros.h  |   20 +++-----------------
 6 files changed, 51 insertions(+), 25 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]