Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-04-18Cygwin: fix return value of ilogbl(NaN)Corinna Vinschen
Fixes: 792e51b72149 ("Add missing long double functions to Cygwin") Reported-by: Bruno Haible <bruno@clisp.org> Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-08-04cacosh: Use approximation for large input.Markus Mützel
Signed-off-by: Martin Storsjö <martin@martin.st> Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2022-08-04casinh: Use approximation for large input.Markus Mützel
Signed-off-by: Martin Storsjö <martin@martin.st> Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2021-11-16change _COMPILING_NEWLIB to _LIBCMike Frysinger
Use the same name as glibc & gnulib to indicate "newlib itself is being compiled". This also harmonizes the codebase a bit in that _LIBC was already used in places instead of _COMPILING_NEWLIB. Building for bfin-elf, mips-elf, and x86_64-pc-cygwin produces the same object code.
2021-04-19Cygwin: take hypotl function from Mingw-w64Corinna Vinschen
The simple newlib hypotl for real long double architectures is too simple at this point. It's implemented as a real call to sqrtl(x^2+y^2). This has a fatal tendency to overflow for big input numbers. Hypotl isn't supposed to do that if the result would still be valid in range of long double. Given the complexity of implementing hypotl for various architectures, we just take the hypotl function from Mingw-w64, which is in the public domain. Even though this hypotl is an architecture-independent implementation, we can't use it for newlib yet, unfortunately, because it requires logbl under the hood. Logbl is yet another function missing in newlib for real long double architectures. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2020-10-27Cygwin: fix return value of sqrtl on negative infinityKen Brown
The return value is now -NaN. This fixes a bug in the mingw-w64 code that was imported into Cygwin. The fix is consistent with Posix and Linux. It is also consistent with the current mingw-w64 code, with one exception: The mingw-w64 code sets errno to EDOM if the input is -NaN, but this appears to differ from Posix and Linux. Addresses: https://cygwin.com/pipermail/cygwin/2020-October/246606.html
2020-08-30Cygwin: crt: Add "volatile" to all inline assembly snippets under mathMartin Storsjö
On 32 bit x86, clang seems to miss loading input parameters based on asm constraints for inline assembly that uses the x87 floating registers, unless the snippet has got the volatile keyword. Signed-off-by: Martin Storsjö <martin@martin.st>
2020-08-30Cygwin: math/modfl.c: Fix segment faults in modfl().Liu Hao
Reference: https://sourceforge.net/p/mingw-w64/bugs/478/ Signed-off-by: Liu Hao <lh_mouse@126.com>
2020-03-11Cygwin: fix formatting: drop trailing whitespaceCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2020-03-11Cygwin: fix formatting: collapse whitespace-only linesCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2020-03-11Cygwin: fix formatting: drop spaces leading tabsCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2019-12-16Cygwin: ilogbl: Make sure to return FP_ILGB0 on zero inputCorinna Vinschen
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2019-08-20Cygwin: math: Properly propagate input NANs in a few functionsMartin Storsjö
While the C99 standard doesn't explicitly require this, the standard says it is recommended (F.9.13). Signed-off-by: Martin Storsjö <martin@martin.st>
2019-08-20Cygwin: math: Fix cosh(-INFINITY) to return +INFINITYMartin Storsjö
Signed-off-by: Martin Storsjö <martin@martin.st>
2019-08-20Cygwin: math: Fix the return value for tgammal for zero and negative integersMartin Storsjö
For zero, it should return HUGE_VAL (INFINITY), for negative integers, it should return NAN. Signed-off-by: Martin Storsjö <martin@martin.st>
2019-01-23Remove matherr, and SVID and X/Open math library configurationsJozef Lawrynowicz
Default math library configuration is now IEEE
2018-10-10Implement nanl in newlib onlyCorinna Vinschen
Drop Cygwin-specific nanl in favor of a generic implementation in newlib. Requires GCC 3.3 or later. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-06-07cygwin: Fix lrint{f,l} to return a 64 bit long on x86_64Corinna Vinschen
Mingw-w64 (where the code has been taken from) has 4 byte longs independently of the architecture but x86_64 Cygwin has 64 bit longs. So use fistpll instead of fistpl on x86_64 Cygwin. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2017-04-18newlib: remove __infinity{f,ld} constantsCorinna Vinschen
previous commit 4c90db7bc89e7fa1077025fefdd58269dc71a6ac introduced a compile time error because libm/common/s_infconst.c used the remove __fmath, __dmath, and __ldmath union types. Since this is very old, and unused for a very long time, just drop the file and thus the __infinity constants entirely. Exception: Cygwin exports __infinity from the beginning. There's a very, VERY low probability that any existing executable or lib still uses this constant, but we just keep it in for backward compat, nevertheless. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-08-22Avoid truncating from long double to double in sinhl().David Wohlferd
This routine makes a call to fabs instead of fabsl(), causing truncation. Clang complains (warning: absolute value function 'fabs' given an argument of type 'long double' but has parameter of type 'double' which may cause truncation of value). Signed-off-by: David Wohlferd <dw@LimeGreenSocks.com>
2016-08-22sqrt: Fix NaN propagation for IEEE Std 754-2008Ray Donnelly
The R language has some hacks specifically for mingw-w64 that were caused by our handling of NaNs in sqrt(x). R uses a special valued NaN to mean 'Not Available' and expects it to be retained through various calculations. Our sqrt(x) doesn't do this, instead it normalises such a NaN (retaining sign). From: http://wwwf.imperial.ac.uk/~drmii/M3SC_2016/IEEE_2008_4610935.pdf "6.2.3 NaN propagation An operation that propagates a NaN operand to its result and has a single NaN as an input should produce a NaN with the payload of the input NaN if representable in the destination format." There might even be a slight speed-up from this too. Thanks to Duncan Murdoch for finding the reference.
2016-07-18truncl: Fix setting rounding bits in FPU control wordCorinna Vinschen
Mingw-w64, which is the source of this code, uses different definitions of the rounding bits FE_TONEAREST and friends. They immediately reflect the bit values in the FPU control word, while on Cygwin they are shifted down to become the values 0-3. Fix the bit computing expression to account for the difference. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-04-04cygwin/math: make isinf functions signedYaakov Selkowitz
glibc returns -1 for negative infinity: http://man7.org/linux/man-pages/man3/isinfl.3.html https://sourceware.org/bugzilla/show_bug.cgi?id=15367 Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2016-03-29Add missing nanlCorinna Vinschen
* Makefile.in (MATH_OFILES): Add nanl.o. * common.din (nanl): Export. * math/nanl.c: New file. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-03-29Add missing long double functions to CygwinCorinna Vinschen
This patch adds the long double functions missing in newlib to Cygwin. Apart from some self-written additions (exp10l, finite{f,l}, isinf{f,l}, isnan{f,l}, pow10l) the files are taken from the Mingw-w64 math lib. Minor changes were required, e.g. substitue _WIN64 with __x86_64__ and fixing __FLT_RPT_DOMAIN/__FLT_RPT_ERANGE for Cygwin. Cygwin: * math: New subdir with math functions. * Makefile.in (VPATH): Add math subdir. (MATH_OFILES): List of object files collected from building files in math subdir. (DLL_OFILES): Add $(MATH_OFILES). ${CURDIR}/libm.a: Add $(MATH_OFILES) to build. * common.din: Add new functions from math subdir. * i686.din: Align to new math subdir. Remove functions now commonly available. * x86_64.din: Ditto. * math.h: math.h wrapper to define mingw structs used in some files in math subdir. * include/cygwin/version.h: Bump API minor version. newlib: * libc/include/complex.h: Add prototypes for complex long double functions. Only define for Cygwin. * libc/include/math.h: Additionally enable prototypes of long double functions for Cygwin. Add Cygwin-only prototypes for dreml, sincosl, exp10l and pow10l. Explain why we don't add them to newlib. * libc/include/tgmath.h: Enable long double handling on Cygwin. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>