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 hjl/pr19463 updated. glibc-2.22-671-gde7d281


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, hjl/pr19463 has been updated
       via  de7d281ec9f45947be1e9e4d898fc2aad4afb544 (commit)
       via  8dae8b1142b37b79a24b4ebd2129ef1219e2f987 (commit)
      from  5728e0c913fcd9623df94561acc7f0ee5ca1fef5 (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=de7d281ec9f45947be1e9e4d898fc2aad4afb544

commit de7d281ec9f45947be1e9e4d898fc2aad4afb544
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Thu Jan 14 06:13:33 2016 -0800

    Add libc_felearexceptenv

diff --git a/include/fenv.h b/include/fenv.h
index de4d46f..cf8507e 100644
--- a/include/fenv.h
+++ b/include/fenv.h
@@ -42,6 +42,19 @@ struct rm_ctx
   fenv_t env;
   bool updated_status;
 };
+
+/* Clear the supported exceptions represented by EXCEPTS in the
+   floating-point environment in the object pointed to by ENVP.  */
+# define default_libc_felearexceptenv(e, ex)
+# ifndef libc_felearexceptenvf
+#  define libc_felearexceptenvf default_libc_felearexceptenv
+# endif
+# ifndef libc_felearexceptenv
+#  define libc_felearexceptenv default_libc_felearexceptenv
+# endif
+# ifndef libc_felearexceptenvl
+#  define libc_felearexceptenvl default_libc_felearexceptenv
+# endif
 #endif
 
 #endif
diff --git a/sysdeps/i386/fpu/fenv_private.h b/sysdeps/i386/fpu/fenv_private.h
index e20e1f1..d49b9a8 100644
--- a/sysdeps/i386/fpu/fenv_private.h
+++ b/sysdeps/i386/fpu/fenv_private.h
@@ -203,6 +203,28 @@ libc_feupdateenv_test_387 (fenv_t *e, int ex)
 }
 
 static __always_inline void
+libc_felearexceptenv_sse (fenv_t *e, int ex)
+{
+  e->__mxcsr &= ~ex;
+}
+
+static __always_inline void
+libc_felearexceptenv_387 (fenv_t *e, int ex)
+{
+  fexcept_t cur_ex;
+
+  /* Save current exceptions.  */
+  asm volatile ("fnstsw %0" : "=a" (cur_ex));
+
+  /* Clear EX and merge current exceptions.  */
+  cur_ex &= ~ex;
+  __feraiseexcept (cur_ex);
+
+  /* Load the new environment.  */
+  libc_fesetenv_387 (e);
+}
+
+static __always_inline void
 libc_feupdateenv_sse (fenv_t *e)
 {
   libc_feupdateenv_test_sse (e, 0);
@@ -263,6 +285,10 @@ libc_feresetround_387 (fenv_t *e)
   _FPU_SETCW (e->__control_word);
 }
 
+#undef libc_felearexceptenvf
+#undef libc_felearexceptenv
+#undef libc_felearexceptenvl
+
 #ifdef __SSE_MATH__
 # define libc_feholdexceptf		libc_feholdexcept_sse
 # define libc_fesetroundf		libc_fesetround_sse
@@ -270,6 +296,7 @@ libc_feresetround_387 (fenv_t *e)
 # define libc_fetestexceptf		libc_fetestexcept_sse
 # define libc_fesetenvf			libc_fesetenv_sse
 # define libc_feupdateenv_testf		libc_feupdateenv_test_sse
+# define libc_felearexceptenvf		libc_felearexceptenv_sse
 # define libc_feupdateenvf		libc_feupdateenv_sse
 # define libc_feholdsetroundf		libc_feholdsetround_sse
 # define libc_feresetroundf		libc_feresetround_sse
@@ -280,6 +307,7 @@ libc_feresetround_387 (fenv_t *e)
 # define libc_fetestexceptf		libc_fetestexcept_387
 # define libc_fesetenvf			libc_fesetenv_387
 # define libc_feupdateenv_testf		libc_feupdateenv_test_387
+# define libc_felearexceptenvf		libc_felearexceptenv_387
 # define libc_feupdateenvf		libc_feupdateenv_387
 # define libc_feholdsetroundf		libc_feholdsetround_387
 # define libc_feresetroundf		libc_feresetround_387
@@ -292,6 +320,7 @@ libc_feresetround_387 (fenv_t *e)
 # define libc_fetestexcept		libc_fetestexcept_sse
 # define libc_fesetenv			libc_fesetenv_sse
 # define libc_feupdateenv_test		libc_feupdateenv_test_sse
+# define libc_felearexceptenv		libc_felearexceptenv_sse
 # define libc_feupdateenv		libc_feupdateenv_sse
 # define libc_feholdsetround		libc_feholdsetround_sse
 # define libc_feresetround		libc_feresetround_sse
@@ -302,6 +331,7 @@ libc_feresetround_387 (fenv_t *e)
 # define libc_fetestexcept		libc_fetestexcept_387
 # define libc_fesetenv			libc_fesetenv_387
 # define libc_feupdateenv_test		libc_feupdateenv_test_387
+# define libc_felearexceptenv		libc_felearexceptenv_387
 # define libc_feupdateenv		libc_feupdateenv_387
 # define libc_feholdsetround		libc_feholdsetround_387
 # define libc_feresetround		libc_feresetround_387
@@ -313,6 +343,7 @@ libc_feresetround_387 (fenv_t *e)
 #define libc_fetestexceptl		libc_fetestexcept_387
 #define libc_fesetenvl			libc_fesetenv_387
 #define libc_feupdateenv_testl		libc_feupdateenv_test_387
+# define libc_felearexceptenvl		libc_felearexceptenv_387
 #define libc_feupdateenvl		libc_feupdateenv_387
 #define libc_feholdsetroundl		libc_feholdsetround_387
 #define libc_feresetroundl		libc_feresetround_387
diff --git a/sysdeps/ieee754/dbl-64/s_fma.c b/sysdeps/ieee754/dbl-64/s_fma.c
index bc3677d..58aa0ab 100644
--- a/sysdeps/ieee754/dbl-64/s_fma.c
+++ b/sysdeps/ieee754/dbl-64/s_fma.c
@@ -202,6 +202,7 @@ __fma (double x, double y, double z)
   math_force_eval (m2);
   math_force_eval (a2);
   feclearexcept (FE_INEXACT);
+  libc_felearexceptenv (&env, FE_INEXACT);
 
   /* If the result is an exact zero, ensure it has the correct sign.  */
   if (a1 == 0 && m2 == 0)
diff --git a/sysdeps/ieee754/ldbl-128/s_fmal.c b/sysdeps/ieee754/ldbl-128/s_fmal.c
index ac30027..bcc7494 100644
--- a/sysdeps/ieee754/ldbl-128/s_fmal.c
+++ b/sysdeps/ieee754/ldbl-128/s_fmal.c
@@ -207,6 +207,7 @@ __fmal (long double x, long double y, long double z)
   math_force_eval (m2);
   math_force_eval (a2);
   feclearexcept (FE_INEXACT);
+  libc_felearexceptenvl (&env, FE_INEXACT);
 
   /* If the result is an exact zero, ensure it has the correct sign.  */
   if (a1 == 0 && m2 == 0)
diff --git a/sysdeps/ieee754/ldbl-96/s_fma.c b/sysdeps/ieee754/ldbl-96/s_fma.c
index 5fbdda7..6a3e67c 100644
--- a/sysdeps/ieee754/ldbl-96/s_fma.c
+++ b/sysdeps/ieee754/ldbl-96/s_fma.c
@@ -69,6 +69,7 @@ __fma (double x, double y, double z)
   math_force_eval (m2);
   math_force_eval (a2);
   feclearexcept (FE_INEXACT);
+  libc_felearexceptenvl (&env, FE_INEXACT);
 
   /* If the result is an exact zero, ensure it has the correct sign.  */
   if (a1 == 0 && m2 == 0)
diff --git a/sysdeps/ieee754/ldbl-96/s_fmal.c b/sysdeps/ieee754/ldbl-96/s_fmal.c
index 57774cf..65f0590 100644
--- a/sysdeps/ieee754/ldbl-96/s_fmal.c
+++ b/sysdeps/ieee754/ldbl-96/s_fmal.c
@@ -205,6 +205,7 @@ __fmal (long double x, long double y, long double z)
   math_force_eval (m2);
   math_force_eval (a2);
   feclearexcept (FE_INEXACT);
+  libc_felearexceptenvl (&env, FE_INEXACT);
 
   /* If the result is an exact zero, ensure it has the correct sign.  */
   if (a1 == 0 && m2 == 0)

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

commit 8dae8b1142b37b79a24b4ebd2129ef1219e2f987
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Thu Jan 14 04:15:03 2016 -0800

    Use TIME_T_MAX and TIME_T_MIN in tst-mktime2.c
    
    GCC 5.3 compiles
    
    for (time_t_max = 1; 0 < time_t_max; time_t_max *= 2)
        continue;
    
    into an infinite loop with -Os.  We can copy TIME_T_MAX and TIME_T_MIN
    from time/mktime.c.
    
    	[BZ #19466]
    	* time/tst-mktime2.c (TYPE_SIGNED): New.
    	(TYPE_MINIMUM): Likewise.
    	(TYPE_MAXIMUM): Likewise.
    	(TIME_T_MIN): Likewise.
    	(TIME_T_MAX): Likewise.
    	(do_test): Initialize time_t_max and time_t_min with TIME_T_MAX
    	and TIME_T_MIN.

diff --git a/time/tst-mktime2.c b/time/tst-mktime2.c
index bc7cc58..fd40ab7 100644
--- a/time/tst-mktime2.c
+++ b/time/tst-mktime2.c
@@ -5,6 +5,29 @@
 #include <stdlib.h>
 #include <unistd.h>
 
+/* True if the arithmetic type T is signed.  */
+#define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
+
+/* The maximum and minimum values for the integer type T.  These
+   macros have undefined behavior if T is signed and has padding bits.
+   If this is a problem for you, please let us know how to fix it for
+   your host.  */
+#define TYPE_MINIMUM(t) \
+  ((t) (! TYPE_SIGNED (t) \
+	? (t) 0 \
+	: ~ TYPE_MAXIMUM (t)))
+#define TYPE_MAXIMUM(t) \
+  ((t) (! TYPE_SIGNED (t) \
+	? (t) -1 \
+	: ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
+
+#ifndef TIME_T_MIN
+# define TIME_T_MIN TYPE_MINIMUM (time_t)
+#endif
+#ifndef TIME_T_MAX
+# define TIME_T_MAX TYPE_MAXIMUM (time_t)
+#endif
+
 static time_t time_t_max;
 static time_t time_t_min;
 
@@ -113,12 +136,8 @@ do_test (void)
      isn't worth using anyway.  */
   alarm (60);
 
-  for (time_t_max = 1; 0 < time_t_max; time_t_max *= 2)
-    continue;
-  time_t_max--;
-  if ((time_t) -1 < 0)
-    for (time_t_min = -1; (time_t) (time_t_min * 2) < 0; time_t_min *= 2)
-      continue;
+  time_t_max = TIME_T_MAX;
+  time_t_min = TIME_T_MIN;
   delta = time_t_max / 997; /* a suitable prime number */
   for (i = 0; i < N_STRINGS; i++)
     {

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

Summary of changes:
 include/fenv.h                    |   13 +++++++++++++
 sysdeps/i386/fpu/fenv_private.h   |   31 +++++++++++++++++++++++++++++++
 sysdeps/ieee754/dbl-64/s_fma.c    |    1 +
 sysdeps/ieee754/ldbl-128/s_fmal.c |    1 +
 sysdeps/ieee754/ldbl-96/s_fma.c   |    1 +
 sysdeps/ieee754/ldbl-96/s_fmal.c  |    1 +
 time/tst-mktime2.c                |   31 +++++++++++++++++++++++++------
 7 files changed, 73 insertions(+), 6 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]