13#define HOST_BITS_PER_CHAR CHAR_BIT
14#define HOST_BITS_PER_SHORT (CHAR_BIT * SIZEOF_SHORT)
15#define HOST_BITS_PER_INT (CHAR_BIT * SIZEOF_INT)
16#define HOST_BITS_PER_LONG (CHAR_BIT * SIZEOF_LONG)
17#define HOST_BITS_PER_PTR (CHAR_BIT * SIZEOF_VOID_P)
21#ifndef HOST_LONG_FORMAT
22#define HOST_LONG_FORMAT "l"
27#ifndef HOST_LONG_LONG_FORMAT
28#define HOST_LONG_LONG_FORMAT "ll"
37#if !defined HAVE_LONG_LONG
38# if GCC_VERSION >= 3000
39# define HAVE_LONG_LONG 1
40# define SIZEOF_LONG_LONG 8
41extern char sizeof_long_long_must_be_8[
sizeof (
long long) == 8 ? 1 : -1];
46# define HOST_BITS_PER_LONGLONG (CHAR_BIT * SIZEOF_LONG_LONG)
53#define HOST_BITS_PER_WIDE_INT 64
55# define HOST_WIDE_INT long
56# define HOST_WIDE_INT_C(X) X ## L
58# if HOST_BITS_PER_LONGLONG == 64
59# define HOST_WIDE_INT long long
60# define HOST_WIDE_INT_C(X) X ## LL
62 #error "Unable to find a suitable type for HOST_WIDE_INT"
66#define HOST_WIDE_INT_UC(X) HOST_WIDE_INT_C (X ## U)
67#define HOST_WIDE_INT_0 HOST_WIDE_INT_C (0)
68#define HOST_WIDE_INT_0U HOST_WIDE_INT_UC (0)
69#define HOST_WIDE_INT_1 HOST_WIDE_INT_C (1)
70#define HOST_WIDE_INT_1U HOST_WIDE_INT_UC (1)
71#define HOST_WIDE_INT_M1 HOST_WIDE_INT_C (-1)
72#define HOST_WIDE_INT_M1U HOST_WIDE_INT_UC (-1)
80#ifndef HAVE_INTTYPES_H
82# define GCC_PRI64 HOST_LONG_FORMAT
84# define GCC_PRI64 HOST_LONG_LONG_FORMAT
87#define PRId64 GCC_PRI64 "d"
89#define PRIi64 GCC_PRI64 "i"
91#define PRIo64 GCC_PRI64 "o"
93#define PRIu64 GCC_PRI64 "u"
95#define PRIx64 GCC_PRI64 "x"
97#define PRIX64 GCC_PRI64 "X"
103# define HOST_WIDE_INT_PRINT HOST_LONG_FORMAT
104# define HOST_WIDE_INT_PRINT_C "L"
106# define HOST_WIDE_INT_PRINT HOST_LONG_LONG_FORMAT
107# define HOST_WIDE_INT_PRINT_C "LL"
110#define HOST_WIDE_INT_PRINT_DEC "%" PRId64
111#define HOST_WIDE_INT_PRINT_DEC_C "%" PRId64 HOST_WIDE_INT_PRINT_C
112#define HOST_WIDE_INT_PRINT_UNSIGNED "%" PRIu64
113#define HOST_WIDE_INT_PRINT_HEX "%#" PRIx64
114#define HOST_WIDE_INT_PRINT_HEX_PURE "%" PRIx64
115#define HOST_WIDE_INT_PRINT_DOUBLE_HEX "0x%" PRIx64 "%016" PRIx64
116#define HOST_WIDE_INT_PRINT_PADDED_HEX "%016" PRIx64
123#if SIZE_MAX <= UINT_MAX
125# define fmt_size_t unsigned int
126#elif SIZE_MAX <= ULONG_MAX
127# define GCC_PRISZ HOST_LONG_FORMAT
128# define fmt_size_t unsigned long int
130# define GCC_PRISZ HOST_LONG_LONG_FORMAT
131# define fmt_size_t unsigned long long int
134#define HOST_SIZE_T_PRINT_DEC "%" GCC_PRISZ "d"
135#define HOST_SIZE_T_PRINT_UNSIGNED "%" GCC_PRISZ "u"
136#define HOST_SIZE_T_PRINT_HEX "%#" GCC_PRISZ "x"
137#define HOST_SIZE_T_PRINT_HEX_PURE "%" GCC_PRISZ "x"
146#ifdef USE_LONG_LONG_FOR_WIDEST_FAST_INT
147# ifdef HAVE_LONG_LONG
148# define HOST_WIDEST_FAST_INT long long
149# define HOST_BITS_PER_WIDEST_FAST_INT HOST_BITS_PER_LONGLONG
151# error "Your host said it wanted to use long long but that does not exist"
154# define HOST_WIDEST_FAST_INT long
155# define HOST_BITS_PER_WIDEST_FAST_INT HOST_BITS_PER_LONG
162inline unsigned HOST_WIDE_INT
184#if GCC_VERSION < 3004
186extern int clz_hwi (
unsigned HOST_WIDE_INT x);
187extern int ctz_hwi (
unsigned HOST_WIDE_INT x);
188extern int ffs_hwi (
unsigned HOST_WIDE_INT x);
194extern int exact_log2 (
unsigned HOST_WIDE_INT);
197extern int floor_log2 (
unsigned HOST_WIDE_INT);
200extern int ceil_log2 (
unsigned HOST_WIDE_INT);
206clz_hwi (
unsigned HOST_WIDE_INT x)
210# if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
211 return __builtin_clzl (x);
212# elif HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONGLONG
213 return __builtin_clzll (x);
215 return __builtin_clz (x);
220ctz_hwi (
unsigned HOST_WIDE_INT x)
224# if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
225 return __builtin_ctzl (x);
226# elif HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONGLONG
227 return __builtin_ctzll (x);
229 return __builtin_ctz (x);
234ffs_hwi (
unsigned HOST_WIDE_INT x)
236# if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
237 return __builtin_ffsl (x);
238# elif HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONGLONG
239 return __builtin_ffsll (x);
241 return __builtin_ffs (x);
248# if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
249 return __builtin_popcountl (x);
250# elif HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONGLONG
251 return __builtin_popcountll (x);
253 return __builtin_popcount (x);
277#define HOST_WIDE_INT_MIN (HOST_WIDE_INT) \
278 (HOST_WIDE_INT_1U << (HOST_BITS_PER_WIDE_INT - 1))
279#define HOST_WIDE_INT_MAX (~(HOST_WIDE_INT_MIN))
281extern HOST_WIDE_INT
abs_hwi (HOST_WIDE_INT);
282extern unsigned HOST_WIDE_INT
absu_hwi (HOST_WIDE_INT);
283extern HOST_WIDE_INT
gcd (HOST_WIDE_INT, HOST_WIDE_INT);
284extern HOST_WIDE_INT
pos_mul_hwi (HOST_WIDE_INT, HOST_WIDE_INT);
285extern HOST_WIDE_INT
mul_hwi (HOST_WIDE_INT, HOST_WIDE_INT);
287extern unsigned HOST_WIDE_INT
reflect_hwi (
unsigned HOST_WIDE_INT,
unsigned);
305#if defined (__GNUC__)
315 return ((HOST_WIDE_INT) ((
unsigned HOST_WIDE_INT) src << shift)) >> shift;
323 return (((src & value_mask) ^ sign_mask) - sign_mask);
329inline unsigned HOST_WIDE_INT
330zext_hwi (
unsigned HOST_WIDE_INT src,
unsigned int prec)
347 return x >= 0 ? x : -x;
352inline unsigned HOST_WIDE_INT
355 return x >= 0 ? (
unsigned HOST_WIDE_INT)x : -(
unsigned HOST_WIDE_INT)x;
362add_hwi (HOST_WIDE_INT
a, HOST_WIDE_INT
b,
bool *overflow)
364#if GCC_VERSION < 11000
365 unsigned HOST_WIDE_INT result =
a + (
unsigned HOST_WIDE_INT)
b;
366 if ((((result ^
a) & (result ^
b))
373 HOST_WIDE_INT result;
374 *overflow = __builtin_add_overflow (
a,
b, &result);
383mul_hwi (HOST_WIDE_INT
a, HOST_WIDE_INT
b,
bool *overflow)
385#if GCC_VERSION < 11000
386 unsigned HOST_WIDE_INT result =
a * (
unsigned HOST_WIDE_INT)
b;
388 || (
a != 0 && (HOST_WIDE_INT)result /
a !=
b))
394 HOST_WIDE_INT result;
395 *overflow = __builtin_mul_overflow (
a,
b, &result);
407 HOST_WIDE_INT result =
add_hwi (
a,
b, &overflow);
420 HOST_WIDE_INT result =
mul_hwi (
a,
b, &overflow);
HOST_WIDE_INT abs_hwi(HOST_WIDE_INT)
Definition hwint.h:344
bool pow2p_hwi(unsigned HOST_WIDE_INT x)
Definition hwint.h:179
int ffs_hwi(unsigned HOST_WIDE_INT x)
Definition hwint.cc:103
HOST_WIDE_INT add_sat_hwi(HOST_WIDE_INT a, HOST_WIDE_INT b)
Definition hwint.h:404
#define HOST_WIDE_INT_1U
Definition hwint.h:70
int ctz_or_zero(unsigned HOST_WIDE_INT x)
Definition hwint.h:292
bool pow2_or_zerop(unsigned HOST_WIDE_INT x)
Definition hwint.h:171
unsigned HOST_WIDE_INT absu_hwi(HOST_WIDE_INT)
Definition hwint.h:353
HOST_WIDE_INT sext_hwi(HOST_WIDE_INT src, unsigned int prec)
Definition hwint.h:300
unsigned HOST_WIDE_INT least_bit_hwi(unsigned HOST_WIDE_INT x)
Definition hwint.h:163
#define HOST_WIDE_INT_MIN
Definition hwint.h:277
HOST_WIDE_INT pos_mul_hwi(HOST_WIDE_INT, HOST_WIDE_INT)
Definition hwint.cc:153
HOST_WIDE_INT least_common_multiple(HOST_WIDE_INT, HOST_WIDE_INT)
Definition hwint.cc:187
#define HOST_WIDE_INT_1
Definition hwint.h:69
HOST_WIDE_INT mul_hwi(HOST_WIDE_INT, HOST_WIDE_INT)
Definition hwint.cc:165
unsigned HOST_WIDE_INT reflect_hwi(unsigned HOST_WIDE_INT, unsigned)
Definition hwint.cc:195
#define HOST_WIDE_INT_MAX
Definition hwint.h:279
int exact_log2(unsigned HOST_WIDE_INT)
Definition hwint.cc:75
HOST_WIDE_INT __gcc_host_wide_int__
Definition hwint.h:77
#define HOST_BITS_PER_WIDE_INT
Definition hwint.h:53
HOST_WIDE_INT gcd(HOST_WIDE_INT, HOST_WIDE_INT)
Definition hwint.cc:132
int ctz_hwi(unsigned HOST_WIDE_INT x)
Definition hwint.cc:86
HOST_WIDE_INT mul_sat_hwi(HOST_WIDE_INT a, HOST_WIDE_INT b)
Definition hwint.h:417
unsigned HOST_WIDE_INT zext_hwi(unsigned HOST_WIDE_INT src, unsigned int prec)
Definition hwint.h:330
int clz_hwi(unsigned HOST_WIDE_INT x)
Definition hwint.cc:94
int floor_log2(unsigned HOST_WIDE_INT)
Definition hwint.cc:36
int ceil_log2(unsigned HOST_WIDE_INT)
Definition hwint.cc:66
HOST_WIDE_INT add_hwi(HOST_WIDE_INT a, HOST_WIDE_INT b, bool *overflow)
Definition hwint.h:362
int popcount_hwi(unsigned HOST_WIDE_INT x)
Definition hwint.cc:111
Ca const poly_int< N, Cb > & b
Definition poly-int.h:771
Ca & a
Definition poly-int.h:770
#define gcc_checking_assert(EXPR)
Definition system.h:821