mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:17:44 +00:00
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.
This commit is contained in:
parent
26bb3e1acf
commit
08e4a1a4dc
20 changed files with 108 additions and 115 deletions
|
@ -5,6 +5,7 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <AK/BuiltinWrappers.h>
|
||||
#include <AK/CharacterTypes.h>
|
||||
#include <AK/Hex.h>
|
||||
#include <AK/Platform.h>
|
||||
|
@ -500,7 +501,7 @@ static ThrowCompletionOr<String> decode(JS::GlobalObject& global_object, const S
|
|||
continue;
|
||||
}
|
||||
|
||||
auto leading_ones = count_trailing_zeroes_32_safe(~decoded_code_unit) - 24;
|
||||
auto leading_ones = count_trailing_zeroes_safe(static_cast<u32>(~decoded_code_unit)) - 24;
|
||||
if (leading_ones == 1 || leading_ones > 4)
|
||||
return global_object.vm().throw_completion<URIError>(global_object, ErrorType::URIMalformed);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue