From 4a6a7cf3c821a799ecf731a1438e4ce8ff3f9d41 Mon Sep 17 00:00:00 2001 From: serenityosrocks Date: Fri, 1 Apr 2022 20:46:32 -0700 Subject: [PATCH] AK: Add generic sincos solution for non-x86 platforms --- AK/Math.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/AK/Math.h b/AK/Math.h index 20c1cd23a09..f0f0d1a0d5e 100644 --- a/AK/Math.h +++ b/AK/Math.h @@ -245,10 +245,14 @@ constexpr void sincos(T angle, T& sin_val, T& cos_val) cos_val = cos(angle); return; } +#if ARCH(I386) || ARCH(X86_64) asm( "fsincos" : "=t"(cos_val), "=u"(sin_val) : "0"(angle)); +#else + __builtin_sincosf(angle, sin_val, cos_val); +#endif } template