Re: [Mingw-w64-public] [PATCH 08/12] math: Properly propagate input NANs in a few functions

2019-07-30 Thread Martin Storsjö
On Wed, 31 Jul 2019, sisyphus wrote: Martin, I couldn't locate mingw-w64-crt/math/x86/pow.def.h on the internet (URL ?), Here it is: https://sourceforge.net/p/mingw-w64/mingw-w64/ci/master/tree/mingw-w64-crt/math/x86/pow.def.h but I assume the patch is concerned with raising a NaN to a po

Re: [Mingw-w64-public] [PATCH 01/12] math: Make lgammaf(-INFINITY) return positive INFINITY, like lgamma and lgammal

2019-07-30 Thread Martin Storsjö
On Wed, 31 Jul 2019, Liu Hao wrote: --- BTW: + if (signbit(x)) + return -HUGE_VAL; + else + return HUGE_VAL; If I were you I would write it as return copysign(HUGE_VAL, x); anyway the difference is trivial. Good po

Re: [Mingw-w64-public] [PATCH 08/12] math: Properly propagate input NANs in a few functions

2019-07-30 Thread Liu Hao
在 2019/7/31 下午1:44, Liu Hao 写道: > 1) `pow(x, 0.0)` returns `0.0`, no matter what `x` is. > Sorry for the typo. The second `0.0` should be `1.0`. -- Best regards, LH_Mouse signature.asc Description: OpenPGP digital signature ___ Mingw-w64-public mail

Re: [Mingw-w64-public] [PATCH 08/12] math: Properly propagate input NANs in a few functions

2019-07-30 Thread Liu Hao
在 2019/7/31 下午1:13, sisyphus 写道: > Martin, > Thanks for all your work. > I couldn't locate mingw-w64-crt/math/x86/pow.def.h on the internet (URL ?), > but I assume the patch is concerned with raising a NaN to a power. > Given that raising an input NaN to a power does not always result in a NaN, > i

Re: [Mingw-w64-public] [PATCH 08/12] math: Properly propagate input NANs in a few functions

2019-07-30 Thread sisyphus
Martin, Thanks for all your work. I couldn't locate mingw-w64-crt/math/x86/pow.def.h on the internet (URL ?), but I assume the patch is concerned with raising a NaN to a power. Given that raising an input NaN to a power does not always result in a NaN, it seems a little suspicious that this has com

Re: [Mingw-w64-public] [PATCH 01/12] math: Make lgammaf(-INFINITY) return positive INFINITY, like lgamma and lgammal

2019-07-30 Thread Liu Hao
在 2019/7/31 上午5:07, Martin Storsjö 写道: > Signed-off-by: Martin Storsjö > --- > mingw-w64-crt/math/lgammaf.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > Thanks for your impressive work. These patches look good to me. --- BTW: > + if (signbit(x)) > +

[Mingw-w64-public] [PATCH 09/12] math: arm: Don't link directly against msvcrt.dll's logb and pow functions

2019-07-30 Thread Martin Storsjö
Instead provide local wrappers that handle edge cases according to C99, where msvcrt.dll's functions don't. Signed-off-by: Martin Storsjö --- mingw-w64-crt/Makefile.am | 12 mingw-w64-crt/lib-common/msvcrt.def.in | 8 ++-- mingw-w64-crt/math/arm-common/logb.c | 1

[Mingw-w64-public] [PATCH 01/12] math: Make lgammaf(-INFINITY) return positive INFINITY, like lgamma and lgammal

2019-07-30 Thread Martin Storsjö
Signed-off-by: Martin Storsjö --- mingw-w64-crt/math/lgammaf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mingw-w64-crt/math/lgammaf.c b/mingw-w64-crt/math/lgammaf.c index 8c527dffc..b6a0581d5 100644 --- a/mingw-w64-crt/math/lgammaf.c +++ b/mingw-w64-crt/math/lgammaf.c @@

[Mingw-w64-public] [PATCH 06/12] math: arm: Make local -l suffixed functions call unsuffixed ones

2019-07-30 Thread Martin Storsjö
Signed-off-by: Martin Storsjö --- mingw-w64-crt/math/erfl.c | 12 mingw-w64-crt/math/fp_constsl.c | 5 + mingw-w64-crt/math/lgammal.c| 11 ++- mingw-w64-crt/math/tgammal.c| 10 +- 4 files changed, 36 insertions(+), 2 deletions(-) diff --git a/mingw

[Mingw-w64-public] [PATCH 12/12] ucrt: Don't use long double functions from UCRT on x86

2019-07-30 Thread Martin Storsjö
While UCRT does provide long double variants of certain functions (as required by C99), UCRT's long double is equivalent to regular double (as in MSVC), while mingw uses 80 bit long doubles on x86. There's probably ones that I have missed, but this at least fixes my, at this point fairly extensive

[Mingw-w64-public] [PATCH 04/12] math: arm: Make coshl/sinhl/tanhl call cosh/sinh/tanh

2019-07-30 Thread Martin Storsjö
The implementations of the long double versions use a few hardcoded constants that assume that long double is 80 bit. Signed-off-by: Martin Storsjö --- mingw-w64-crt/math/coshl.c | 10 ++ mingw-w64-crt/math/sinhl.c | 11 ++- mingw-w64-crt/math/tanhl.c | 11 ++- 3 files ch

[Mingw-w64-public] [PATCH 07/12] math: Fix cosh(-INFINITY) to return +INFINITY

2019-07-30 Thread Martin Storsjö
Signed-off-by: Martin Storsjö --- mingw-w64-crt/math/coshl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mingw-w64-crt/math/coshl.c b/mingw-w64-crt/math/coshl.c index 4aaaf6e21..c5aaa73ec 100644 --- a/mingw-w64-crt/math/coshl.c +++ b/mingw-w64-crt/math/coshl.c @@ -30,7 +30

[Mingw-w64-public] [PATCH 10/12] ucrt: Don't use the UCRT lgamma functions on any architecture

2019-07-30 Thread Martin Storsjö
The mingw lgamma functions set the signgam variable (which provides information about the last lgamma call, thread-unsafely though), which the UCRT ones don't provide (and obviously doesn't touch the one provided by libmingwex). As this is an interface provided by mingw lgamma so far, we shouldn't

[Mingw-w64-public] [PATCH 11/12] ucrt: Don't use the float env functions from the UCRTt library

2019-07-30 Thread Martin Storsjö
Setting e.g. the rounding mode with fesetround doesn't seem to set the FPU control word for rounding, which means that other math functions implemented in libmingwex don't round in the right direction. Additionally it doesn't actually seem to have any effect on e.g. UCRT's *rint* family of function

[Mingw-w64-public] [PATCH 03/12] math: Don't use the __INFL constant directly in hypotl

2019-07-30 Thread Martin Storsjö
On ARM/ARM64, long double is 64 bit. The __INFL constant is defined as a bit pattern which only works for the x86 80 bit long floats. Instead return INFINITY, which the compiler can convert properly to whichever length long double happens to have. This was the only function where __INFL is refere

[Mingw-w64-public] [PATCH 05/12] math: arm: Add more aliases for -l suffixed math functions

2019-07-30 Thread Martin Storsjö
As long double is the same size as double on arm/arm64, just redirect these functions to the normal unsuffixed version. Signed-off-by: Martin Storsjö --- .../lib-common/api-ms-win-crt-math-l1-1-0.def.in | 10 ++ mingw-w64-crt/lib-common/msvcrt.def.in | 10 ++

[Mingw-w64-public] [PATCH 08/12] math: Properly propagate input NANs in a few functions

2019-07-30 Thread Martin Storsjö
While the C99 standard doesn't explicitly require this, the standard says it is recommended (F.9.13). Signed-off-by: Martin Storsjö --- mingw-w64-crt/math/arm-common/remquo.c | 4 mingw-w64-crt/math/arm-common/remquof.c | 4 mingw-w64-crt/math/erfl.c | 3 +++ mingw-w6

[Mingw-w64-public] [PATCH 02/12] math: Fix the return value for tgamma for zero and negative integers

2019-07-30 Thread Martin Storsjö
For zero, it should return HUGE_VAL (INFINITY), for negative integers, it should return NAN. Signed-off-by: Martin Storsjö --- mingw-w64-crt/math/tgamma.c | 12 ++-- mingw-w64-crt/math/tgammaf.c | 11 +-- mingw-w64-crt/math/tgammal.c | 12 ++-- 3 files changed, 29 insert

Re: [Mingw-w64-public] Fwd: [patch] Reimplement GNU threads library on native Windows

2019-07-30 Thread Eric Botcazou
> 0) complexifies comparison of thread IDs without obvious benefits, and The reverse argument is also true: using IDs would complexify everything else with the only benefit of simplifying the equal primitive. > 1) does not work reliably because handles can be duplicated, and That's pure FUD. >