diff --git a/core/sys/darwin/bitop.c b/core/sys/darwin/bitop.c new file mode 100644 index 0000000..141f252 --- /dev/null +++ b/core/sys/darwin/bitop.c @@ -0,0 +1,16 @@ +#include + +int b_popcountl(long v) +{ + return __builtin_popcountl(v); +} + +int b_ctzl(long v) +{ + return __builtin_ctzl(v); +} + +int b_clzl(long v) +{ + return __builtin_clzl(v); +} diff --git a/core/sys/linux/bitop.c b/core/sys/linux/bitop.c new file mode 100644 index 0000000..141f252 --- /dev/null +++ b/core/sys/linux/bitop.c @@ -0,0 +1,16 @@ +#include + +int b_popcountl(long v) +{ + return __builtin_popcountl(v); +} + +int b_ctzl(long v) +{ + return __builtin_ctzl(v); +} + +int b_clzl(long v) +{ + return __builtin_clzl(v); +}