libgfortran.h (GFC_REAL_*_HUGE, [...]): Remove.

* libgfortran.h (GFC_REAL_*_HUGE, GFC_REAL_*_DIGITS,
	GFC_REAL_*_RADIX): Remove.
	* mk-kinds-h.sh: Define GFC_REAL_*_HUGE, GFC_REAL_*_DIGITS and
	GFC_REAL_*_RADIX. Don't define GFC_REAL_LARGEST_FORMAT and
	GFC_REAL_LARGEST.

From-SVN: r129636
This commit is contained in:
Francois-Xavier Coudert 2007-10-25 23:32:07 +00:00 committed by François-Xavier Coudert
parent 691307546e
commit 1fa6df85b1
3 changed files with 37 additions and 41 deletions

View File

@ -1,3 +1,11 @@
2007-10-26 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
* libgfortran.h (GFC_REAL_*_HUGE, GFC_REAL_*_DIGITS,
GFC_REAL_*_RADIX): Remove.
* mk-kinds-h.sh: Define GFC_REAL_*_HUGE, GFC_REAL_*_DIGITS and
GFC_REAL_*_RADIX. Don't define GFC_REAL_LARGEST_FORMAT and
GFC_REAL_LARGEST.
2007-10-19 Ben Elliston <bje@au.ibm.com>
* intrinsics/signal.c (alarm_sub_i4): Mark conditionally unused

View File

@ -249,33 +249,6 @@ internal_proto(l8_to_l4_offset);
(GFC_INTEGER_16)((((GFC_UINTEGER_16)1) << 127) - 1)
#endif
#define GFC_REAL_4_HUGE FLT_MAX
#define GFC_REAL_8_HUGE DBL_MAX
#ifdef HAVE_GFC_REAL_10
#define GFC_REAL_10_HUGE LDBL_MAX
#endif
#ifdef HAVE_GFC_REAL_16
#define GFC_REAL_16_HUGE LDBL_MAX
#endif
#define GFC_REAL_4_DIGITS FLT_MANT_DIG
#define GFC_REAL_8_DIGITS DBL_MANT_DIG
#ifdef HAVE_GFC_REAL_10
#define GFC_REAL_10_DIGITS LDBL_MANT_DIG
#endif
#ifdef HAVE_GFC_REAL_16
#define GFC_REAL_16_DIGITS LDBL_MANT_DIG
#endif
#define GFC_REAL_4_RADIX FLT_RADIX
#define GFC_REAL_8_RADIX FLT_RADIX
#ifdef HAVE_GFC_REAL_10
#define GFC_REAL_10_RADIX FLT_RADIX
#endif
#ifdef HAVE_GFC_REAL_16
#define GFC_REAL_16_RADIX FLT_RADIX
#endif
typedef struct descriptor_dimension
{

View File

@ -31,6 +31,7 @@ for k in $possible_integer_kinds; do
echo "typedef GFC_INTEGER_${k} GFC_LOGICAL_${k};"
echo "#define HAVE_GFC_LOGICAL_${k}"
echo "#define HAVE_GFC_INTEGER_${k}"
echo ""
fi
rm -f tmp$$.*
done
@ -41,33 +42,47 @@ echo "#define GFC_DEFAULT_CHAR ${smallest}"
echo ""
largest_ctype=""
for k in $possible_real_kinds; do
echo " real (kind=$k) :: x" > tmp$$.f90
echo " end" >> tmp$$.f90
if $compile -c tmp$$.f90 > /dev/null 2>&1; then
case $k in
4) ctype="float" ;;
8) ctype="double" ;;
10) ctype="long double" ;;
16) ctype="long double" ;;
4) ctype="float" ; suffix="f" ;;
8) ctype="double" ; suffix="" ;;
10) ctype="long double" ; suffix="l" ;;
16) ctype="long double" ; suffix="l" ;;
*) echo "$0: Unknown type" >&2 ; exit 1 ;;
esac
largest_ctype="$ctype"
# Check for the value of HUGE
echo "print *, huge(0._$k) ; end" > tmq$$.f90
huge=`$compile -c -fdump-parse-tree tmq$$.f90 | grep TRANSFER \
| sed 's/ *TRANSFER *// ; s/_.*//'`
rm -f tmq$$.*
# Check for the value of DIGITS
echo "print *, digits(0._$k) ; end" > tmq$$.f90
digits=`$compile -c -fdump-parse-tree tmq$$.f90 | grep TRANSFER \
| sed 's/ *TRANSFER *//'`
rm -f tmq$$.*
# Check for the value of RADIX
echo "print *, radix(0._$k) ; end" > tmq$$.f90
radix=`$compile -c -fdump-parse-tree tmq$$.f90 | grep TRANSFER \
| sed 's/ *TRANSFER *//'`
rm -f tmq$$.*
# Output the information we've gathered
echo "typedef ${ctype} GFC_REAL_${k};"
echo "typedef complex ${ctype} GFC_COMPLEX_${k};"
echo "#define HAVE_GFC_REAL_${k}"
echo "#define HAVE_GFC_COMPLEX_${k}"
echo "#define GFC_REAL_${k}_HUGE ${huge}${suffix}"
echo "#define GFC_REAL_${k}_DIGITS ${digits}"
echo "#define GFC_REAL_${k}_RADIX ${radix}"
echo ""
fi
rm -f tmp$$.*
done
case $largest_ctype in
float) echo "#define GFC_REAL_LARGEST_FORMAT \"\"" ;;
double) echo "#define GFC_REAL_LARGEST_FORMAT \"l\"" ;;
"long double") echo "#define GFC_REAL_LARGEST_FORMAT \"L\"" ;;
*) echo "$0: Unknown type" >&2 ; exit 1 ;;
esac
echo "#define GFC_REAL_LARGEST $largest_ctype"
exit 0