Make further progress on non-x86 support

This commit is contained in:
Justine Tunney 2023-05-08 21:38:30 -07:00
parent aef9a69a60
commit 036b9a0002
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
155 changed files with 2307 additions and 653 deletions

View file

@ -33,7 +33,9 @@ long double powl(long double x, long double y) {
if (x) {
if (y) {
if (x < 0 && y != truncl(y)) {
#ifndef __NO_MATH_ERRNO__
errno = EDOM;
#endif
return NAN;
}
asm("fyl2x" : "=t"(u) : "0"(fabsl(x)), "u"(y) : "st(1)");
@ -57,7 +59,9 @@ long double powl(long double x, long double y) {
} else if (!y) {
return 1;
} else {
#ifndef __NO_MATH_ERRNO__
errno = ERANGE;
#endif
if (y == truncl(y) && ((int64_t)y & 1)) {
return copysignl(INFINITY, x);
} else {
@ -619,6 +623,8 @@ long double powl(long double x, long double y)
{
return pow(x, y);
}
#else
#error "architecture unsupported"
#endif
#endif /* __x86_64__ */