Age | Commit message (Collapse) | Author | Lines | |
---|---|---|---|---|

2020-03-24 | math: add x86_64 remquol | Alexander Monakov | -0/+32 | |

2020-03-24 | math: move x87-family fmod functions to C with inline asm | Alexander Monakov | -11/+9 | |

2020-03-24 | math: move x87-family remainder functions to C with inline asm | Alexander Monakov | -11/+9 | |

2020-03-24 | math: move x87-family rint functions to C with inline asm | Alexander Monakov | -6/+7 | |

2020-03-24 | math: move x87-family lrint functions to C with inline asm | Alexander Monakov | -14/+16 | |

2020-03-24 | math: move x86_64 (l)lrint(f) functions to C with inline asm | Alexander Monakov | -20/+32 | |

2020-03-24 | math: move trivial x86-family sqrt functions to C with inline asm | Alexander Monakov | -13/+21 | |

2020-03-24 | math: move x87-family fabs functions to C with inline asm | Alexander Monakov | -6/+7 | |

2020-03-24 | math: move x86_64 fabs, fabsf to C with inline asm | Alexander Monakov | -16/+20 | |

2018-10-15 | x86_64: add single instruction fma | Szabolcs Nagy | -0/+46 | |

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. | ||||

2015-04-23 | fix regression in x86_64 math asm with old binutils | Rich Felker | -3/+3 | |

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. | ||||

2015-04-18 | remove potentially PIC-incompatible relocations from x86_64 and x32 asm | Rich Felker | -1/+1 | |

analogous to commit 8ed66ecbcba1dd0f899f22b534aac92a282f42d5 for i386. | ||||

2014-11-05 | math: use fnstsw consistently instead of fstsw in x87 asm | Szabolcs Nagy | -2/+2 | |

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. | ||||

2014-11-05 | math: fix x86_64 and x32 asm not to use sahf instruction | Szabolcs Nagy | -14/+7 | |

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. | ||||

2013-09-13 | fix x86_64 lrintl asm, again | Rich Felker | -2/+2 | |

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. | ||||

2013-09-05 | math: fix expm1l on x86_64 (avoid underflow for large negative x) | Szabolcs Nagy | -3/+13 | |

copy the fix from i386: return -1 instead of exp2l(x)-1 when x <= -65 | ||||

2013-09-05 | math: fix lrintl.s on x86_64 (use movslq to signextend the result) | Szabolcs Nagy | -1/+1 | |

2013-09-05 | math: fix exp2l asm on x86 (raise underflow correctly) | Szabolcs Nagy | -35/+40 | |

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 | ||||

2013-08-16 | fix build of x86_64 expl assembly | Rich Felker | -1/+1 | |

apparently this label change was not carried over when adapting the changes from the i386 version. | ||||

2013-08-15 | math: fix x86 expl.s to raise underflow and clean up special case handling | Szabolcs Nagy | -22/+15 | |

2012-12-16 | math: x86_64 version of expl, fixed some comments in the i386 version | Szabolcs Nagy | -0/+108 | |

2012-12-16 | math: move x86_64 exp2l implementation to exp2l.s from expl.s | Szabolcs Nagy | -85/+76 | |

2012-12-12 | math: add empty __invtrigl.s to i386 and x86_64 | Szabolcs Nagy | -0/+0 | |

__invtrigl is not needed when acosl, asinl, atanl have asm implementations | ||||

2012-08-08 | math: fix exp.s on i386 and x86_64 so the exception flags are correct | nsz | -19/+17 | |

exp(inf), exp(-inf), exp(nan) used to raise wrong flags | ||||

2012-06-02 | use fistpll mnemonic instead of fistpq (more widely supported) on x86_64 too | Rich Felker | -1/+1 | |

this was fixed previously on i386 but the corresponding code on x86_64 was missed. | ||||

2012-05-05 | math: change the formula used for acos.s | nsz | -10/+8 | |

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) | ||||

2012-04-29 | fix typo in the x86_64 rounding asm | Rich Felker | -4/+4 | |

2012-04-29 | new math asm (abs/rounding) for x86_64 | Rich Felker | -0/+36 | |

untested | ||||

2012-04-04 | math: fix x86 asin accuracy | nsz | -3/+3 | |

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 | ||||

2012-03-29 | math: remove x86 modf asm | nsz | -27/+0 | |

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 | ||||

2012-03-22 | acos.s fix: use the formula acos(x) = atan2(sqrt(1-x),sqrt(1+x)) | nsz | -3/+1 | |

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. | ||||

2012-03-20 | x86_64 math asm, long double functions only | Rich Felker | -0/+239 | |

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. | ||||

2012-03-18 | assembly optimizations for fmod/remainder functions | Rich Felker | -0/+22 | |

2012-03-18 | asm versions of some simple math functions for i386 and x86_64 | Rich Felker | -0/+12 | |

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. | ||||

2012-03-13 | first commit of the new libm! | Rich Felker | -0/+5 | |

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. | ||||

2011-06-26 | type directives for x86_64 math asm | Rich Felker | -0/+2 | |

2011-02-15 | Port musl to x86-64. One giant commit! | Nicholas J. Kain | -0/+6 | |