diff options
Diffstat (limited to 'gcc/toplev.h')
-rw-r--r-- | gcc/toplev.h | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/gcc/toplev.h b/gcc/toplev.h index 08cbbc1..925e357 100644 --- a/gcc/toplev.h +++ b/gcc/toplev.h @@ -88,76 +88,6 @@ extern const char * default_pch_valid_p (const void *, size_t); /* The hashtable, so that the C front ends can pass it to cpplib. */ extern struct ht *ident_hash; -/* Inline versions of the above for speed. */ -#if GCC_VERSION < 3004 - -extern int clz_hwi (unsigned HOST_WIDE_INT x); -extern int ctz_hwi (unsigned HOST_WIDE_INT x); -extern int ffs_hwi (unsigned HOST_WIDE_INT x); - -/* Return log2, or -1 if not exact. */ -extern int exact_log2 (unsigned HOST_WIDE_INT); - -/* Return floor of log2, with -1 for zero. */ -extern int floor_log2 (unsigned HOST_WIDE_INT); - -#else /* GCC_VERSION >= 3004 */ - -/* For convenience, define 0 -> word_size. */ -static inline int -clz_hwi (unsigned HOST_WIDE_INT x) -{ - if (x == 0) - return HOST_BITS_PER_WIDE_INT; -# if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG - return __builtin_clzl (x); -# elif HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONGLONG - return __builtin_clzll (x); -# else - return __builtin_clz (x); -# endif -} - -static inline int -ctz_hwi (unsigned HOST_WIDE_INT x) -{ - if (x == 0) - return HOST_BITS_PER_WIDE_INT; -# if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG - return __builtin_ctzl (x); -# elif HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONGLONG - return __builtin_ctzll (x); -# else - return __builtin_ctz (x); -# endif -} - -static inline int -ffs_hwi (unsigned HOST_WIDE_INT x) -{ -# if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG - return __builtin_ffsl (x); -# elif HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONGLONG - return __builtin_ffsll (x); -# else - return __builtin_ffs (x); -# endif -} - -static inline int -floor_log2 (unsigned HOST_WIDE_INT x) -{ - return HOST_BITS_PER_WIDE_INT - 1 - clz_hwi (x); -} - -static inline int -exact_log2 (unsigned HOST_WIDE_INT x) -{ - return x == (x & -x) && x ? ctz_hwi (x) : -1; -} - -#endif /* GCC_VERSION >= 3004 */ - /* Functions used to get and set GCC's notion of in what directory compilation was started. */ |