8sa1-gcc/gcc/hwint.h
Zack Weinberg 75e93faacc aclocal.m4 (gcc_AC_COMPILE_CHECK_SIZEOF, [...]): New.
* aclocal.m4 (gcc_AC_COMPILE_CHECK_SIZEOF, gcc_AC_C_CHAR_BIT,
	gcc_AC_C_LONG_LONG): New.
	* configure.in: Use them.  Probe the size of short, int, long,
	and long long/__int64 if we have them.  Move all the AC_C_*
	checks together, except gcc_AC_C_CHAR_BIT which has to go
	after AC_CHECK_HEADERS(limits.h).
	Take hwint.h out of host_xm_file and build_xm_file.

	* hwint.h: Unconditionally define HOST_BITS_PER_CHAR,
	HOST_BITS_PER_SHORT, HOST_BITS_PER_INT, HOST_BITS_PER_LONG,
	and HOST_BITS_PER_LONGLONG in terms of SIZEOF_* and CHAR_BIT.
	Move the HOST_WIDEST_INT setup logic here from system.h.
	Provide HOST_WIDEST_INT even if HOST_BITS_PER_LONGLONG is not
	defined.
	* system.h: Include hwint.h after limits.h.  HOST_WIDEST_INT
	is now handled by hwint.h.

	* config/alpha/xm-alpha-interix.h, config/alpha/xm-vms.h,
	config/c4x/xm-c4x.h, config/i370/xm-oe.h,
	config/ia64/xm-ia64.h: Don't define any of:
	HOST_BITS_PER_LONG, HOST_BITS_PER_CHAR, HOST_BITS_PER_SHORT,
	HOST_BITS_PER_LONGLONG.

	* config/alpha/xm-alpha.h, config/dsp16xx/xm-dsp16xx.h,
	config/h8300/xm-h8300.h, config/mips/iris6.h,
	config/mn10200/xm-mn10200.h, config/pa/xm-pa64hpux.h,
	config/sparc/xm-sp64.h: Delete.
	* config.gcc: Remove references to deleted files.

	* config/arm/xm-arm.h, config/mips/xm-mips.h: Don't define
	HOST_FLOAT_FORMAT to IEEE_FLOAT_FORMAT.
	* config/i370/xm-linux.h: Clarify floating-point situation in
	a comment.

From-SVN: r40446
2001-03-14 00:58:32 +00:00

127 lines
3.9 KiB
C

/* HOST_WIDE_INT definitions for the GNU compiler.
Copyright (C) 1998 Free Software Foundation, Inc.
This file is part of GNU CC.
Provide definitions for macros which depend on HOST_BITS_PER_INT
and HOST_BITS_PER_LONG. */
#ifndef __HWINT_H__
#define __HWINT_H__
/* This describes the machine the compiler is hosted on. */
#define HOST_BITS_PER_CHAR CHAR_BIT
#define HOST_BITS_PER_SHORT (CHAR_BIT * SIZEOF_SHORT)
#define HOST_BITS_PER_INT (CHAR_BIT * SIZEOF_INT)
#define HOST_BITS_PER_LONG (CHAR_BIT * SIZEOF_LONG)
#ifdef HAVE_LONG_LONG
# define HOST_BITS_PER_LONGLONG (CHAR_BIT * SIZEOF_LONG_LONG)
#else
/* If we're here and we're GCC, assume this is stage 2+ of a bootstrap
and 'long long' has the width of the *target*'s long long. */
# if GCC_VERSION > 3000
# define HOST_BITS_PER_LONGLONG LONG_LONG_TYPE_SIZE
# endif /* gcc */
#endif /* no long long */
/* Find the largest host integer type and set its size and type. */
#ifndef HOST_BITS_PER_WIDE_INT
# if HOST_BITS_PER_LONG > HOST_BITS_PER_INT
# define HOST_BITS_PER_WIDE_INT HOST_BITS_PER_LONG
# define HOST_WIDE_INT long
# else
# define HOST_BITS_PER_WIDE_INT HOST_BITS_PER_INT
# define HOST_WIDE_INT int
# endif
#endif /* ! HOST_BITS_PER_WIDE_INT */
/* Provide defaults for the way to print a HOST_WIDE_INT
in various manners. */
#ifndef HOST_WIDE_INT_PRINT_DEC
# if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
# define HOST_WIDE_INT_PRINT_DEC "%d"
# else
# if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
# define HOST_WIDE_INT_PRINT_DEC "%ld"
# else
# define HOST_WIDE_INT_PRINT_DEC "%lld"
# endif
# endif
#endif /* ! HOST_WIDE_INT_PRINT_DEC */
#ifndef HOST_WIDE_INT_PRINT_UNSIGNED
# if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
# define HOST_WIDE_INT_PRINT_UNSIGNED "%u"
# else
# if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
# define HOST_WIDE_INT_PRINT_UNSIGNED "%lu"
# else
# define HOST_WIDE_INT_PRINT_UNSIGNED "%llu"
# endif
# endif
#endif /* ! HOST_WIDE_INT_PRINT_UNSIGNED */
#ifndef HOST_WIDE_INT_PRINT_HEX
# if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
# define HOST_WIDE_INT_PRINT_HEX "0x%x"
# else
# if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
# define HOST_WIDE_INT_PRINT_HEX "0x%lx"
# else
# define HOST_WIDE_INT_PRINT_HEX "0x%llx"
# endif
# endif
#endif /* ! HOST_WIDE_INT_PRINT_HEX */
#ifndef HOST_WIDE_INT_PRINT_DOUBLE_HEX
# if HOST_BITS_PER_WIDE_INT == 64
# if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
# define HOST_WIDE_INT_PRINT_DOUBLE_HEX "0x%x%016x"
# else
# if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
# define HOST_WIDE_INT_PRINT_DOUBLE_HEX "0x%lx%016lx"
# else
# define HOST_WIDE_INT_PRINT_DOUBLE_HEX "0x%llx%016llx"
# endif
# endif
# else
# if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
# define HOST_WIDE_INT_PRINT_DOUBLE_HEX "0x%x%08x"
# else
# if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
# define HOST_WIDE_INT_PRINT_DOUBLE_HEX "0x%lx%08lx"
# else
# define HOST_WIDE_INT_PRINT_DOUBLE_HEX "0x%llx%08llx"
# endif
# endif
# endif
#endif /* ! HOST_WIDE_INT_PRINT_DOUBLE_HEX */
/* Find HOST_WIDEST_INT and set its bit size, type and print macros.
It will be the largest integer mode supported by the host which may
(or may not) be larger than HOST_WIDE_INT. */
#ifndef HOST_WIDEST_INT
#if defined HOST_BITS_PER_LONGLONG \
&& HOST_BITS_PER_LONGLONG > HOST_BITS_PER_LONG
# define HOST_BITS_PER_WIDEST_INT HOST_BITS_PER_LONGLONG
# define HOST_WIDEST_INT long long
# define HOST_WIDEST_INT_PRINT_DEC "%lld"
# define HOST_WIDEST_INT_PRINT_UNSIGNED "%llu"
# define HOST_WIDEST_INT_PRINT_HEX "0x%llx"
# else
# define HOST_BITS_PER_WIDEST_INT HOST_BITS_PER_LONG
# define HOST_WIDEST_INT long
# define HOST_WIDEST_INT_PRINT_DEC "%ld"
# define HOST_WIDEST_INT_PRINT_UNSIGNED "%lu"
# define HOST_WIDEST_INT_PRINT_HEX "0x%lx"
# endif /* long long wider than long */
#endif /* ! HOST_WIDEST_INT */
#endif /* __HWINT_H__ */