| Commit message (Expand) | Author | Age | Files | Lines |
| * | math: add x86_64 remquol | Alexander Monakov | 2020-03-24 | 1 | -0/+32 |
| * | math: move x87-family fmod functions to C with inline asm | Alexander Monakov | 2020-03-24 | 2 | -11/+9 |
| * | math: move x87-family remainder functions to C with inline asm | Alexander Monakov | 2020-03-24 | 2 | -11/+9 |
| * | math: move x87-family rint functions to C with inline asm | Alexander Monakov | 2020-03-24 | 2 | -6/+7 |
| * | math: move x87-family lrint functions to C with inline asm | Alexander Monakov | 2020-03-24 | 4 | -14/+16 |
| * | math: move x86_64 (l)lrint(f) functions to C with inline asm | Alexander Monakov | 2020-03-24 | 8 | -20/+32 |
| * | math: move trivial x86-family sqrt functions to C with inline asm | Alexander Monakov | 2020-03-24 | 6 | -13/+21 |
| * | math: move x87-family fabs functions to C with inline asm | Alexander Monakov | 2020-03-24 | 2 | -6/+7 |
| * | math: move x86_64 fabs, fabsf to C with inline asm | Alexander Monakov | 2020-03-24 | 4 | -16/+20 |
| * | x86_64: add single instruction fma•••fma is only available on recent x86_64 cpus and it is much faster than
a software fma, so this should be done with a runtime check, however
that requires more changes, this patch just adds the code so it can be
tested when musl is compiled with -mfma or -mfma4.
| Szabolcs Nagy | 2018-10-15 | 2 | -0/+46 |
| * | fix regression in x86_64 math asm with old binutils•••the implicit-operand form of fucomip is rejected by binutils 2.19 and
perhaps other versions still in use. writing both operands explicitly
fixes the issue. there is no change to the resulting output.
commit a732e80d33b4fd6f510f7cec4f5573ef5d89bc4e was the source of this
regression.
| Rich Felker | 2015-04-23 | 1 | -3/+3 |
| * | remove potentially PIC-incompatible relocations from x86_64 and x32 asm•••analogous to commit 8ed66ecbcba1dd0f899f22b534aac92a282f42d5 for i386.
| Rich Felker | 2015-04-18 | 1 | -1/+1 |
| * | math: use fnstsw consistently instead of fstsw in x87 asm•••fnstsw does not wait for pending unmasked x87 floating-point exceptions
and it is the same as fstsw when all exceptions are masked which is the
only environment libc supports.
| Szabolcs Nagy | 2014-11-05 | 2 | -2/+2 |
| * | math: fix x86_64 and x32 asm not to use sahf instruction•••Some early x86_64 cpus (released before 2006) did not support sahf/lahf
instructions so they should be avoided (intel manual says they are only
supported if CPUID.80000001H:ECX.LAHF-SAHF[bit 0] = 1).
The workaround simplifies exp2l and expm1l because fucomip can be
used instead of the fucomp;fnstsw;sahf sequence copied from i386.
In fmodl and remainderl sahf is replaced by a simple bit test.
| Szabolcs Nagy | 2014-11-05 | 3 | -14/+7 |
| * | fix x86_64 lrintl asm, again•••the underlying problem was not incorrect sign extension (fixed in the
previous commit to this file by nsz) but that code that treats "long"
as 32-bit was copied blindly from i386 to x86_64.
now lrintl is identical to llrintl on x86_64, as it should be.
| Rich Felker | 2013-09-13 | 1 | -2/+2 |
| * | math: fix expm1l on x86_64 (avoid underflow for large negative x)•••copy the fix from i386: return -1 instead of exp2l(x)-1 when x <= -65
| Szabolcs Nagy | 2013-09-05 | 3 | -3/+13 |
| * | math: fix lrintl.s on x86_64 (use movslq to signextend the result) | Szabolcs Nagy | 2013-09-05 | 1 | -1/+1 |
| * | math: fix exp2l asm on x86 (raise underflow correctly)•••there were two problems:
* omitted underflow on subnormal results: exp2l(-16383.5) was calculated
as sqrt(2)*2^-16384, the last bits of sqrt(2) are zero so the down scaling
does not underflow eventhough the result is in subnormal range
* spurious underflow for subnormal inputs: exp2l(0x1p-16400) was evaluated
as f2xm1(x)+1 and f2xm1 raised underflow (because inexact subnormal result)
the first issue is fixed by raising underflow manually if x is in
(-32768,-16382] and not integer (x-0x1p63+0x1p63 != x)
the second issue is fixed by treating x in (-0x1p64,0x1p64) specially
for these fixes the special case handling was completely rewritten
| Szabolcs Nagy | 2013-09-05 | 1 | -35/+40 |
| * | fix build of x86_64 expl assembly•••apparently this label change was not carried over when adapting the
changes from the i386 version.
| Rich Felker | 2013-08-16 | 1 | -1/+1 |
| * | math: fix x86 expl.s to raise underflow and clean up special case handling | Szabolcs Nagy | 2013-08-15 | 1 | -22/+15 |
| * | math: x86_64 version of expl, fixed some comments in the i386 version | Szabolcs Nagy | 2012-12-16 | 1 | -0/+108 |
| * | math: move x86_64 exp2l implementation to exp2l.s from expl.s | Szabolcs Nagy | 2012-12-16 | 3 | -85/+76 |
| * | math: add empty __invtrigl.s to i386 and x86_64•••__invtrigl is not needed when acosl, asinl, atanl have asm
implementations
| Szabolcs Nagy | 2012-12-12 | 1 | -0/+0 |
| * | math: fix exp.s on i386 and x86_64 so the exception flags are correct•••exp(inf), exp(-inf), exp(nan) used to raise wrong flags
| nsz | 2012-08-08 | 1 | -19/+17 |
| * | use fistpll mnemonic instead of fistpq (more widely supported) on x86_64 too•••this was fixed previously on i386 but the corresponding code on x86_64
was missed.
| Rich Felker | 2012-06-02 | 1 | -1/+1 |
| * | math: change the formula used for acos.s•••old: 2*atan2(sqrt(1-x),sqrt(1+x))
new: atan2(fabs(sqrt((1-x)*(1+x))),x)
improvements:
* all edge cases are fixed (sign of zero in downward rounding)
* a bit faster (here a single call is about 131ns vs 162ns)
* a bit more precise (at most 1ulp error on 1M uniform random
samples in [0,1), the old formula gave some 2ulp errors as well)
| nsz | 2012-05-05 | 1 | -10/+8 |
| * | fix typo in the x86_64 rounding asm | Rich Felker | 2012-04-29 | 4 | -4/+4 |
| * | new math asm (abs/rounding) for x86_64•••untested
| Rich Felker | 2012-04-29 | 6 | -0/+36 |
| * | math: fix x86 asin accuracy•••use (1-x)*(1+x) instead of (1-x*x) in asin.s
the later can be inaccurate with upward rounding when x is close to 1
| nsz | 2012-04-04 | 1 | -3/+3 |
| * | math: remove x86 modf asm•••the int part was wrong when -1 < x <= -0 (+0.0 instead of -0.0)
and the size and performace gain of the asm version was negligible
| nsz | 2012-03-29 | 1 | -27/+0 |
| * | acos.s fix: use the formula acos(x) = atan2(sqrt(1-x),sqrt(1+x))•••the old formula atan2(1,sqrt((1+x)/(1-x))) was faster but
could give nan result at x=1 when the rounding mode is
FE_DOWNWARD (so 1-1 == -0 and 2/-0 == -inf), the new formula
gives -0 at x=+-1 with downward rounding.
| nsz | 2012-03-22 | 1 | -3/+1 |
| * | x86_64 math asm, long double functions only•••this has not been tested heavily, but it's known to at least assemble
and run in basic usage cases. it's nearly identical to the
corresponding i386 code, and thus expected to be just as correct or
just as incorrect.
| Rich Felker | 2012-03-20 | 17 | -0/+239 |
| * | assembly optimizations for fmod/remainder functions | Rich Felker | 2012-03-18 | 2 | -0/+22 |
| * | asm versions of some simple math functions for i386 and x86_64•••these are functions that have direct fpu approaches to implementation
without problematic exception or rounding issues. x86_64 lacks
float/double versions because i'm unfamiliar with the necessary sse
code for performing these operations.
| Rich Felker | 2012-03-18 | 2 | -0/+12 |
| * | first commit of the new libm!•••thanks to the hard work of Szabolcs Nagy (nsz), identifying the best
(from correctness and license standpoint) implementations from freebsd
and openbsd and cleaning them up! musl should now fully support c99
float and long double math functions, and has near-complete complex
math support. tgmath should also work (fully on gcc-compatible
compilers, and mostly on any c99 compiler).
based largely on commit 0376d44a890fea261506f1fc63833e7a686dca19 from
nsz's libm git repo, with some additions (dummy versions of a few
missing long double complex functions, etc.) by me.
various cleanups still need to be made, including re-adding (if
they're correct) some asm functions that were dropped.
| Rich Felker | 2012-03-13 | 3 | -0/+5 |
| * | type directives for x86_64 math asm | Rich Felker | 2011-06-26 | 2 | -0/+2 |
| * | Port musl to x86-64. One giant commit! | Nicholas J. Kain | 2011-02-15 | 2 | -0/+6 |