Re: [PATCH v2 2/4] iee754: provide gcc builtins based generic fma functions

2020-06-02 Thread Vineet Gupta
On 6/2/20 5:51 AM, Stefan Liebler via Libc-alpha wrote: > #endif /* math-use-builtins.h */ > Please also update the current architecture specific math-use-builtins.h > file: sysdeps/s390/fpu/math-use-builtins.h > Otherwise it will break build on s390x. Done. >> diff --git

Re: [PATCH v2] ieee754/dbl-64: Reduce the scope of temporary storage variables

2020-06-02 Thread Joseph Myers
On Mon, 1 Jun 2020, Vineet Gupta via Libc-alpha wrote: > Also as suggested by Joseph [1] used --strip and compared the libs with > and w/o patch and their sizes are exactly same (with gcc 9). My suggestion was to compare the *contents* of the libraries, not just their sizes. Either they should

Re: [PATCH v6 06/13] ARC: hardware floating point support

2020-06-02 Thread Joseph Myers
On Fri, 29 May 2020, Vineet Gupta via Libc-alpha wrote: > Side question: what do s_ / e_ prefixes mean? > The suffix is clear s_roundf (float), s_round (double), s_roundl (128). I don't know what they stand for (the naming convention probably originates from fdlibm, or at least much of the code

Re: static inline math functions (was Re: [PATCH v6 06/13] ARC: hardware floating point support)

2020-06-02 Thread Adhemerval Zanella
On 02/06/2020 15:13, Joseph Myers wrote: > On Tue, 2 Jun 2020, Vineet Gupta via Libc-alpha wrote: > >> Thi s approach seems to trip math/check-installed-headers.out >> >> >> -std=c89 >> In file included from ../include/fpu_control.h:2, >> from /tmp/cih_test_Nknxdp.c:8: >>

Re: [PATCH v2 3/4] aarch/fpu: use generic builtins based math functions

2020-06-02 Thread Vineet Gupta
On 6/2/20 10:31 AM, Adhemerval Zanella via Libc-alpha wrote: > > > On 01/06/2020 21:35, Vineet Gupta wrote: >> introduce sysdep header math-use-builtins.h to replace aarch64 >> impementations with corresponding generic ones > > s/impementations/implementations and missing ':'. Fixed. >> -

Re: [PATCH v2 1/4] iee754: provide gcc builtins based generic sqrt functions

2020-06-02 Thread Adhemerval Zanella
On 01/06/2020 21:35, Vineet Gupta wrote: > Reviewed-by: Adhemerval Zanella LGTM with the small nit below and the s390 fix pointed by Stefan. Reviewed-by: Adhemerval Zanella > --- > sysdeps/generic/math-use-builtins.h | 3 +++ > sysdeps/ieee754/dbl-64/e_sqrt.c | 6 ++ >

Re: [PATCH 4/5] aarch/fpu: use generic sqrt, fma functions

2020-06-02 Thread Joseph Myers
On Mon, 1 Jun 2020, Vineet Gupta via Libc-alpha wrote: > Also I don't understand one thing. Both the generic and aarch64 code have this > > float > __rintf (float x) > ... > libm_alias_float (__rint, rint) > > The alias arg 1 __rint seems to lack suffix 'f' ? Please see the comments in

Re: [PATCH v2 3/4] aarch/fpu: use generic builtins based math functions

2020-06-02 Thread Adhemerval Zanella
On 01/06/2020 21:35, Vineet Gupta wrote: > introduce sysdep header math-use-builtins.h to replace aarch64 > impementations with corresponding generic ones s/impementations/implementations and missing ':'. > > - newly inroduced generic sqrt{,f}, fma{,f} > - existing floor{,f},

Re: [PATCH v2 1/4] iee754: provide gcc builtins based generic sqrt functions

2020-06-02 Thread Vineet Gupta
On 6/2/20 5:51 AM, Stefan Liebler via Libc-alpha wrote: > On 6/2/20 2:35 AM, Vineet Gupta via Libc-alpha wrote: >> Reviewed-by: Adhemerval Zanella >> --- >> sysdeps/generic/math-use-builtins.h | 3 +++ >> sysdeps/ieee754/dbl-64/e_sqrt.c | 6 ++ >> sysdeps/ieee754/flt-32/e_sqrtf.c|

Re: [PATCH v2 2/4] iee754: provide gcc builtins based generic fma functions

2020-06-02 Thread Adhemerval Zanella
On 01/06/2020 21:35, Vineet Gupta wrote: > --- > sysdeps/generic/math-use-builtins.h | 5 + > sysdeps/ieee754/dbl-64/s_fma.c | 6 ++ > sysdeps/ieee754/dbl-64/s_fmaf.c | 6 ++ > sysdeps/ieee754/float128/float128_private.h | 2 ++ >

Re: [PATCH v6 06/13] ARC: hardware floating point support

2020-06-02 Thread Joseph Myers
On Fri, 29 May 2020, Vineet Gupta via Libc-alpha wrote: > Something like below ? > > +# define _FPU_FPSR_FWE 0x8000 > + > -# define _FPU_GETCW(cw) __asm__ volatile ("lr %0, [0x300]" : "=r" (cw)) > -# define _FPU_SETCW(cw) __asm__ volatile ("sr %0, [0x300]" : : "r" (cw)) >

Re: static inline math functions (was Re: [PATCH v6 06/13] ARC: hardware floating point support)

2020-06-02 Thread Joseph Myers
On Tue, 2 Jun 2020, Vineet Gupta via Libc-alpha wrote: > Thi s approach seems to trip math/check-installed-headers.out > > > -std=c89 > In file included from ../include/fpu_control.h:2, > from /tmp/cih_test_Nknxdp.c:8: > ../sysdeps/arc/fpu_control.h:82:14: error: expected ';' before

Re: [PATCH v2] ieee754/dbl-64: Reduce the scope of temporary storage variables

2020-06-02 Thread Vineet Gupta
On 6/2/20 11:16 AM, Joseph Myers wrote: > On Mon, 1 Jun 2020, Vineet Gupta via Libc-alpha wrote: > >> Also as suggested by Joseph [1] used --strip and compared the libs with >> and w/o patch and their sizes are exactly same (with gcc 9). > > My suggestion was to compare the *contents* of the

Re: [PATCH v2 2/4] iee754: provide gcc builtins based generic fma functions

2020-06-02 Thread Vineet Gupta
On 6/2/20 10:27 AM, Adhemerval Zanella via Libc-alpha wrote: >> I used commit f82996f815 "Use GCC builtins for round functions if desired" as >> starting point for my change. And seems it was not an ideal reference :-) as >> round >> has far fewer instances than fma. Indeed fma is present in

[PATCH v3 4/4] powerpc/fpu: use generic fma functions

2020-06-02 Thread Vineet Gupta
Tested with build-many-glibcs for powerpc-linux-gnu This is a non functional change and powerpc libm before/after was byte invariant as compared below: | cd /SCRATCH/vgupta/gnu/install-glibc-A-baseline | for i in `find . -name libm-2.31.9000.so`; do | echo $i; diff $i

[PATCH v3 1/4] iee754: provide gcc builtins based generic sqrt functions

2020-06-02 Thread Vineet Gupta
Reviewed-by: Adhemerval Zanella --- sysdeps/generic/math-use-builtins.h | 3 +++ sysdeps/ieee754/dbl-64/e_sqrt.c | 6 ++ sysdeps/ieee754/flt-32/e_sqrtf.c | 16 ++-- sysdeps/s390/fpu/math-use-builtins.h | 3 +++ 4 files changed, 22 insertions(+), 6 deletions(-) diff

[PATCH v3 0/4] Enable generic math code for more arches

2020-06-02 Thread Vineet Gupta
Hi, This was suggested by Adhemerval Zanella as part of ARC hard float review. changes since v2: - Add new defines (0) to s390 too as suggested by Stephan - Handle USE_FMA_BUILTIN in both sysdeps/ieee754/{dbl-64,ldbl-128}/s_fma.c - Add diff output for all arches build tested

[PATCH v3 3/4] aarch/fpu: use generic builtins based math functions

2020-06-02 Thread Vineet Gupta
introduce sysdep header math-use-builtins.h to replace aarch64 implementations with corresponding generic ones. - newly inroduced generic sqrt{,f}, fma{,f} - existing floor{,f}, nearbyint{,f}, rint{,f}, round{,f}, trunc{,f} - Note that generic copysign was already enabled (via generic

[PATCH v3 2/4] iee754: provide gcc builtins based generic fma functions

2020-06-02 Thread Vineet Gupta
Reviewed-by: Adhemerval Zanella --- sysdeps/generic/math-use-builtins.h | 5 + sysdeps/ieee754/dbl-64/s_fma.c | 6 ++ sysdeps/ieee754/dbl-64/s_fmaf.c | 6 ++ sysdeps/ieee754/float128/float128_private.h | 2 ++ sysdeps/ieee754/ldbl-128/s_fma.c