mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-09 12:42:54 +00:00
LibM: Implement sqrt()
Use the x87 fsqrt instruction for that. We cannot use __builtin_sqrt(), since GCC expands it into a sqrt() call, so we just loop endlessly.
This commit is contained in:
parent
0a061d4314
commit
cfe8fdd5aa
Notes:
sideshowbarker
2024-07-19 12:47:28 +09:00
Author: https://github.com/bugaevc
Commit: cfe8fdd5aa
Pull-request: https://github.com/SerenityOS/serenity/pull/423
Reviewed-by: https://github.com/awesomekling
1 changed files with 4 additions and 2 deletions
|
@ -58,9 +58,11 @@ double tan(double angle)
|
||||||
return ampsin(angle) / ampsin(M_PI_2 + angle);
|
return ampsin(angle) / ampsin(M_PI_2 + angle);
|
||||||
}
|
}
|
||||||
|
|
||||||
double sqrt(double)
|
double sqrt(double x)
|
||||||
{
|
{
|
||||||
ASSERT_NOT_REACHED();
|
double res;
|
||||||
|
__asm__("fsqrt" : "=t"(res) : "0"(x));
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
double sinh(double)
|
double sinh(double)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue