[PATCH] float.h for sparc*-linux BI_ARCH configurations

Jakub Jelinek jj@sunsite.ms.mff.cuni.cz
Fri Jun 11 00:50:00 GMT 1999


Hi!

As sparc-*-linux uses long double == double 64bit IEEE, while
sparc64-*-linux uses 128bit IEEE long double and both targets are supported
by the same compiler, I had to create a separate float-sparc.h for this
case, which uses C preprocessor macros to either define all LDBL* constants
to DBL*, or define the same LDBL* constants as float-i128.h does. Otherwise
either sparc32 or sparc64 compiles will be broken in the BI_ARCH compiler.

Fri Jun 11 09:40:51 1999  Jakub Jelinek  <jj@ultra.linux.cz>

        * config/float-sparc.h: New file.
	* configure.in: Use float_format=sparc for sparc-*-linux-gnulibc1,
	sparc-*-linux-gnu and sparc64-*-linux*.

--- gcc/config/float-sparc.h.jj	Fri Jun 11 09:34:30 1999
+++ gcc/config/float-sparc.h	Fri Jun 11 09:28:16 1999
@@ -0,0 +1,122 @@
+/* float.h for target with IEEE 32, 64 and 128 bit SPARC floating point formats
+   (on sparc-linux long double is 64 bit, while on sparc64-linux 128 bit) */
+#ifndef _FLOAT_H_
+#define _FLOAT_H_
+/* Produced by enquire version 4.3, CWI, Amsterdam */
+
+   /* Radix of exponent representation */
+#undef FLT_RADIX
+#define FLT_RADIX 2
+   /* Number of base-FLT_RADIX digits in the significand of a float */
+#undef FLT_MANT_DIG
+#define FLT_MANT_DIG 24
+   /* Number of decimal digits of precision in a float */
+#undef FLT_DIG
+#define FLT_DIG 6
+   /* Addition rounds to 0: zero, 1: nearest, 2: +inf, 3: -inf, -1: unknown */
+#undef FLT_ROUNDS
+#define FLT_ROUNDS 1
+   /* Difference between 1.0 and the minimum float greater than 1.0 */
+#undef FLT_EPSILON
+#define FLT_EPSILON 1.19209290e-07F
+   /* Minimum int x such that FLT_RADIX**(x-1) is a normalised float */
+#undef FLT_MIN_EXP
+#define FLT_MIN_EXP (-125)
+   /* Minimum normalised float */
+#undef FLT_MIN
+#define FLT_MIN 1.17549435e-38F
+   /* Minimum int x such that 10**x is a normalised float */
+#undef FLT_MIN_10_EXP
+#define FLT_MIN_10_EXP (-37)
+   /* Maximum int x such that FLT_RADIX**(x-1) is a representable float */
+#undef FLT_MAX_EXP
+#define FLT_MAX_EXP 128
+   /* Maximum float */
+#undef FLT_MAX
+#define FLT_MAX 3.40282347e+38F
+   /* Maximum int x such that 10**x is a representable float */
+#undef FLT_MAX_10_EXP
+#define FLT_MAX_10_EXP 38
+
+   /* Number of base-FLT_RADIX digits in the significand of a double */
+#undef DBL_MANT_DIG
+#define DBL_MANT_DIG 53
+   /* Number of decimal digits of precision in a double */
+#undef DBL_DIG
+#define DBL_DIG 15
+   /* Difference between 1.0 and the minimum double greater than 1.0 */
+#undef DBL_EPSILON
+#define DBL_EPSILON 2.2204460492503131e-16
+   /* Minimum int x such that FLT_RADIX**(x-1) is a normalised double */
+#undef DBL_MIN_EXP
+#define DBL_MIN_EXP (-1021)
+   /* Minimum normalised double */
+#undef DBL_MIN
+#define DBL_MIN 2.2250738585072014e-308
+   /* Minimum int x such that 10**x is a normalised double */
+#undef DBL_MIN_10_EXP
+#define DBL_MIN_10_EXP (-307)
+   /* Maximum int x such that FLT_RADIX**(x-1) is a representable double */
+#undef DBL_MAX_EXP
+#define DBL_MAX_EXP 1024
+   /* Maximum double */
+#undef DBL_MAX
+#define DBL_MAX 1.7976931348623157e+308
+   /* Maximum int x such that 10**x is a representable double */
+#undef DBL_MAX_10_EXP
+#define DBL_MAX_10_EXP 308
+
+#if defined(__sparc_v9__) || defined(__sparcv9) || defined(__arch64__)
+
+   /* Number of base-FLT_RADIX digits in the significand of a long double */
+#undef LDBL_MANT_DIG
+#define LDBL_MANT_DIG 113
+   /* Number of decimal digits of precision in a long double */
+#undef LDBL_DIG
+#define LDBL_DIG 33
+   /* Difference between 1.0 and the minimum long double greater than 1.0 */
+#undef LDBL_EPSILON
+#define LDBL_EPSILON 1.925929944387235853055977942584927319E-34L
+   /* Minimum int x such that FLT_RADIX**(x-1) is a normalised long double */
+#undef LDBL_MIN_EXP
+#define LDBL_MIN_EXP (-16381)
+   /* Minimum normalised long double */
+#undef LDBL_MIN
+#define LDBL_MIN 3.362103143112093506262677817321752603E-4932L
+   /* Minimum int x such that 10**x is a normalised long double */
+#undef LDBL_MIN_10_EXP
+#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 16384
+   /* Maximum long double */
+#undef LDBL_MAX
+#define LDBL_MAX 1.189731495357231765085759326628007016E+4932L
+   /* Maximum int x such that 10**x is a representable long double */
+#undef LDBL_MAX_10_EXP
+#define LDBL_MAX_10_EXP 4932
+
+#else /* sparc32 */
+
+#undef LDBL_MANT_DIG
+#define LDBL_MANT_DIG DBL_MANT_DIG
+#undef LDBL_DIG
+#define LDBL_DIG DBL_DIG
+#undef LDBL_EPSILON
+#define LDBL_EPSILON DBL_EPSILON
+#undef LDBL_MIN_EXP
+#define LDBL_MIN_EXP DBL_MIN_EXP
+#undef LDBL_MIN
+#define LDBL_MIN DBL_MIN
+#undef LDBL_MIN_10_EXP
+#define LDBL_MIN_10_EXP DBL_MIN_10_EXP
+#undef LDBL_MAX_EXP
+#define LDBL_MAX_EXP DBL_MAX_EXP
+#undef LDBL_MAX
+#define LDBL_MAX DBLX_MAX
+#undef LDBL_MAX_10_EXP
+#define LDBL_MAX_10_EXP DBL_MAX_10_EXP
+
+#endif /* sparc32 */
+
+#endif /*  _FLOAT_H_ */
--- gcc/configure.in.jj	Wed Jun  9 09:39:12 1999
+++ gcc/configure.in	Fri Jun 11 09:33:46 1999
@@ -3049,6 +3049,7 @@ changequote([,])dnl
 		tmake_file="t-linux t-linux-gnulibc1"
 		extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
 		gnu_ld=yes
+		float_format=sparc
 		;;
 	sparc-*-linux-gnu*)		# Sparc's running GNU/Linux, libc6
 		xm_file="${xm_file} sparc/xm-linux.h"
@@ -3060,6 +3061,7 @@ changequote([,])dnl
  		if test x$enable_threads = xyes; then
  			thread_file='posix'
  		fi
+		float_format=sparc
 		;;
 	sparc-*-lynxos*)
 		if test x$gas = xyes
@@ -3202,6 +3204,7 @@ changequote([,])dnl
 		xmake_file=x-linux
 		extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
 		gnu_ld=yes
+		float_format=sparc
 		;;
 # This hasn't been upgraded to GCC 2.
 #	tahoe-harris-*)			# Harris tahoe, using COFF.
--- gcc/configure.jj	Wed Jun  9 09:39:12 1999
+++ gcc/configure	Fri Jun 11 09:33:52 1999
@@ -5354,6 +5354,7 @@ for machine in $build $host $target; do
 		tmake_file="t-linux t-linux-gnulibc1"
 		extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
 		gnu_ld=yes
+		float_format=sparc
 		;;
 	sparc-*-linux-gnu*)		# Sparc's running GNU/Linux, libc6
 		xm_file="${xm_file} sparc/xm-linux.h"
@@ -5365,6 +5366,7 @@ for machine in $build $host $target; do
  		if test x$enable_threads = xyes; then
  			thread_file='posix'
  		fi
+		float_format=sparc
 		;;
 	sparc-*-lynxos*)
 		if test x$gas = xyes
@@ -5505,6 +5507,7 @@ for machine in $build $host $target; do
 		xmake_file=x-linux
 		extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
 		gnu_ld=yes
+		float_format=sparc
 		;;
 # This hasn't been upgraded to GCC 2.
 #	tahoe-harris-*)			# Harris tahoe, using COFF.


Cheers,
    Jakub
___________________________________________________________________
Jakub Jelinek | jj@sunsite.mff.cuni.cz | http://sunsite.mff.cuni.cz
Administrator of SunSITE Czech Republic, MFF, Charles University
___________________________________________________________________
UltraLinux  |  http://ultra.linux.cz/  |  http://ultra.penguin.cz/
Linux version 2.3.4 on a sparc64 machine (1343.49 BogoMips)
___________________________________________________________________


More information about the Gcc-patches mailing list