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
2021-12-30newlib: Regenerate autotools filesJon Turney
2021-12-30newlib: Remove automake option 'cygnus'Jon Turney
The 'cygnus' option was removed from automake 1.13 in 2012, so the presence of this option prevents that or a later version of automake being used. A check-list of the effects of '--cygnus' from the automake 1.12 documentation, and steps taken (where possible) to preserve those effects (See also this thread [1] for discussion on that): [1] https://lists.gnu.org/archive/html/bug-automake/2012-03/msg00048.html 1. The foreign strictness is implied. Already present in AM_INIT_AUTOMAKE in newlib/acinclude.m4 2. The options no-installinfo, no-dependencies and no-dist are implied. Already present in AM_INIT_AUTOMAKE in newlib/acinclude.m4 Future work: Remove no-dependencies and any explicit header dependencies, and use automatic dependency tracking instead. Are there explicit rules which are now redundant to removing no-installinfo and no-dist? 3. The macro AM_MAINTAINER_MODE is required. Already present in newlib/acinclude.m4 Note that maintainer-mode is still disabled by default. 4. Info files are always created in the build directory, and not in the source directory. This appears to be an error in the automake documentation describing '--cygnus' [2]. newlib's info files are generated in the source directory, and no special steps are needed to keep doing that. [2] https://lists.gnu.org/archive/html/bug-automake/2012-04/msg00028.html 5. texinfo.tex is not required if a Texinfo source file is specified. (The assumption is that the file will be supplied, but in a place that automake cannot find.) This effect is overriden by an explicit setting of the TEXINFO_TEX variable (the directory part of which is fed into texi2X via the TEXINPUTS environment variable). 6. Certain tools will be searched for in the build tree as well as in the user's PATH. These tools are runtest, expect, makeinfo and texi2dvi. For obscure automake reasons, this effect of '--cygnus' is not active for makeinfo in newlib's configury. However, there appears to be top-level configury which selects in-tree runtest, expect and makeinfo, if present. So, if that works as it appears, this effect is preserved. If not, this may cause problem if anyone is building those tools in-tree. This effect is not preserved for texi2dvi. This may cause problems if anyone is building texinfo in-tree. If needed, explicit checks for those tools looking in places relative to $(top_srcdir)/../ as well as in PATH could be added. 7. The check target doesn't depend on all. This effect is not preseved. The check target now depends on the all target. This concern seems somewhat academic given the current state of the testsuite. Also note that this doesn't touch libgloss.
2021-12-30newlib: Regenerate autotools filesJon Turney
2021-12-30newlib: Make effects of 'cygnus' explicitJon Turney
Add all the effects of 'cygnus' for which there exists an explicit way to request that behaviour: * Implied foreign strictness and options no-installinfo, no-dependencies and no-dist are added to AM_INIT_AUTOMAKE in newlib/acinclude.m4. * macro AM_MAINTAINER_MODE is added to newlib/acinclude.m4. * For the implied TEXINFO_TEX of '$(top_srcdir)/../texinfo/texinfo.tex', an explicit TEXINFO_TEX is always relative to $(srcdir), so write the same pathname in that form. This is to prepare for the removal of the automake option '--cygnus'.
2021-12-10newlib: Regenerate all autotools filesJon Turney
Regenerate all aclocal.m4, configure and Makefile.in files.
2021-12-03frexpl: Support smaller long double of LDBL_MANT_DIG == 53.Takashi Yano
- Currently, frexpl() supports only the following cases. 1) LDBL_MANT_DIG == 64 or 113 2) 'long double' is equivalent to 'double' This patch add support for LDBL_MANT_DIG == 53.
2021-11-30Modifying patch from: marian.buschsieweke@ovgu.deJeff Johnston
The code accessing the floating point control/status register, namely #define __cfc1(__fcsr) __asm __volatile("cfc1 %0, $31" : "=r" (__fcsr) does not compile with mips16. This changed the makefile to pass -mno-mips16 to avoid the following compiler error: mips-mti-elf fails with "Error: unrecognized opcode `cfc1 $3,$31'"
2021-11-29stdio: Fix issue of printing "%La" format with large exp part.Takashi Yano
- Currently, printf("%La\n", 1e1000L) crashes with segv due to lack of frexpl() function. With this patch, frexpl() function has been implemented in libm to solve this issue. Addresses: https://sourceware.org/pipermail/newlib/2021/018718.html
2021-11-06libgloss/newlib: update configure.ac in Makefile.in filesMike Frysinger
The maintainer rules refer to configure.in directly, so update that after renaming all the configure.ac files.
2021-09-13libgloss/newlib: rename configure.in to configure.acMike Frysinger
The .in name has been deprecated for a long time in favor of .ac.
2021-09-03ldexp/ldexpf: avoid assembler warningCorinna Vinschen
libm/machine/i386/f_ldexp.S:30: Warning: no instruction mnemonic suffix given and no register operands; using default for `fild' libm/machine/i386/f_ldexpf.S:30: Warning: no instruction mnemonic suffix given and no register operands; using default for `fild' fix this by adding the l mnemonic suffix Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2021-07-21libm: Fixing overflow handling issue for scalbnf and scalbnKito Cheng
cc Aldy Hernandez <aldyh@redhat.com> and Andrew MacLeod <amacleod@redhat.com>, they are author of new VRP analysis for GCC, just to make sure I didn't mis-understanding or mis-interpreting anything on GCC site. GCC 11 have better value range analysis, that give GCC more confidence to perform more aggressive optimization, but it cause scalbn/scalbnf get wrong result. Using scalbn to demostrate what happened on GCC 11, see comments with VRP prefix: ```c double scalbn (double x, int n) { /* VRP RESULT: n = [-INF, +INF] */ __int32_t k,hx,lx; ... k = (hx&0x7ff00000)>>20; /* VRP RESULT: k = [0, 2047] */ if (k==0) { /* VRP RESULT: k = 0 */ ... k = ((hx&0x7ff00000)>>20) - 54; if (n< -50000) return tiny*x; /*underflow*/ /* VRP RESULT: k = -54 */ } /* VRP RESULT: k = [-54, 2047] */ if (k==0x7ff) return x+x; /* NaN or Inf */ /* VRP RESULT: k = [-54, 2046] */ k = k+n; if (k > 0x7fe) return huge*copysign(huge,x); /* overflow */ /* VRP RESULT: k = [-INF, 2046] */ /* VRP RESULT: n = [-INF, 2100], because k + n <= 0x7fe is false, so: 1. -INF < [-54, 2046] + n <= 0x7fe(2046) < INF 2. -INF < [-54, 2046] + n <= 2046 < INF 3. -INF < n <= 2046 - [-54, 2046] < INF 4. -INF < n <= [0, 2100] < INF 5. n = [-INF, 2100] */ if (k > 0) /* normal result */ {SET_HIGH_WORD(x,(hx&0x800fffff)|(k<<20)); return x;} if (k <= -54) { /* VRP OPT: Evaluate n > 50000 as true...*/ if (n > 50000) /* in case integer overflow in n+k */ return huge*copysign(huge,x); /*overflow*/ else return tiny*copysign(tiny,x); /*underflow*/ } k += 54; /* subnormal result */ SET_HIGH_WORD(x,(hx&0x800fffff)|(k<<20)); return x*twom54; } ``` However give the input n = INT32_MAX, k = k+n will overflow, and then we expect got `huge*copysign(huge,x)`, but new VRP optimization think `n > 50000` is never be true, so optimize that into `tiny*copysign(tiny,x)`. so the solution here is to moving the overflow handle logic before `k = k + n`.
2021-06-04Fix rounding issues with sqrt/sqrtfJeff Johnston
- compiler is sometimes optimizing out the rounding check in e_sqrt.c and ef_sqrt.c which uses two constants to create an inexact operation - there is a similar constant operation in s_tanh.c/sf_tanh.c - make the one and tiny constants volatile to stop this
2021-04-21fix some Arm FP routines not checking if floating point is enabledTies Stuij
A lot of the Arm FP routines check for the availability of floating point by way of `(__ARM_FP & 0x4)`. However some do not. This patch remedies this.
2021-04-13fenv: fix up stub file comment, drop symlinks from descriptionDavid Macek
also slightly fixed up formatting
2021-04-13Cygwin: don't export _feinitialise from newlibCorinna Vinschen
Use the more official fesetenv(FE_DFL_ENV) from _dll_crt0, thus allowing to drop the _feinitialise declaration from fenv.h. Provide a no-op _feinitialise in Cygwin as exportable symbol for really old applications when _feinitialise was called from mainCRTStartup in crt0.o. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2021-04-13fenv: drop Cygwin-specific implementation in favor of newlib codeCorinna Vinschen
Drop the Cygwin-specific fenv.cc and fenv.h file and use the equivalent newlib functionality now, so we have at least one example of a user for this new mechanism. fenv.c: allow _feinitialise to be called from Cygwin startup code fenv.h: add declarations for fegetprec and fesetprec for Cygwin only. Fix a comment. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2021-04-13fenv: move shared x86 fenv.c to libm/machine/shared_x86Corinna Vinschen
Include this file from both sharing architectures, i386 and x86_64. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2021-04-13Add build mechanism to share common header files between machinesCorinna Vinschen
So far the build mechanism in newlib only allowed to either define machine-specific headers, or headers shared between all machines. In some cases, architectures are sufficiently alike to share header files between them, but not with other architectures. A good example is ix86 vs. x86_64, which share certain traits with each other, but not with other architectures. Introduce a new configure variable called "shared_machine_dir". This dir can then be used for headers shared between architectures. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2021-02-05Removed Soft float from MIPSEshan dhawan
This Patch removes Soft Float code from MIPS. Instead It adds the soft float code from RISCV The code came from FreeBSD and assumes the FreeBSD softfp implementation not the one with GCC. That was an overlooked and fixed in the other fenv code already. Signed-off-by: Eshan Dhawan <eshandhawan51@gmail.com>
2020-12-19Bump up newlib version to 4.1.0newlib-4.1.0Jeff Johnston
2020-12-18fixes to make compilation succeedsPaul Zimmermann
2020-12-18Update gamma functions from code in picolibcJeff Johnston
- fixes issue with inf sign when x is -0
2020-12-16Add declarations for __ieee754_tgamma functions to fdlibm.hJeff Johnston
2020-12-11Fix error in powf for x close to 1 and large yFabian Schriever
This patch fixes the error found by Paul Zimmermann (see https://homepages.loria.fr/PZimmermann/papers/#accuracy) regarding x close to 1 and rather large y (specifically he found the case powf(0x1.ffffeep-1,-0x1.000002p+27) which returns +Inf instead of the correct value). We found 2 more values for x which show the same faulty behaviour, and all 3 are fixed with this patch. We have tested all combinations for x in [+1.fffdfp-1, +1.00020p+0] and y in [-1.000007p+27, -1.000002p+27] and [1.000002p+27,1.000007p+27].
2020-12-11Bump newlib release to 4.0.0Jeff Johnston
2020-11-18RISC-V: Add machine-specific implementation for lrint[f], lround[f], ↵Kito Cheng
llrint[f] and llround[f].
2020-11-18RISC-V: Add machine-specific implementation for isnan[f] and copysign[f]Kito Cheng
2020-11-18RISC-V: Add missing compile rule for s_finite.c, sf_finite.c, s_isinf.c and ↵Kito Cheng
sf_isinf.c
2020-10-29RISC-V: Fix wrong including file in s_isinf.cKito Cheng
2020-10-29RISC-V: NaN should return 0 for finite[f]Kito Cheng
2020-10-27RISC-V: Implment finite and fpclassifyKito Cheng
2020-10-27RISC-V: Add fabs[f], fmax[f] and fmin[f].Kito Cheng
2020-09-19libm: Make tgamma(-small) = -INFINITYKeith Packard
Need to copy the argument sign to the output for tgamma(finite) overflow case. Signed-off-by: Keith Packard <keithp@keithp.com>
2020-09-04libm: Fix 'gamma' and 'gammaf' functions. Clean up other gamma code. [v2]Keith Packard via Newlib
The current gamma, gamma_r, gammaf and gammaf_r functions return |gamma(x)| instead of ln(|gamma(x)|) due to a change made back in 2002 to the __ieee754_gamma_r implementation. This patch fixes that, making all of these functions map too their lgamma equivalents. To fix the underlying bug, the __ieee754_gamma functions have been changed to return gamma(x), removing the _r variants as those are no longer necessary. Their names have been changed to __ieee754_tgamma to avoid potential confusion from users. Now that the __ieee754_tgamma functions return the correctly signed value, the tgamma functions have been modified to use them. libm.a now exposes the following gamma functions: ln(|gamma(x)|): __ieee754_lgamma_r __ieee754_lgammaf_r lgamma lgamma_r gamma gamma_r lgammaf lgammaf_r gammaf gammaf_r lgammal (on machines where long double is double) gamma(x): __ieee754_tgamma __ieee754_tgammaf tgamma tgammaf tgammal (on machines where long double is double) Additional aliases for any of the above functions can be added if necessary; in particular, I'm not sure if we need to include __ieee754_gamma*_r functions (which would return ln(|(gamma(x)|). Signed-off-by: Keith Packard <keithp@keithp.com> ---- v2: Switch commit message to ASCII
2020-09-04libm/riscv: Use common fma code when necessaryKeith Packard via Newlib
For RISC-V targets without hardware FMA support, include the common fma implementation to provide that API. Signed-off-by: Keith Packard <keithp@keithp.com>
2020-09-04libm/riscv: Fix machine-specific sqrt build processKeith Packard via Newlib
Like ARM, some RISC-V implementations have hardware sqrt. Support for that can be detected at compile time, which the code did. However, the filenames were incorrect so that both the risc-v specific and general code were getting included in the resulting library. Fix this by following the ARM model and #include'ing the general code when the architecture-specific support is not available. Signed-off-by: Keith Packard <keithp@keithp.com>
2020-09-02libm/machine/arm: Rename s*_fma.c -> s*_fma_arm.cKeith Packard via Newlib
This is required to avoid colliding with files built from libm/common that would end up with the same object name. When libm.a was constructed from the individual sub-libraries, the contents of the libm/common files would be replaced by that from libm/machine/arm with the same name. Signed-off-by: Keith Packard <keithp@keithp.com>
2020-08-12libm/machine/riscv: Add custom fma/sqrt functions when supported [v2]Keith Packard via Newlib
Check for HW FMA and SQRT support and use those instructions in place of software implementations. Signed-off-by: Keith Packard <keithp@keithp.com>
2020-08-10libm/machine/arm: Add optimized fmaf and fma when availableKeith Packard via Newlib
When HAVE_FAST_FMAF is set, use the vfma.f32 instruction, when HAVE_FAST_FMA is set, use the vfma.f64 instruction. Usually the compiler built-ins will already have inlined these instructions, but provide these symbols for cases where that doesn't work instead of falling back to the (inaccurate) common code versions. Signed-off-by: Keith Packard <keithp@keithp.com>
2020-08-10libm: Detect fast fmaf supportKeith Packard via Newlib
Anything with fast FMA is assumed to have fast FMAF, along with 32-bit arms that advertise 32-bit FP support and __ARM_FEATURE_FMA Signed-off-by: Keith Packard <keithp@keithp.com>
2020-08-10libm: ARM without HW double does not have fast FMAKeith Packard via Newlib
32-bit ARM processors with HW float (but not HW double) may define __ARM_FEATURE_FMA, but that only means they have fast FMA for 32-bit floats. Signed-off-by: Keith Packard <keithp@keithp.com>
2020-08-10libm/math: ensure that expf(-huge) sets FE_UNDERFLOW exceptionKeith Packard via Newlib
It was calling __math_uflow(0) instead of __math_uflowf(0), which resulted in no exception being set on machines with exception support for float but not double. Signed-off-by: Keith Packard <keithp@keithp.com>
2020-08-05libm: Control errno support with _IEEE_LIBM configuration parameterKeith Packard via Newlib
This removes the run-time configuration of errno support present in portions of the math library and unifies all of the compile-time errno configuration under a single parameter so that the whole library is consistent. The run-time support provided by _LIB_VERSION is no longer present in the public API, although it is still used internally to disable errno setting in some functions. Now that it is a constant, the compiler should remove that code when errno is not supported. This removes s_lib_ver.c as _LIB_VERSION is no longer variable. Signed-off-by: Keith Packard <keithp@keithp.com>
2020-08-05libm/math: Don't modify __ieee754_pow return values in powKeith Packard via Newlib
The __ieee754 functions already return the right value in exception cases, so don't modify those. Setting the library to _POSIX_/_IEEE_ mode now only affects whether errno is modified. Signed-off-by: Keith Packard <keithp@keithp.com>
2020-08-05libm/math: Set errno to ERANGE for pow(0, -y)Keith Packard via Newlib
POSIX says that the errno for pow(0, -y) should be ERANGE instead of EDOM. https://pubs.opengroup.org/onlinepubs/9699919799/functions/pow.html Signed-off-by: Keith Packard <keithp@keithp.com>
2020-08-05libm/math: Make yx functions set errno=ERANGE for x=0Keith Packard via Newlib
The y0, y1 and yn functions need separate conditions when x is zero as that returns ERANGE instead of EDOM. Also stop adjusting the return value from the __ieee754_y* functions as that is already correct and we were just breaking it. Signed-off-by: Keith Packard <keithp@keithp.com>
2020-08-05libm/math: set errno to ERANGE at gamma polesKeith Packard via Newlib
For POSIX, gamma(i) (i non-positive integer) should set errno to ERANGE instead of EDOM. Signed-off-by: Keith Packard <keithp@keithp.com>
2020-08-04libm/common: Set WANT_ERRNO based on _IEEE_LIBM valueKeith Packard via Newlib
_IEEE_LIBM is the configuration value which controls whether the original libm functions modify errno. Use that in the new math code as well so that the resulting library is internally consistent. Signed-off-by: Keith Packard <keithp@keithp.com>
2020-08-03libm/math: Use __math_xflow in obsolete math code [v2]Keith Packard
C compilers may fold const values at compile time, so expressions which try to elicit underflow/overflow by performing simple arithemetic on suitable values will not generate the required exceptions. Work around this by replacing code which does these arithmetic operations with calls to the existing __math_xflow functions that are designed to do this correctly. Signed-off-by: Keith Packard <keithp@keithp.com> ---- v2: libm/math: Pass sign to __math_xflow instead of muliplying result