Blame SOURCES/gcc32-libstdc++-limits.patch

4ac4fd
2004-10-06  Jakub Jelinek  <jakub@redhat.com>
4ac4fd
4ac4fd
	* config/os/gnu-linux/bits/os_defines.h: Define
4ac4fd
	__glibcpp_{float,double,long_double}* macros.
4ac4fd
	* config/cpu/x86-64/bits/cpu_limits.h (__glibcpp_long_bits): Only
4ac4fd
	define to 64 if __x86_64__.
4ac4fd
	* include/std/std_limits.h (__glibcpp_f*_round_error): Only define
4ac4fd
	if not yet defined.
4ac4fd
4ac4fd
--- libstdc++-v3/config/os/gnu-linux/bits/os_defines.h.jj	2002-06-03 17:33:17.000000000 +0200
4ac4fd
+++ libstdc++-v3/config/os/gnu-linux/bits/os_defines.h	2004-10-06 20:07:16.601101686 +0200
4ac4fd
@@ -73,4 +73,87 @@ typedef __loff_t __off64_t;
4ac4fd
 #define __glibcpp_long_double_bits 64
4ac4fd
 #endif
4ac4fd
 
4ac4fd
+/* RHEL3 hack.  */
4ac4fd
+#if defined(__GNUC__) && !defined(__INTEL_COMPILER) && !defined(__IBMCPP__) \
4ac4fd
+    && (defined(__i386__) || defined(__x86_64__) || defined(__ia64__) \
4ac4fd
+        || defined(__s390__) || defined(__s390x__) || defined(__powerpc__) \
4ac4fd
+        || defined(__powerpc64__))
4ac4fd
+#define __glibcpp_float_has_quiet_NaN true
4ac4fd
+#define __glibcpp_float_has_signaling_NaN true
4ac4fd
+#define __glibcpp_float_has_denorm denorm_present
4ac4fd
+#define __glibcpp_float_has_infinity true
4ac4fd
+#define __glibcpp_float_round_style round_to_nearest
4ac4fd
+#define __glibcpp_float_is_iec559 true
4ac4fd
+#define __glibcpp_double_has_quiet_NaN true
4ac4fd
+#define __glibcpp_double_has_signaling_NaN true
4ac4fd
+#define __glibcpp_double_has_denorm denorm_present
4ac4fd
+#define __glibcpp_double_has_infinity true
4ac4fd
+#define __glibcpp_double_round_style round_to_nearest
4ac4fd
+#define __glibcpp_double_is_iec559 true
4ac4fd
+#define __glibcpp_long_double_has_quiet_NaN true
4ac4fd
+#define __glibcpp_long_double_has_signaling_NaN true
4ac4fd
+#define __glibcpp_long_double_has_denorm denorm_present
4ac4fd
+#define __glibcpp_long_double_has_infinity true
4ac4fd
+#define __glibcpp_long_double_round_style round_to_nearest
4ac4fd
+#define __glibcpp_long_double_is_iec559 true
4ac4fd
+
4ac4fd
+#define __glibcpp_f32_round_error 0.5F
4ac4fd
+#define __glibcpp_f64_round_error 0.5
4ac4fd
+#define __glibcpp_f80_round_error 0.5L
4ac4fd
+#define __glibcpp_f96_round_error 0.5L
4ac4fd
+#define __glibcpp_f128_round_error 0.5L
4ac4fd
+
4ac4fd
+#define __glibcpp_float_infinity 1.0e+40F
4ac4fd
+#define __glibcpp_double_infinity 1.0e+320
4ac4fd
+#define __glibcpp_long_double_infinity 1.0e+5000L
4ac4fd
+
4ac4fd
+#define __glibcpp_float_denorm_min 1.40129846e-45F
4ac4fd
+#define __glibcpp_double_denorm_min 4.9406564584124654e-324
4ac4fd
+
4ac4fd
+#define __glibcpp_float_quiet_NaN \
4ac4fd
+  (__extension__ ((union { unsigned int __l; float __d; })		\
4ac4fd
+		  { __l: 0x7fc00000 }).__d)
4ac4fd
+#define __glibcpp_double_quiet_NaN \
4ac4fd
+  (__extension__ ((union { unsigned long long __l; double __d; })	\
4ac4fd
+		  { __l: 0x7ff8000000000000ULL }).__d)
4ac4fd
+
4ac4fd
+#define __glibcpp_float_signaling_NaN \
4ac4fd
+  (__extension__ ({ union { unsigned int __l; float __d; } __u;		\
4ac4fd
+		    __u.__l = 0x7fa00000;				\
4ac4fd
+		    __asm ("" : : "r" (&__u) : "memory"); __u.__d; }))
4ac4fd
+#define __glibcpp_double_signaling_NaN \
4ac4fd
+  (__extension__ ({ union { unsigned long long __l; double __d; } __u;	\
4ac4fd
+		    __u.__l = 0x7ff4000000000000ULL;			\
4ac4fd
+		    __asm ("" : : "r" (&__u) : "memory"); __u.__d; }))
4ac4fd
+
4ac4fd
+#if __glibcpp_long_double_bits == 80
4ac4fd
+
4ac4fd
+#define __glibcpp_long_double_denorm_min 3.64519953188247460253e-4951L
4ac4fd
+#define __glibcpp_long_double_quiet_NaN \
4ac4fd
+  (__extension__ ({ union { unsigned long long __l[2];			\
4ac4fd
+			    long double __d; } __u;			\
4ac4fd
+		    __u.__l[0] = 0xcULL << 60; __u.__l[1] = 0x7fff;	\
4ac4fd
+		    __u.__d; }))
4ac4fd
+#define __glibcpp_long_double_signaling_NaN \
4ac4fd
+  (__extension__ ({ union { unsigned long long __l[2];			\
4ac4fd
+			    long double __d; } __u;			\
4ac4fd
+		    __u.__l[0] = 0xaULL << 60; __u.__l[1] = 0x7fff;	\
4ac4fd
+		    __asm ("" : : "r" (&__u) : "memory"); __u.__d; }))
4ac4fd
+
4ac4fd
+#else
4ac4fd
+
4ac4fd
+#define __glibcpp_long_double_denorm_min 4.9406564584124654e-324L
4ac4fd
+#define __glibcpp_long_double_quiet_NaN \
4ac4fd
+  (__extension__ ((union { unsigned long long __l; long double __d; })	\
4ac4fd
+		  { __l: 0x7ff8000000000000ULL }).__d)
4ac4fd
+#define __glibcpp_long_double_signaling_NaN \
4ac4fd
+  (__extension__ ({ union { unsigned long long __l;			\
4ac4fd
+			    long double __d; } __u;			\
4ac4fd
+		     __u.__l = 0x7ff4000000000000ULL;			\
4ac4fd
+		     __asm ("" : : "r" (&__u) : "memory"); __u.__d; }))
4ac4fd
+
4ac4fd
+#endif
4ac4fd
+
4ac4fd
+#endif
4ac4fd
+
4ac4fd
 #endif
4ac4fd
--- libstdc++-v3/config/cpu/x86-64/bits/cpu_limits.h.jj	2002-01-12 23:14:42.000000000 +0100
4ac4fd
+++ libstdc++-v3/config/cpu/x86-64/bits/cpu_limits.h	2004-10-06 17:13:39.369189090 +0200
4ac4fd
@@ -28,7 +28,9 @@
4ac4fd
 #ifndef _GLIBCPP_CPU_LIMITS
4ac4fd
 #define _GLIBCPP_CPU_LIMITS 1
4ac4fd
 
4ac4fd
+#ifdef __x86_64__
4ac4fd
 #define __glibcpp_long_bits 64
4ac4fd
+#endif
4ac4fd
 
4ac4fd
 #define __glibcpp_long_double_bits 80
4ac4fd
 
4ac4fd
--- libstdc++-v3/include/std/std_limits.h.jj	2002-10-16 16:12:23.000000000 +0200
4ac4fd
+++ libstdc++-v3/include/std/std_limits.h	2004-10-06 19:59:26.602318867 +0200
4ac4fd
@@ -180,7 +180,9 @@
4ac4fd
 #define __glibcpp_f32_digits10 6
4ac4fd
 #define __glibcpp_f32_radix 2
4ac4fd
 #define __glibcpp_f32_epsilon 1.19209290e-07F
4ac4fd
+#ifndef __glibcpp_f32_round_error
4ac4fd
 #define __glibcpp_f32_round_error 1.0F
4ac4fd
+#endif
4ac4fd
 #define __glibcpp_f32_min_exponent -125
4ac4fd
 #define __glibcpp_f32_min_exponent10 -37
4ac4fd
 #define __glibcpp_f32_max_exponent 128
4ac4fd
@@ -191,7 +193,9 @@
4ac4fd
 #define __glibcpp_f64_digits10 15
4ac4fd
 #define __glibcpp_f64_radix 2
4ac4fd
 #define __glibcpp_f64_epsilon 2.2204460492503131e-16
4ac4fd
+#ifndef __glibcpp_f64_round_error
4ac4fd
 #define __glibcpp_f64_round_error 1.0
4ac4fd
+#endif
4ac4fd
 #define __glibcpp_f64_min_exponent -1021
4ac4fd
 #define __glibcpp_f64_min_exponent10 -307
4ac4fd
 #define __glibcpp_f64_max_exponent 1024
4ac4fd
@@ -202,7 +206,9 @@
4ac4fd
 #define __glibcpp_f80_digits10 18
4ac4fd
 #define __glibcpp_f80_radix 2
4ac4fd
 #define __glibcpp_f80_epsilon 1.08420217248550443401e-19L
4ac4fd
+#ifndef __glibcpp_f80_round_error
4ac4fd
 #define __glibcpp_f80_round_error 1.0L
4ac4fd
+#endif
4ac4fd
 #define __glibcpp_f80_min_exponent -16381
4ac4fd
 #define __glibcpp_f80_min_exponent10 -4931
4ac4fd
 #define __glibcpp_f80_max_exponent 16384
4ac4fd
@@ -213,7 +219,9 @@
4ac4fd
 #define __glibcpp_f96_digits10 18
4ac4fd
 #define __glibcpp_f96_radix 2
4ac4fd
 #define __glibcpp_f96_epsilon 1.08420217248550443401e-19L
4ac4fd
+#ifndef __glibcpp_f96_round_error
4ac4fd
 #define __glibcpp_f96_round_error 1.0L
4ac4fd
+#endif
4ac4fd
 #define __glibcpp_f96_min_exponent -16382
4ac4fd
 #define __glibcpp_f96_min_exponent10 -4931
4ac4fd
 #define __glibcpp_f96_max_exponent 16384
4ac4fd
@@ -224,7 +232,9 @@
4ac4fd
 #define __glibcpp_f128_digits10 33
4ac4fd
 #define __glibcpp_f128_radix 2
4ac4fd
 #define __glibcpp_f128_epsilon 1.925929944387235853055977942584927319E-34L
4ac4fd
+#ifndef __glibcpp_f128_round_error
4ac4fd
 #define __glibcpp_f128_round_error 1.0L
4ac4fd
+#endif
4ac4fd
 #define __glibcpp_f128_min_exponent -16381
4ac4fd
 #define __glibcpp_f128_min_exponent10 -4931
4ac4fd
 #define __glibcpp_f128_max_exponent 16384