50 #if defined(__WATCOMC__) && defined(__386__)
51 extern __inline
int _SDL_bsr_watcom(
Uint32);
52 #pragma aux _SDL_bsr_watcom = \
56 modify exact [eax] nomemory;
62 #if defined(__GNUC__) && (__GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
69 return 31 - __builtin_clz(x);
70 #elif defined(__WATCOMC__) && defined(__386__)
74 return _SDL_bsr_watcom(x);
75 #elif defined(_MSC_VER)
77 if (_BitScanReverse(&index, x)) {
86 const Uint32 b[] = {0x2, 0xC, 0xF0, 0xFF00, 0xFFFF0000};
87 const int S[] = {1, 2, 4, 8, 16};
96 for (i = 4; i >= 0; i--)
112 if (x && !(x & (x - 1))) {
SDL_FORCE_INLINE SDL_bool SDL_HasExactlyOneBitSet32(Uint32 x)
SDL_FORCE_INLINE int SDL_MostSignificantBitIndex32(Uint32 x)