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.20-472-g1dca195


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  1dca195e1c50d69fa4f0d18e821ec68f5d286df4 (commit)
      from  ab70da77ea8076b49ad81a8c06103c51d4e81dc4 (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=1dca195e1c50d69fa4f0d18e821ec68f5d286df4

commit 1dca195e1c50d69fa4f0d18e821ec68f5d286df4
Author: Chris Metcalf <cmetcalf@ezchip.com>
Date:   Mon Jan 5 11:59:32 2015 -0500

    lround: provide cast for wordsize-64 version if needed
    
    Platforms with 64-bit registers where 32-bit values need to have the
    high 32 bits set in a particular way need to have an explicit cast
    when using the 64-bit sysdeps/ieee754/dbl-64/wordsize-64 version
    of llround() as lround().  This includes tilegx32, and likely MIPS.
    x32 does not need this, and AArch64 ILP32 will not either.  Require
    it to be specified in sysdep.h to be explicit.

diff --git a/ChangeLog b/ChangeLog
index 0e6e224..123b0b2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2015-01-05  Chris Metcalf  <cmetcalf@ezchip.com>
+
+	* sysdeps/ieee754/dbl-64/wordsize-64/s_llround.c [!defined _LP64
+	&& REGISTER_CAST_INT32_TO_INT64]: Provide explicit lround()
+	function with cast from llround().
+	* sysdeps/tile/sysdep.h (REGISTER_CAST_INT32_TO_INT64): Define.
+	* sysdeps/x86_64/x32/sysdep.h (REGISTER_CAST_INT32_TO_INT64):
+	Define.
+
 2015-01-05  Joseph Myers  <joseph@codesourcery.com>
 
 	[BZ #17793]
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/s_llround.c b/sysdeps/ieee754/dbl-64/wordsize-64/s_llround.c
index 8852601..8bb5252 100644
--- a/sysdeps/ieee754/dbl-64/wordsize-64/s_llround.c
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/s_llround.c
@@ -21,6 +21,7 @@
 #define __lround __hidden___lround
 
 #include <math.h>
+#include <sysdep.h>
 
 #include <math_private.h>
 
@@ -64,16 +65,31 @@ __llround (double x)
 
 weak_alias (__llround, llround)
 #ifdef NO_LONG_DOUBLE
-strong_alias (__llround, __lroundl)
-weak_alias (__llround, lroundl)
+strong_alias (__llround, __llroundl)
+weak_alias (__llround, llroundl)
 #endif
 
-/* long has the same width as long long on 64-bit machines.  */
+/* long has the same width as long long on LP64 machines, so use an alias.
+   If building for ILP32 on a machine with 64-bit registers, however,
+   use a cast if necessary.  */
 #undef lround
 #undef __lround
+#if !defined (_LP64) && REGISTER_CAST_INT32_TO_INT64
+long int
+__lround (double x)
+{
+  return __llround (x);
+}
+weak_alias (__lround, lround)
+# ifdef NO_LONG_DOUBLE
+strong_alias (__lround, __lroundl)
+weak_alias (__lround, lroundl)
+# endif
+#else
 strong_alias (__llround, __lround)
 weak_alias (__llround, lround)
-#ifdef NO_LONG_DOUBLE
-strong_alias (__llround, __llroundl)
-weak_alias (__llround, llroundl)
+# ifdef NO_LONG_DOUBLE
+strong_alias (__llround, __lroundl)
+weak_alias (__llround, lroundl)
+# endif
 #endif
diff --git a/sysdeps/tile/sysdep.h b/sysdeps/tile/sysdep.h
index ead9dba..7b3d873 100644
--- a/sysdeps/tile/sysdep.h
+++ b/sysdeps/tile/sysdep.h
@@ -108,3 +108,7 @@
 #endif
 
 #endif /* __ASSEMBLER__ */
+
+/* On tilegx, 32-bit values must have their high 32 bits sign extended;
+   random values are not allowed.  */
+#define REGISTER_CAST_INT32_TO_INT64 1
diff --git a/sysdeps/x86_64/x32/sysdep.h b/sysdeps/x86_64/x32/sysdep.h
index 9b87005..0cbc1a0 100644
--- a/sysdeps/x86_64/x32/sysdep.h
+++ b/sysdeps/x86_64/x32/sysdep.h
@@ -90,3 +90,7 @@
 # define R15_LP	"r15d"
 
 #endif	/* __ASSEMBLER__ */
+
+/* On x32, it is not required to normalize a 64-bit value before using
+   it as a 32-bit value.  */
+#define REGISTER_CAST_INT32_TO_INT64 0

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

Summary of changes:
 ChangeLog                                      |    9 +++++++
 sysdeps/ieee754/dbl-64/wordsize-64/s_llround.c |   28 ++++++++++++++++++-----
 sysdeps/tile/sysdep.h                          |    4 +++
 sysdeps/x86_64/x32/sysdep.h                    |    4 +++
 4 files changed, 39 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]