22 #ifndef WINPR_INTRIN_H
23 #define WINPR_INTRIN_H
25 #if !defined(_WIN32) || defined(__MINGW32__) || defined(_M_ARM64)
34 #if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 2))
36 static INLINE UINT32 __lzcnt(UINT32 _val32)
38 return ((UINT32)__builtin_clz(_val32));
41 #if !(defined(__MINGW32__) && defined(__clang__))
42 static INLINE UINT16 __lzcnt16(UINT16 _val16)
44 return ((UINT16)(__builtin_clz((UINT32)_val16) - 16));
50 static INLINE UINT32 __lzcnt(UINT32 x)
84 static INLINE UINT16 __lzcnt16(UINT16 x)
86 return ((UINT16)__lzcnt((UINT32)x));