11 #ifndef _LIBCPP_SUPPORT_IBM_SUPPORT_H
12 #define _LIBCPP_SUPPORT_IBM_SUPPORT_H
14 extern "builtin" int __popcnt4(
unsigned int);
15 extern "builtin" int __popcnt8(
unsigned long long);
16 extern "builtin" unsigned int __cnttz4(
unsigned int);
17 extern "builtin" unsigned int __cnttz8(
unsigned long long);
18 extern "builtin" unsigned int __cntlz4(
unsigned int);
19 extern "builtin" unsigned int __cntlz8(
unsigned long long);
22 #define __builtin_popcount(x) __popcnt4(x)
23 #define __builtin_popcountll(x) __popcnt8(x)
24 #if defined(__64BIT__)
25 #define __builtin_popcountl(x) __builtin_popcountll(x)
27 #define __builtin_popcountl(x) __builtin_popcount(x)
31 #define __builtin_ctz(x) __cnttz4(x)
32 #define __builtin_ctzll(x) __cnttz8(x)
33 #if defined(__64BIT__)
34 #define __builtin_ctzl(x) __builtin_ctzll(x)
36 #define __builtin_ctzl(x) __builtin_ctz(x)
40 #define __builtin_clz(x) __cntlz4(x)
41 #define __builtin_clzll(x) __cntlz8(x)
42 #if defined(__64BIT__)
43 #define __builtin_clzl(x) __builtin_clzll(x)
45 #define __builtin_clzl(x) __builtin_clz(x)
48 #if defined(__64BIT__)
49 #define __SIZE_WIDTH__ 64
51 #define __SIZE_WIDTH__ 32
54 #endif // _LIBCPP_SUPPORT_IBM_SUPPORT_H