diff --git a/AK/BitCast.h b/AK/BitCast.h index a1f6f17d39f..32752c738f3 100644 --- a/AK/BitCast.h +++ b/AK/BitCast.h @@ -11,7 +11,7 @@ namespace AK { template -[[nodiscard]] constexpr inline T bit_cast(U const& a) +[[nodiscard]] constexpr ALWAYS_INLINE T bit_cast(U const& a) { #if (__has_builtin(__builtin_bit_cast)) return __builtin_bit_cast(T, a); diff --git a/AK/SIMDExtras.h b/AK/SIMDExtras.h index d8568cf6f9c..3147f2fb3a8 100644 --- a/AK/SIMDExtras.h +++ b/AK/SIMDExtras.h @@ -261,12 +261,11 @@ ALWAYS_INLINE static T byte_reverse_impl(T a, IndexSequence) // Hence this giant conditional using BytesVector = Conditional>>>>; static_assert(sizeof(BytesVector) == sizeof(T)); - // Note: Using __builtin_bit_cast instead of bit_cast to avoid a psabi warning from bit_cast - auto tmp = __builtin_shufflevector( - __builtin_bit_cast(BytesVector, a), - __builtin_bit_cast(BytesVector, a), - N - 1 - Idx...); - return __builtin_bit_cast(T, tmp); + return bit_cast( + __builtin_shufflevector( + bit_cast(a), + bit_cast(a), + N - 1 - Idx...)); } template