diff options
author | Nick Johnson <sylvyrfysh@gmail.com> | 2021-12-19 15:46:55 -0600 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-12-21 22:13:51 +0100 |
commit | 08e4a1a4dcbf07853f3c1a63adb64298fc236e3f (patch) | |
tree | 96b88d0dd878850c1e9cb7313a28f26964435536 /Userland/DevTools | |
parent | 26bb3e1acf4aa1814573d628af356f9fbb628786 (diff) | |
download | serenity-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 'Userland/DevTools')
-rw-r--r-- | Userland/DevTools/UserspaceEmulator/SoftCPU.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Userland/DevTools/UserspaceEmulator/SoftCPU.cpp b/Userland/DevTools/UserspaceEmulator/SoftCPU.cpp index 614bd13ff8..9d66b07411 100644 --- a/Userland/DevTools/UserspaceEmulator/SoftCPU.cpp +++ b/Userland/DevTools/UserspaceEmulator/SoftCPU.cpp @@ -8,6 +8,7 @@ #include "SoftCPU.h" #include "Emulator.h" #include <AK/Assertions.h> +#include <AK/BuiltinWrappers.h> #include <AK/Debug.h> #include <stdio.h> #include <string.h> @@ -978,7 +979,7 @@ void SoftCPU::BOUND(const X86::Instruction&) { TODO_INSN(); } template<typename T> ALWAYS_INLINE static T op_bsf(SoftCPU&, T value) { - return { (typename T::ValueType)__builtin_ctz(value.value()), value.shadow() }; + return { (typename T::ValueType)bit_scan_forward(value.value()), value.shadow() }; } template<typename T> |