summaryrefslogtreecommitdiff
path: root/Userland/DevTools
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 /Userland/DevTools
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 'Userland/DevTools')
-rw-r--r--Userland/DevTools/UserspaceEmulator/SoftCPU.cpp3
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>