mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
AK: Add generic sincos solution for non-x86 platforms
This commit is contained in:
parent
ea9857a423
commit
4a6a7cf3c8
Notes:
sideshowbarker
2024-07-17 14:36:09 +09:00
Author: https://github.com/serenityosrocks Commit: https://github.com/SerenityOS/serenity/commit/4a6a7cf3c8 Pull-request: https://github.com/SerenityOS/serenity/pull/13427 Reviewed-by: https://github.com/linusg
1 changed files with 4 additions and 0 deletions
|
@ -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<FloatingPoint T>
|
||||
|
|
Loading…
Reference in a new issue