mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 05:42:29 +00:00
Make further progress on non-x86 support
This commit is contained in:
parent
aef9a69a60
commit
036b9a0002
155 changed files with 2307 additions and 653 deletions
|
@ -205,11 +205,20 @@ static inline u128 mul128_tail(u128 a, u128 b)
|
|||
return lo;
|
||||
}
|
||||
|
||||
|
||||
/* see sqrt.c for detailed comments. */
|
||||
|
||||
/**
|
||||
* Returns square root of 𝑥.
|
||||
*/
|
||||
long double sqrtl(long double x)
|
||||
{
|
||||
#ifdef __x86__
|
||||
|
||||
asm("fsqrt" : "+t"(x));
|
||||
return x;
|
||||
|
||||
#else
|
||||
|
||||
u128 ix, ml;
|
||||
uint64_t top;
|
||||
|
||||
|
@ -285,7 +294,10 @@ long double sqrtl(long double x)
|
|||
y += mkldbl(top, (u128){0});
|
||||
}
|
||||
return y;
|
||||
|
||||
#endif /* __x86__ */
|
||||
}
|
||||
|
||||
#else
|
||||
#error unsupported long double format
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue