mirror of
https://github.com/SerenityOS/serenity
synced 2026-04-25 17:15:42 +02:00
AK/SIMD: Use __builtin_elementwise_sqrt when available
This was motivated by Clang removing `__builtin_ia32_sqrtps` for the 22.1.0 release: https://github.com/llvm/llvm-project/pull/165682 This should also allow vectorized square root on non-x86 systems when using Clang.
This commit is contained in:
@@ -84,7 +84,9 @@ ALWAYS_INLINE static f32x4 exp_approximate(f32x4 v)
|
||||
|
||||
ALWAYS_INLINE static f32x4 sqrt(f32x4 v)
|
||||
{
|
||||
#if ARCH(X86_64)
|
||||
#if __has_builtin(__builtin_elementwise_sqrt)
|
||||
return __builtin_elementwise_sqrt(v);
|
||||
#elif __has_builtin(__builtin_ia32_sqrtps)
|
||||
return __builtin_ia32_sqrtps(v);
|
||||
#else
|
||||
return f32x4 {
|
||||
|
||||
Reference in New Issue
Block a user