This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


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

gcc/config/float-i64.h is wrong



Current egcs (as of 19:00 GMT, 98-06-12) contains a wrong version for
float.h which gets installed on intel platforms via:
cp ../../egcs-cvs/gcc/config/float-i64.h gfloat.h
[...]
rm -f include/float.h
if [ -s gfloat.h ]; then \
  cp gfloat.h include/float.h && \
  chmod a+r include/float.h; \
else :; fi

The bug in float-i64.h is that LDBL_* is the same as DBL_*.  But intel 
uses an extended long double format.  I've appended a diff between
float-i64.h and an old automatically generated float.h.  

Please fix this since this leads to quite interesting;-) problems for
long double computations (e.g. printing /.99999999999999909051e+03
instead of 9.9... in some glibc tests).

My system: i486-pc-linux-gnu (Linux 2.1.105 with glibc 2.1 snapshot on 
i486).

Andreas

--- config/float-i64.h	Tue Jan 13 21:36:00 1998
+++ /opt/egcs/lib/gcc-lib/i486-pc-linux-gnu/egcs-2.91.08/include/float.h	Thu Feb 19 19:14:44 1998
@@ -1,6 +1,6 @@
-/* float.h for target with IEEE 32 bit and 64 bit floating point formats */
-#ifndef _FLOAT_H_
-#define _FLOAT_H_
+/* float.h */
+#ifndef _FLOAT_H___
+#define _FLOAT_H___
 /* Produced by enquire version 4.3, CWI, Amsterdam */
 
    /* Radix of exponent representation */
@@ -67,30 +67,37 @@
 
    /* Number of base-FLT_RADIX digits in the significand of a long double */
 #undef LDBL_MANT_DIG
-#define LDBL_MANT_DIG 53
+#define LDBL_MANT_DIG 64
    /* Number of decimal digits of precision in a long double */
 #undef LDBL_DIG
-#define LDBL_DIG 15
+#define LDBL_DIG 18
    /* Difference between 1.0 and the minimum long double greater than 1.0 */
 #undef LDBL_EPSILON
-#define LDBL_EPSILON 2.2204460492503131e-16L
+#ifndef __LDBL_UNION__
+#define __LDBL_UNION__
+union __convert_long_double {
+  unsigned __convert_long_double_i[4];
+  long double __convert_long_double_d;
+};
+#endif
+#define LDBL_EPSILON (__extension__ ((union __convert_long_double) {__convert_long_double_i: {0x0, 0x80000000, 0x3fc0, 0x0}}).__convert_long_double_d)
    /* Minimum int x such that FLT_RADIX**(x-1) is a normalised long double */
 #undef LDBL_MIN_EXP
-#define LDBL_MIN_EXP (-1021)
+#define LDBL_MIN_EXP (-16381)
    /* Minimum normalised long double */
 #undef LDBL_MIN
-#define LDBL_MIN 2.2250738585072014e-308L
+#define LDBL_MIN (__extension__ ((union __convert_long_double) {__convert_long_double_i: {0x0, 0x80000000, 0x1, 0x0}}).__convert_long_double_d)
    /* Minimum int x such that 10**x is a normalised long double */
 #undef LDBL_MIN_10_EXP
-#define LDBL_MIN_10_EXP (-307)
+#define LDBL_MIN_10_EXP (-4931)
    /* Maximum int x such that FLT_RADIX**(x-1) is a representable long double */
 #undef LDBL_MAX_EXP
-#define LDBL_MAX_EXP 1024
+#define LDBL_MAX_EXP 16384
    /* Maximum long double */
 #undef LDBL_MAX
-#define LDBL_MAX 1.7976931348623157e+308L
+#define LDBL_MAX (__extension__ ((union __convert_long_double) {__convert_long_double_i: {0xffffffff, 0xffffffff, 0x107ffe, 0x0}}).__convert_long_double_d)
    /* Maximum int x such that 10**x is a representable long double */
 #undef LDBL_MAX_10_EXP
-#define LDBL_MAX_10_EXP 308
+#define LDBL_MAX_10_EXP 4932
 
-#endif /*  _FLOAT_H_ */
+#endif /*  _FLOAT_H___ */

-- 
 Andreas Jaeger   aj@arthur.rhein-neckar.de    jaeger@informatik.uni-kl.de
  for pgp-key finger ajaeger@alma.student.uni-kl.de


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