This is the mail archive of the libc-alpha@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]

PATCH: use i386 bits/huge_vall.h for i386/x86-64


Hi,

This patch uses i386 bits/huge_vall.h for i386/x86-64.  The diff on
x86-64 is:

--- ../../glibc/release/x86_64-linux/usr/include/bits/huge_vall.h	2012-05-30 12:49:46.004993080 -0700
+++ usr/include/bits/huge_vall.h	2012-05-30 12:56:20.071105031 -0700
@@ -1,6 +1,7 @@
-/* Default `HUGE_VALL' constant.
+/* `HUGE_VALL' constant for ix86 (where it is infinity).
    Used by <stdlib.h> and <math.h> functions for overflow.
-   Copyright (C) 1992, 1996, 1997, 2004 Free Software Foundation, Inc.
+   Copyright (C) 1992, 1995, 1996, 1997, 1999, 2000, 2004
+   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
@@ -23,6 +24,19 @@
 
 #if __GNUC_PREREQ(3,3)
 # define HUGE_VALL	(__builtin_huge_vall())
+#elif __GNUC_PREREQ(2,96)
+# define HUGE_VALL	(__extension__ 0x1.0p32767L)
 #else
-# define HUGE_VALL	((long double) HUGE_VAL)
-#endif
+
+# define __HUGE_VALL_bytes	{ 0, 0, 0, 0, 0, 0, 0, 0x80, 0xff, 0x7f, 0, 0 }
+
+# define __huge_vall_t	union { unsigned char __c[12]; long double __ld; }
+# ifdef __GNUC__
+#  define HUGE_VALL	(__extension__ \
+			 ((__huge_vall_t) { __c: __HUGE_VALL_bytes }).__ld)
+# else	/* Not GCC.  */
+static __huge_vall_t __huge_vall = { __HUGE_VALL_bytes };
+#  define HUGE_VALL	(__huge_vall.__ld)
+#  endif /* GCC.  */
+
+#endif /* GCC 2.95 */

Since on Linux/x86-64, __GNUC_PREREQ(2,96) is always true, this doesn't
change anything for Linux/x86-64.  OK to install?

Thanks.

H.J.
--
	[BZ #14117]
	* sysdeps/i386/bits/huge_vall.h: Renamed to ...
	* sysdeps/x86/bits/huge_vall.h: This.

diff --git a/sysdeps/i386/bits/huge_vall.h b/sysdeps/x86/bits/huge_vall.h
similarity index 100%
rename from sysdeps/i386/bits/huge_vall.h
rename to sysdeps/x86/bits/huge_vall.h


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