mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
AK: Remove rsqrt()
At least on arm64, this isn't very preciese: https://github.com/SerenityOS/serenity/issues/22739#issuecomment-1912909835 It is also now unused.
This commit is contained in:
parent
1ed9e597a9
commit
a1f70b39fa
Notes:
sideshowbarker
2024-07-18 03:23:00 +09:00
Author: https://github.com/nico Commit: https://github.com/SerenityOS/serenity/commit/a1f70b39fa Pull-request: https://github.com/SerenityOS/serenity/pull/22996
1 changed files with 0 additions and 17 deletions
17
AK/Math.h
17
AK/Math.h
|
@ -502,23 +502,6 @@ constexpr T sqrt(T x)
|
|||
#endif
|
||||
}
|
||||
|
||||
template<FloatingPoint T>
|
||||
constexpr T rsqrt(T x)
|
||||
{
|
||||
#if ARCH(AARCH64)
|
||||
AARCH64_INSTRUCTION(frsqrte, x);
|
||||
#elif ARCH(X86_64)
|
||||
if constexpr (IsSame<T, float>) {
|
||||
float res;
|
||||
asm("rsqrtss %1, %0"
|
||||
: "=x"(res)
|
||||
: "x"(x));
|
||||
return res;
|
||||
}
|
||||
#endif
|
||||
return (T)1. / sqrt(x);
|
||||
}
|
||||
|
||||
template<FloatingPoint T>
|
||||
constexpr T cbrt(T x)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue