]>
git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/hwint.h
1 /* HOST_WIDE_INT definitions for the GNU compiler.
2 Copyright (C) 1998 Free Software Foundation, Inc.
4 This file is part of GNU CC.
6 Provide definitions for macros which depend on HOST_BITS_PER_INT
7 and HOST_BITS_PER_LONG. */
12 /* This describes the machine the compiler is hosted on. The defaults
13 we provide describe the standard 32 bit host since that is the most
14 common type supported in gcc. */
15 #ifndef HOST_BITS_PER_CHAR
16 # define HOST_BITS_PER_CHAR 8
18 #ifndef HOST_BITS_PER_SHORT
19 # define HOST_BITS_PER_SHORT 16
21 #ifndef HOST_BITS_PER_INT
22 # define HOST_BITS_PER_INT 32
24 #ifndef HOST_BITS_PER_LONG
25 # define HOST_BITS_PER_LONG 32
27 #ifndef HOST_BITS_PER_LONGLONG
28 # define HOST_BITS_PER_LONGLONG 64
31 /* Find the largest host integer type and set its size and type. */
33 #ifndef HOST_BITS_PER_WIDE_INT
35 # if HOST_BITS_PER_LONG > HOST_BITS_PER_INT
36 # define HOST_BITS_PER_WIDE_INT HOST_BITS_PER_LONG
37 # define HOST_WIDE_INT long
39 # define HOST_BITS_PER_WIDE_INT HOST_BITS_PER_INT
40 # define HOST_WIDE_INT int
43 #endif /* ! HOST_BITS_PER_WIDE_INT */
46 /* Provide defaults for the way to print a HOST_WIDE_INT
47 in various manners. */
49 #ifndef HOST_WIDE_INT_PRINT_DEC
50 # if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
51 # define HOST_WIDE_INT_PRINT_DEC "%d"
53 # if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
54 # define HOST_WIDE_INT_PRINT_DEC "%ld"
56 # define HOST_WIDE_INT_PRINT_DEC "%lld"
59 #endif /* ! HOST_WIDE_INT_PRINT_DEC */
61 #ifndef HOST_WIDE_INT_PRINT_UNSIGNED
62 # if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
63 # define HOST_WIDE_INT_PRINT_UNSIGNED "%u"
65 # if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
66 # define HOST_WIDE_INT_PRINT_UNSIGNED "%lu"
68 # define HOST_WIDE_INT_PRINT_UNSIGNED "%llu"
71 #endif /* ! HOST_WIDE_INT_PRINT_UNSIGNED */
73 #ifndef HOST_WIDE_INT_PRINT_HEX
74 # if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
75 # define HOST_WIDE_INT_PRINT_HEX "0x%x"
77 # if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
78 # define HOST_WIDE_INT_PRINT_HEX "0x%lx"
80 # define HOST_WIDE_INT_PRINT_HEX "0x%llx"
83 #endif /* ! HOST_WIDE_INT_PRINT_HEX */
85 #ifndef HOST_WIDE_INT_PRINT_DOUBLE_HEX
86 # if HOST_BITS_PER_WIDE_INT == 64
87 # if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
88 # define HOST_WIDE_INT_PRINT_DOUBLE_HEX "0x%x%016x"
90 # if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
91 # define HOST_WIDE_INT_PRINT_DOUBLE_HEX "0x%lx%016lx"
93 # define HOST_WIDE_INT_PRINT_DOUBLE_HEX "0x%llx%016llx"
97 # if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
98 # define HOST_WIDE_INT_PRINT_DOUBLE_HEX "0x%x%08x"
100 # if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
101 # define HOST_WIDE_INT_PRINT_DOUBLE_HEX "0x%lx%08lx"
103 # define HOST_WIDE_INT_PRINT_DOUBLE_HEX "0x%llx%08llx"
107 #endif /* ! HOST_WIDE_INT_PRINT_DOUBLE_HEX */
109 #endif /* __HWINT_H__ */