summaryrefslogtreecommitdiff
path: root/AK/Platform.h
diff options
context:
space:
mode:
authorNick Johnson <sylvyrfysh@gmail.com>2021-12-19 15:46:55 -0600
committerAndreas Kling <kling@serenityos.org>2021-12-21 22:13:51 +0100
commit08e4a1a4dcbf07853f3c1a63adb64298fc236e3f (patch)
tree96b88d0dd878850c1e9cb7313a28f26964435536 /AK/Platform.h
parent26bb3e1acf4aa1814573d628af356f9fbb628786 (diff)
downloadserenity-08e4a1a4dcbf07853f3c1a63adb64298fc236e3f.zip
AK+Everywhere: Replace __builtin bit functions
In order to reduce our reliance on __builtin_{ffs, clz, ctz, popcount}, this commit removes all calls to these functions and replaces them with the equivalent functions in AK/BuiltinWrappers.h.
Diffstat (limited to 'AK/Platform.h')
-rw-r--r--AK/Platform.h23
1 files changed, 0 insertions, 23 deletions
diff --git a/AK/Platform.h b/AK/Platform.h
index f57afce798..d69ceba3af 100644
--- a/AK/Platform.h
+++ b/AK/Platform.h
@@ -106,29 +106,6 @@ extern "C" {
# endif
#endif
-#ifdef __cplusplus
-ALWAYS_INLINE int count_trailing_zeroes_32(unsigned int val)
-{
-# if defined(__GNUC__) || defined(__clang__)
- return __builtin_ctz(val);
-# else
- for (u8 i = 0; i < 32; ++i) {
- if ((val >> i) & 1) {
- return i;
- }
- }
- return 0;
-# endif
-}
-
-ALWAYS_INLINE int count_trailing_zeroes_32_safe(unsigned int val)
-{
- if (val == 0)
- return 32;
- return count_trailing_zeroes_32(val);
-}
-#endif
-
#ifdef AK_OS_BSD_GENERIC
# define CLOCK_MONOTONIC_COARSE CLOCK_MONOTONIC
# define CLOCK_REALTIME_COARSE CLOCK_REALTIME