mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 19:27:45 +00: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
1 changed files with 1 additions and 1 deletions
|
@ -134,7 +134,7 @@ inline constexpr int count_leading_zeroes_safe(IntType value)
|
||||||
template<Integral IntType>
|
template<Integral IntType>
|
||||||
inline constexpr int bit_scan_forward(IntType value)
|
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));
|
static_assert(sizeof(IntType) <= sizeof(unsigned long long));
|
||||||
if constexpr (sizeof(IntType) <= sizeof(unsigned int))
|
if constexpr (sizeof(IntType) <= sizeof(unsigned int))
|
||||||
return __builtin_ffs(value);
|
return __builtin_ffs(value);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue