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.19-764-g69862e2


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  69862e2511a41d64ff8ce942721589fb12bade15 (commit)
       via  d5e16ade14822f1a125b6d568b1e3e1326e8868d (commit)
       via  ca7b945c7330064f494436611bd35fce6107abf6 (commit)
       via  cd1175a373590f053bea8aa9f2dfaeae13906aa9 (commit)
      from  b3ec00e599dd7d2641bf1a575769f34a205f8e00 (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=69862e2511a41d64ff8ce942721589fb12bade15

commit 69862e2511a41d64ff8ce942721589fb12bade15
Author: Richard Henderson <rth@twiddle.net>
Date:   Thu Jul 3 10:37:59 2014 -0700

    alpha: Remove nearbyint and nearbyintf implementations
    
    The original implementation was written for EV5, which does not
    record inexact in the status register for /SU (but no /I) insns.
    But EV6 does record the inexact status; the lack of /I simply
    means that the exception is suppressed.
    
    Adding feholdexcept becomes the bulk of the overhead, so we might
    as well use the default implementation.

diff --git a/ChangeLog b/ChangeLog
index e84fbbf..5eb0d43 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2014-07-03  Richard Henderson  <rth@redhat.com>
 
+	* sysdeps/alpha/fpu/s_nearbyintf.c: Remove file.
+	* sysdeps/alpha/fpu/s_nearbyint.c (__nearbyint): Remove;
+	include sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c.
+
 	* sysdeps/alpha/fpu/math_private.h (math_opt_barrier): New.
 	(math_force_eval): New.
 
diff --git a/sysdeps/alpha/fpu/s_nearbyint.c b/sysdeps/alpha/fpu/s_nearbyint.c
index ed6c997..dc13910 100644
--- a/sysdeps/alpha/fpu/s_nearbyint.c
+++ b/sysdeps/alpha/fpu/s_nearbyint.c
@@ -16,33 +16,8 @@
    License along with the GNU C Library.  If not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <math.h>
-#include <math_ldbl_opt.h>
+#include <sysdeps/ieee754/dbl-64/wordsize-64/s_nearbyint.c>
 
-
-double
-__nearbyint (double x)
-{
-  if (isless (fabs (x), 9007199254740992.0))	/* 1 << DBL_MANT_DIG */
-    {
-      double tmp1, new_x;
-      __asm ("cvttq/svd %2,%1\n\t"
-	     "cvtqt/d %1,%0\n\t"
-	     : "=f"(new_x), "=&f"(tmp1)
-	     : "f"(x));
-
-      /* nearbyint(-0.1) == -0, and in general we'll always have the same
-	 sign as our input.  */
-      x = copysign(new_x, x);
-    }
-  return x;
-}
-
-weak_alias (__nearbyint, nearbyint)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__nearbyint, __nearbyintl)
-weak_alias (__nearbyint, nearbyintl)
-#endif
 #if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
 compat_symbol (libm, __nearbyint, nearbyintl, GLIBC_2_1);
 #endif
diff --git a/sysdeps/alpha/fpu/s_nearbyintf.c b/sysdeps/alpha/fpu/s_nearbyintf.c
deleted file mode 100644
index e769330..0000000
--- a/sysdeps/alpha/fpu/s_nearbyintf.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/* Copyright (C) 2007-2014 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Richard Henderson.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library.  If not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <math.h>
-
-float
-__nearbyintf (float x)
-{
-  if (isless (fabsf (x), 16777216.0f))	/* 1 << FLT_MANT_DIG */
-    {
-      /* Note that Alpha S_Floating is stored in registers in a
-	 restricted T_Floating format, so we don't even need to
-	 convert back to S_Floating in the end.  The initial
-	 conversion to T_Floating is needed to handle denormals.  */
-
-      float tmp1, tmp2, new_x;
-
-      __asm ("cvtst/s %3,%2\n\t"
-	     "cvttq/svd %2,%1\n\t"
-	     "cvtqt/d %1,%0\n\t"
-	     : "=f"(new_x), "=&f"(tmp1), "=&f"(tmp2)
-	     : "f"(x));
-
-      /* nearbyintf(-0.1) == -0, and in general we'll always have the same
-	 sign as our input.  */
-      x = copysignf(new_x, x);
-    }
-  return x;
-}
-
-weak_alias (__nearbyintf, nearbyintf)

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

commit d5e16ade14822f1a125b6d568b1e3e1326e8868d
Author: Richard Henderson <rth@twiddle.net>
Date:   Thu Jul 3 08:56:55 2014 -0700

    alpha: Implement math_opt_barrier and math_force_eval

diff --git a/ChangeLog b/ChangeLog
index 017003e..e84fbbf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2014-07-03  Richard Henderson  <rth@redhat.com>
 
+	* sysdeps/alpha/fpu/math_private.h (math_opt_barrier): New.
+	(math_force_eval): New.
+
 	* sysdeps/alpha/fpu/s_lround.c: Add 0.5 with chopped rounding.
 	* sysdeps/alpha/fpu/s_lroundf.c: Likewise.
 
diff --git a/sysdeps/alpha/fpu/math_private.h b/sysdeps/alpha/fpu/math_private.h
index 22ab3b9..9e06e25 100644
--- a/sysdeps/alpha/fpu/math_private.h
+++ b/sysdeps/alpha/fpu/math_private.h
@@ -13,6 +13,12 @@
 # define __isnanf __isnanf
 #endif
 
+/* Generic code forces values to memory; we don't need to do that.  */
+#define math_opt_barrier(x) \
+  ({ __typeof (x) __x = (x); __asm ("" : "+frm" (__x)); __x; })
+#define math_force_eval(x) \
+  ({ __typeof (x) __x = (x); __asm __volatile__ ("" : : "frm" (__x)); })
+
 #include_next <math_private.h>
 
 #ifdef __alpha_fix__

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

commit ca7b945c7330064f494436611bd35fce6107abf6
Author: Richard Henderson <rth@twiddle.net>
Date:   Thu Jul 3 08:52:45 2014 -0700

    alpha: Fix lround implementations
    
    Use chopped rounding to add 0.5.

diff --git a/ChangeLog b/ChangeLog
index 87b7a93..017003e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2014-07-03  Richard Henderson  <rth@redhat.com>
 
+	* sysdeps/alpha/fpu/s_lround.c: Add 0.5 with chopped rounding.
+	* sysdeps/alpha/fpu/s_lroundf.c: Likewise.
+
 	* sysdeps/alpha/fpu/s_round.c: Remove file.
 	* sysdeps/alpha/fpu/s_roundf.c: Remove file.
 
diff --git a/sysdeps/alpha/fpu/s_lround.c b/sysdeps/alpha/fpu/s_lround.c
index dedb98e..52a88b6 100644
--- a/sysdeps/alpha/fpu/s_lround.c
+++ b/sysdeps/alpha/fpu/s_lround.c
@@ -25,11 +25,11 @@
 long int
 __lround (double x)
 {
-  double adj;
+  double adj, y;
 
-  adj = 0x1.fffffffffffffp-2;	/* nextafter (0.5, 0.0) */
-  adj = copysign (adj, x);
-  return x + adj;
+  adj = copysign (0.5, x);
+  asm("addt/suc %1,%2,%0" : "=&f"(y) : "f"(x), "f"(adj));
+  return y;
 }
 
 strong_alias (__lround, __llround)
diff --git a/sysdeps/alpha/fpu/s_lroundf.c b/sysdeps/alpha/fpu/s_lroundf.c
index 650004d..ebbb129 100644
--- a/sysdeps/alpha/fpu/s_lroundf.c
+++ b/sysdeps/alpha/fpu/s_lroundf.c
@@ -25,11 +25,11 @@
 long int
 __lroundf (float x)
 {
-  float adj;
+  float adj, y;
 
-  adj = 0x1.fffffep-2;		/* nextafterf (0.5f, 0.0f) */
-  adj = copysignf (adj, x);
-  return x + adj;
+  adj = copysignf (0.5f, x);
+  asm("adds/suc %1,%2,%0" : "=&f"(y) : "f"(x), "f"(adj));
+  return y;
 }
 
 strong_alias (__lroundf, __llroundf)

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

commit cd1175a373590f053bea8aa9f2dfaeae13906aa9
Author: Richard Henderson <rth@twiddle.net>
Date:   Thu Jul 3 08:45:57 2014 -0700

    alpha: Remove round and roundf implementations
    
    Two bugs in these implementations: First is that the add of 0.5
    was not done in chopped rounding mode (easily fixable).  Second
    is that the method generates incorrect inexact exceptions for
    small integral values (not easily fixable).

diff --git a/ChangeLog b/ChangeLog
index 9170174..87b7a93 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2014-07-03  Richard Henderson  <rth@redhat.com>
 
+	* sysdeps/alpha/fpu/s_round.c: Remove file.
+	* sysdeps/alpha/fpu/s_roundf.c: Remove file.
+
 	* elf/dl-support.c (HP_TIMING_AVAIL): Do not redefine.
 	(_dl_non_dynamic_init): Check HP_SMALL_TIMING_AVAIL instead.
 	* elf/rtld.c (HP_TIMING_AVAIL): Do not redefine.
diff --git a/sysdeps/alpha/fpu/s_round.c b/sysdeps/alpha/fpu/s_round.c
deleted file mode 100644
index 62a8e72..0000000
--- a/sysdeps/alpha/fpu/s_round.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Copyright (C) 2007-2014 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library.  If not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <math.h>
-#include <math_ldbl_opt.h>
-
-
-double
-__round (double x)
-{
-  const double almost_half = 0x1.fffffffffffffp-2;
-  const double two52 = 0x1.0p52;
-  double tmp, r;
-
-  __asm (
-#ifdef _IEEE_FP_INEXACT
-	 "addt/suic %2, %3, %1\n\tsubt/suic %1, %3, %0"
-#else
-	 "addt/suc %2, %3, %1\n\tsubt/suc %1, %3, %0"
-#endif
-	 : "=&f"(r), "=&f"(tmp)
-	 : "f"(fabs (x) + almost_half), "f"(two52));
-
-  return copysign (r, x);
-}
-
-weak_alias (__round, round)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__round, __roundl)
-weak_alias (__roundl, roundl)
-#endif
-#if LONG_DOUBLE_COMPAT(libm, GLIBC_2_1)
-compat_symbol (libm, __round, roundl, GLIBC_2_1);
-#endif
diff --git a/sysdeps/alpha/fpu/s_roundf.c b/sysdeps/alpha/fpu/s_roundf.c
deleted file mode 100644
index a07ffa3..0000000
--- a/sysdeps/alpha/fpu/s_roundf.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Copyright (C) 2007-2014 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-   Contributed by Richard Henderson.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library.  If not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <math.h>
-
-
-float
-__roundf (float x)
-{
-  const float almost_half = 0x1.fffffep-2;
-  const float two23 = 0x1.0p23;
-  float r, tmp;
-
-  __asm (
-#ifdef _IEEE_FP_INEXACT
-	 "adds/suic %2, %3, %1\n\tsubs/suic %1, %3, %0"
-#else
-	 "adds/suc %2, %3, %1\n\tsubs/suc %1, %3, %0"
-#endif
-	 : "=&f"(r), "=&f"(tmp)
-	 : "f"(fabsf (x) + almost_half), "f"(two23));
-
-  /* round(-0) == -0, and in general we'll always have the same
-     sign as our input.  */
-  return copysignf (r, x);
-}
-
-weak_alias (__roundf, roundf)

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

Summary of changes:
 ChangeLog                        |   13 ++++++++++
 sysdeps/alpha/fpu/math_private.h |    6 ++++
 sysdeps/alpha/fpu/s_lround.c     |    8 +++---
 sysdeps/alpha/fpu/s_lroundf.c    |    8 +++---
 sysdeps/alpha/fpu/s_nearbyint.c  |   27 +--------------------
 sysdeps/alpha/fpu/s_nearbyintf.c |   46 ------------------------------------
 sysdeps/alpha/fpu/s_round.c      |   48 --------------------------------------
 sysdeps/alpha/fpu/s_roundf.c     |   43 ----------------------------------
 8 files changed, 28 insertions(+), 171 deletions(-)
 delete mode 100644 sysdeps/alpha/fpu/s_nearbyintf.c
 delete mode 100644 sysdeps/alpha/fpu/s_round.c
 delete mode 100644 sysdeps/alpha/fpu/s_roundf.c


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]