include/SDL_bits.h
changeset 7033 3b12bae22f9e
parent 7004 18d4df6942c2
child 7191 75360622e65f
equal deleted inserted replaced
7032:305feca4f152 7033:3b12bae22f9e
    50  *  \return Index of the most significant bit.
    50  *  \return Index of the most significant bit.
    51  */
    51  */
    52 SDL_FORCE_INLINE Sint8
    52 SDL_FORCE_INLINE Sint8
    53 SDL_MostSignificantBitIndex32(Uint32 x)
    53 SDL_MostSignificantBitIndex32(Uint32 x)
    54 {
    54 {
    55 #if defined(__GNUC__)
    55 #if defined(__GNUC__) && __GNUC__ >= 4
    56     /* Count Leading Zeroes builtin in GCC.
    56     /* Count Leading Zeroes builtin in GCC.
    57      * http://gcc.gnu.org/onlinedocs/gcc-4.3.4/gcc/Other-Builtins.html
    57      * http://gcc.gnu.org/onlinedocs/gcc-4.3.4/gcc/Other-Builtins.html
    58      */
    58      */
    59     return 31 - __builtin_clz(x);
    59     return 31 - __builtin_clz(x);
    60 #else
    60 #else