Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git gcc/toplev.c gcc/toplev.c
- index d37c507..09b2f89 100644
- --- gcc/toplev.c
- +++ gcc/toplev.c
- @@ -540,9 +540,6 @@ floor_log2 (unsigned HOST_WIDE_INT x)
- if (x == 0)
- return -1;
- -#ifdef CLZ_HWI
- - t = HOST_BITS_PER_WIDE_INT - 1 - (int) CLZ_HWI (x);
- -#else
- if (HOST_BITS_PER_WIDE_INT > 64)
- if (x >= (unsigned HOST_WIDE_INT) 1 << (t + 64))
- t += 64;
- @@ -559,7 +556,6 @@ floor_log2 (unsigned HOST_WIDE_INT x)
- t += 2;
- if (x >= ((unsigned HOST_WIDE_INT) 1) << (t + 1))
- t += 1;
- -#endif
- return t;
- }
- @@ -572,11 +572,7 @@ exact_log2 (unsigned HOST_WIDE_INT x)
- {
- if (x != (x & -x))
- return -1;
- -#ifdef CTZ_HWI
- - return x ? CTZ_HWI (x) : -1;
- -#else
- return floor_log2 (x);
- -#endif
- }
- #endif /* GCC_VERSION < 3004 || !defined (__cplusplus) */
- diff --git a/gcc/toplev.h b/gcc/toplev.h
- index e62aa727..cca6867 100644
- --- gcc/toplev.h
- +++ gcc/toplev.h
- @@ -167,14 +167,16 @@ extern void decode_d_option (const char *);
- extern bool fast_math_flags_set_p (void);
- extern bool fast_math_flags_struct_set_p (struct cl_optimization *);
- +/* Inline versions of the above for speed. */
- +#if GCC_VERSION < 3004
- +
- /* 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);
- -/* Inline versions of the above for speed. */
- -#if GCC_VERSION >= 3004
- +#else /* GCC_VERSION >= 3004 */
- # if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
- # define CLZ_HWI __builtin_clzl
- # define CTZ_HWI __builtin_ctzl
- @@ -186,13 +188,13 @@ extern int floor_log2 (unsigned HOST_WIDE_INT);
- # define CTZ_HWI __builtin_ctz
- # endif
- -extern inline int
- +static inline int
- floor_log2 (unsigned HOST_WIDE_INT x)
- {
- return x ? HOST_BITS_PER_WIDE_INT - 1 - (int) CLZ_HWI (x) : -1;
- }
- -extern inline int
- +static inline int
- exact_log2 (unsigned HOST_WIDE_INT x)
- {
- return x == (x & -x) && x ? (int) CTZ_HWI (x) : -1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement