Re: [PATCH] PR libgcc/59714 complex division is surprising on aarch64

2018-02-06 Thread Joseph Myers
On Tue, 6 Feb 2018, vladimir.mezent...@oracle.com wrote: > We see 'struct _FP_STRUCT_LAYOUT' is declared twice (in lines 206 and _FP_STRUCT_LAYOUT is not a struct tag. It is a macro that may be defined to empty, or to an attribute, and defaults to empty in soft-fp.h if not otherwise defined

Re: [PATCH] PR libgcc/59714 complex division is surprising on aarch64

2018-02-06 Thread vladimir . mezentsev
On 02/06/2018 08:53 AM, Joseph Myers wrote: > The files in libgcc/soft-fp must be verbatim copies of the master sources > in glibc. So you can't make any local changes to them, and if you think > changes are needed you need to patch things upstream in glibc first, with > a proper extended

Re: [PATCH] PR libgcc/59714 complex division is surprising on aarch64

2018-02-06 Thread Joseph Myers
On Tue, 6 Feb 2018, vladimir.mezent...@oracle.com wrote: >  I compared with __builtin_ilogb. There is a same performance degradation. I'm not clear on exactly what you compared with. Do you mean the *existing* __builtin_ilogb? That's only supported for constant arguments that are not zero,

Re: [PATCH] PR libgcc/59714 complex division is surprising on aarch64

2018-02-06 Thread Joseph Myers
On Mon, 5 Feb 2018, vladimir.mezent...@oracle.com wrote: > My implementation avoids these issues. > I use soft-fp instead built-in functions because performance with built-in > functions (like __builtin_ilogb) is in two times worse. > Also libm is needed for built-in functions. I think you still

Re: [PATCH] PR libgcc/59714 complex division is surprising on aarch64

2018-02-06 Thread vladimir . mezentsev
On 01/29/2018 12:51 PM, Joseph Myers wrote: > On Mon, 29 Jan 2018, vladimir.mezent...@oracle.com wrote: > >>> What about powerpc __divkc3? >>> >>> What was the rationale for using soft-fp rather than adding appropriate >>> built-in functions as suggested in a comment? >> I had a version with

[PATCH] PR libgcc/59714 complex division is surprising on aarch64

2018-02-05 Thread vladimir . mezentsev
From: Vladimir Mezentsev Tested on aarch64-linux-gnu, x86_64-pc-linux-gnu and sparc64-unknown-linux-gnu. No regression. New tests now passed. There is a performance degradation for complex double type: failed cases |time old new

Re: [PATCH] PR libgcc/59714 complex division is surprising on aarch64

2018-01-29 Thread Joseph Myers
On Mon, 29 Jan 2018, vladimir.mezent...@oracle.com wrote: > > What about powerpc __divkc3? > > > > What was the rationale for using soft-fp rather than adding appropriate > > built-in functions as suggested in a comment? > > I had a version with built-in functions and I can restore it. > >

Re: [PATCH] PR libgcc/59714 complex division is surprising on aarch64

2018-01-29 Thread vladimir . mezentsev
On 01/25/2018 04:14 PM, Joseph Myers wrote: > On Thu, 25 Jan 2018, vladimir.mezent...@oracle.com wrote: > >> From: Vladimir Mezentsev >> >> Tested on aarch64-linux-gnu, x86_64-pc-linux-gnu and >> sparc64-unknown-linux-gnu. >> No regression. New tests now passed.

Re: [PATCH] PR libgcc/59714 complex division is surprising on aarch64

2018-01-25 Thread Joseph Myers
On Thu, 25 Jan 2018, vladimir.mezent...@oracle.com wrote: > From: Vladimir Mezentsev > > Tested on aarch64-linux-gnu, x86_64-pc-linux-gnu and > sparc64-unknown-linux-gnu. > No regression. New tests now passed. > There is a performance degradation for complex

[PATCH] PR libgcc/59714 complex division is surprising on aarch64

2018-01-25 Thread vladimir . mezentsev
From: Vladimir Mezentsev Tested on aarch64-linux-gnu, x86_64-pc-linux-gnu and sparc64-unknown-linux-gnu. No regression. New tests now passed. There is a performance degradation for complex double type: failed cases |time old new

Re: [PATCH] PR libgcc/59714 complex division is surprising on aarch64

2017-10-25 Thread Joseph Myers
On Wed, 25 Oct 2017, vladimir.mezent...@oracle.com wrote: > On 10/25/2017 10:28 AM, Joseph Myers wrote: > > On Wed, 25 Oct 2017, vladimir.mezent...@oracle.com wrote: > > > >> +# Disable FMA (floating-point multiply-add) instructions for complex > >> division. > >> +# These instructions can

Re: [PATCH] PR libgcc/59714 complex division is surprising on aarch64

2017-10-25 Thread vladimir . mezentsev
On 10/25/2017 10:28 AM, Joseph Myers wrote: > On Wed, 25 Oct 2017, vladimir.mezent...@oracle.com wrote: > >> +# Disable FMA (floating-point multiply-add) instructions for complex >> division. >> +# These instructions can produce different result if two operations >> executed separately. >>

Re: [PATCH] PR libgcc/59714 complex division is surprising on aarch64

2017-10-25 Thread Joseph Myers
On Wed, 25 Oct 2017, vladimir.mezent...@oracle.com wrote: > +# Disable FMA (floating-point multiply-add) instructions for complex > division. > +# These instructions can produce different result if two operations executed > separately. > +LIBGCC2_FFP_CONTRAST_CFLAGS = -ffp-contract=off >

[PATCH] PR libgcc/59714 complex division is surprising on aarch64

2017-10-25 Thread vladimir . mezentsev
From: Vladimir Mezentsev FMA (floating-point multiply-add) instructions are supported on aarch64. These instructions can produce different result if two operations executed separately. -ffp-contract=off doesn't allow the FMA instructions. Tested on

Re: [PATCH] PR libgcc/59714 complex division is surprising on aarch64

2017-10-24 Thread vladimir . mezentsev
On 10/19/2017 06:07 AM, Wilco Dijkstra wrote: > Vladimir wrote: > > +# Disable floating-point expression contraction > +LIBGCC2_FFP_CONTRAST_CFLAGS = -ffp-contract=off > + > > It looks like this disables fp-contract in all of libgcc... > What is the the number of FMAs in libgcc before/after? In

Re: [PATCH] PR libgcc/59714 complex division is surprising on aarch64

2017-10-19 Thread Wilco Dijkstra
Vladimir Mezentsev > On 10/19/2017 06:37 AM, Richard Earnshaw (lists) wrote: >> On 19/10/17 14:07, Wilco Dijkstra wrote: >>> Vladimir wrote: >>> >>> +# Disable floating-point expression contraction >>> +LIBGCC2_FFP_CONTRAST_CFLAGS = -ffp-contract=off >>> + >>> >>>

Re: [PATCH] PR libgcc/59714 complex division is surprising on aarch64

2017-10-19 Thread Vladimir Mezentsev
On 10/19/2017 06:37 AM, Richard Earnshaw (lists) wrote: On 19/10/17 14:07, Wilco Dijkstra wrote: Vladimir wrote: +# Disable floating-point expression contraction +LIBGCC2_FFP_CONTRAST_CFLAGS = -ffp-contract=off + It looks like this disables fp-contract in all of libgcc... What is the the

Re: [PATCH] PR libgcc/59714 complex division is surprising on aarch64

2017-10-19 Thread Richard Earnshaw (lists)
On 19/10/17 14:07, Wilco Dijkstra wrote: > Vladimir wrote: > > +# Disable floating-point expression contraction > +LIBGCC2_FFP_CONTRAST_CFLAGS = -ffp-contract=off > + > > It looks like this disables fp-contract in all of libgcc... > What is the the number of FMAs in libgcc before/after? > > If

Re: [PATCH] PR libgcc/59714 complex division is surprising on aarch64

2017-10-19 Thread Wilco Dijkstra
Vladimir wrote: +# Disable floating-point expression contraction +LIBGCC2_FFP_CONTRAST_CFLAGS = -ffp-contract=off + It looks like this disables fp-contract in all of libgcc... What is the the number of FMAs in libgcc before/after? If it disables anything other than the ones in complex division,

[PATCH] PR libgcc/59714 complex division is surprising on aarch64

2017-10-18 Thread vladimir . mezentsev
From: Vladimir Mezentsev FMA (floating-point multiply-add) instructions are supported on aarch64. These instructions can produce different result if two operations executed separately. -ffp-contract=off doesn't allow the FMA instructions. Tested on two platforms: