diff options
author | zack <zack@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-03-14 00:58:32 +0000 |
---|---|---|
committer | zack <zack@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-03-14 00:58:32 +0000 |
commit | 02be28b39d2c30bcde56930bd200f008068f51a5 (patch) | |
tree | ccab7edf12c9ffc3898e11aebb74de9fd06f46a0 /gcc/hwint.h | |
parent | a00bb681a14b69dee24c0af16148309ed4a3e5b6 (diff) | |
download | gcc-02be28b39d2c30bcde56930bd200f008068f51a5.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@40446 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/hwint.h')
-rw-r--r-- | gcc/hwint.h | 55 |
1 files changed, 36 insertions, 19 deletions
diff --git a/gcc/hwint.h b/gcc/hwint.h index 28614d5ee5b..e4ec51cba7a 100644 --- a/gcc/hwint.h +++ b/gcc/hwint.h @@ -9,24 +9,21 @@ #ifndef __HWINT_H__ #define __HWINT_H__ -/* This describes the machine the compiler is hosted on. The defaults - we provide describe the standard 32 bit host since that is the most - common type supported in gcc. */ -#ifndef HOST_BITS_PER_CHAR -# define HOST_BITS_PER_CHAR 8 -#endif -#ifndef HOST_BITS_PER_SHORT -# define HOST_BITS_PER_SHORT 16 -#endif -#ifndef HOST_BITS_PER_INT -# define HOST_BITS_PER_INT 32 -#endif -#ifndef HOST_BITS_PER_LONG -# define HOST_BITS_PER_LONG 32 -#endif -#ifndef HOST_BITS_PER_LONGLONG -# define HOST_BITS_PER_LONGLONG 64 -#endif +/* 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. */ @@ -42,7 +39,6 @@ #endif /* ! HOST_BITS_PER_WIDE_INT */ - /* Provide defaults for the way to print a HOST_WIDE_INT in various manners. */ @@ -106,4 +102,25 @@ # 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__ */ |