mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-08-17 09:20:28 +03:00
AK: Don't use GCC's __builtin_ffs
on riscv64 without Zbb extension
GCC redirects `__builtin_ffs` to `ffs` on RISC-V without the Zbb extension, causing a linker error.
This commit is contained in:
parent
d572ad38ac
commit
e300da4db4
Notes:
sideshowbarker
2024-07-16 23:54:15 +09:00
Author: https://github.com/spholz Commit: https://github.com/SerenityOS/serenity/commit/e300da4db4 Pull-request: https://github.com/SerenityOS/serenity/pull/20689 Reviewed-by: https://github.com/ADKaster ✅
@ -134,7 +134,7 @@ inline constexpr int count_leading_zeroes_safe(IntType value)
|
||||
template<Integral IntType>
|
||||
inline constexpr int bit_scan_forward(IntType value)
|
||||
{
|
||||
#if defined(AK_COMPILER_CLANG) || defined(AK_COMPILER_GCC)
|
||||
#if defined(AK_COMPILER_CLANG) || (defined(AK_COMPILER_GCC) && (!ARCH(RISCV64) || defined(__riscv_zbb)))
|
||||
static_assert(sizeof(IntType) <= sizeof(unsigned long long));
|
||||
if constexpr (sizeof(IntType) <= sizeof(unsigned int))
|
||||
return __builtin_ffs(value);
|
||||
|
Loading…
Reference in New Issue
Block a user