Re: [PATCH 2/3][AArch64] Emit square root using the Newton series

2016-06-13 Thread James Greenhalgh
: return gen_aarch64_rsqrts_v4sf3; > -default: gcc_unreachable (); > +default: gcc_unreachable (); >} > } You'll find these two hunks hit a merge conflict on trunk after Jiong's recent changes to these pattern names. Just be careful when applying the patch. The pat

Re: [PATCH 2/3][AArch64] Emit square root using the Newton series

2016-06-03 Thread Evandro Menezes
ccordingly, yes? +This is only relevant if @option{-ffast-math} enables the square root +approximation. + @item -march=@var{name} @opindex march Specify the name of the target architecture and, optionally, one or Thank you, -- Evandro Menezes >From 5c5c07f38cb06507fe997a890dfc5bae

Re: [PATCH 2/3][AArch64] Emit square root using the Newton series

2016-06-01 Thread James Greenhalgh
On Fri, May 27, 2016 at 05:57:26PM -0500, Evandro Menezes wrote: > 2016-04-04 Evandro Menezes > Wilco Dijkstra > > gcc/ > * config/aarch64/aarch64-protos.h > (aarch64_emit_approx_rsqrt): Replace with new function > "aarch64_emit_approx_sqrt". > (cpu_approx_

Re: [PATCH 2/3][AArch64] Emit square root using the Newton series

2016-05-27 Thread Evandro Menezes
e results of these approximations are not accurate, I prefer to let the user decide which of them may be relaxed. Again, I lean towards the way done for RS6000. Thank you, -- Evandro Menezes >From 42e1a3d1289ba3951d3b9a7fd523422b6c0e56c8 Mon Sep 17 00:00:00 2001 From: Evandro Menezes Da

Re: [PATCH 2/3][AArch64] Emit square root using the Newton series

2016-05-25 Thread James Greenhalgh
On Wed, Apr 27, 2016 at 04:15:45PM -0500, Evandro Menezes wrote: >gcc/ > * config/aarch64/aarch64-protos.h > (aarch64_emit_approx_rsqrt): Replace with new function > "aarch64_emit_approx_sqrt". > (tune_params): New member "approx_sqrt_modes". > * config/a

[PATCH 2/3][AArch64] Emit square root using the Newton series

2016-04-27 Thread Evandro Menezes
7 00:00:00 2001 From: Evandro Menezes Date: Mon, 4 Apr 2016 11:23:29 -0500 Subject: [PATCH 2/3] [AArch64] Emit square root using the Newton series 2016-04-04 Evandro Menezes Wilco Dijkstra gcc/ * config/aarch64/aarch64-protos.h (aarch64_emit_approx_rsqrt): Replace w

Re: [AArch64] Emit square root using the Newton series

2016-04-27 Thread Evandro Menezes
oices for the reciprocal square root approximation [PATCH 2/3 AArch64] Emit square root using the Newton series [PATCH 3/3 AArch64] Emit division using the Newton series One patch per email, with the dependencies explicit like this, is infinitely easier to follow than the current structure of

Re: [AArch64] Emit square root using the Newton series

2016-04-27 Thread James Greenhalgh
tch 0/3 AArch64] Add infrastructure for more approximate FP operations [PATCH 1/3 AArch64] Add more choices for the reciprocal square root approximation [PATCH 2/3 AArch64] Emit square root using the Newton series [PATCH 3/3 AArch64] Emit division using the Newton series One patch per email,

RE: [AArch64] Emit square root using the Newton series

2016-04-21 Thread Evandro Menezes
> On 04/05/16 17:30, Evandro Menezes wrote: > > On 04/05/16 13:37, Wilco Dijkstra wrote: > >> I can't get any of these to work... Not only do I get a large number > >> of collisions and duplicated code between these patches, when I try > >> to resolve them, all I get is crashes whenever I try to us

Re: [AArch64] Emit square root using the Newton series

2016-04-12 Thread Evandro Menezes
On 04/05/16 17:30, Evandro Menezes wrote: On 04/05/16 13:37, Wilco Dijkstra wrote: I can't get any of these to work... Not only do I get a large number of collisions and duplicated code between these patches, when I try to resolve them, all I get is crashes whenever I try to use sqrt (even rsqr

Re: [AArch64] Emit square root using the Newton series

2016-04-05 Thread Evandro Menezes
cision-div +@item -mno-low-precision-div +@opindex -mlow-precision-div +@opindex -mno-low-precision-div +When calculating the division approximation, +uses one less step than otherwise, thus reducing latency and precision. +This is only relevant if @option{-ffast-math} enables the division +approxi

Re: [AArch64] Emit square root using the Newton series

2016-04-04 Thread Evandro Menezes
this patch gets close to what all have in mind. [AArch64] Emit square root using the Newton series 2016-04-04 Evandro Menezes Wilco Dijkstra gcc/ * config/aarch64/aarch64-protos.h (aarch64_emit_approx_rsqrt): Replace with

Re: [AArch64] Emit square root using the Newton series

2016-04-01 Thread Evandro Menezes
introduced in it since the first proposal. [AArch64] Emit square root using the Newton series 2016-03-30 Evandro Menezes Wilco Dijkstra gcc/ * config/aarch64/aarch64-protos.h (aarch64_emit_approx_rsqrt): Replace with new

Re: [AArch64] Emit square root using the Newton series

2016-03-24 Thread Evandro Menezes
AArch64] Emit square root using the Newton series 2016-03-23 Evandro Menezes Wilco Dijkstra gcc/ * config/aarch64/aarch64-tuning-flags.def (AARCH64_EXTRA_TUNE_APPROX_SQRT_{SF,DF}): New tuning macros. * config/aarch64/aarch64-protos.h (aarch64_emit_approx_rsqrt):

Re: [AArch64] Emit square root using the Newton series

2016-03-19 Thread James Greenhalgh
On Wed, Mar 16, 2016 at 02:45:37PM -0500, Evandro Menezes wrote: > On 03/08/16 16:08, Evandro Menezes wrote: > >On 02/16/16 14:56, Evandro Menezes wrote: > >>On 12/08/15 15:35, Evandro Menezes wrote: > >>>Emit square root using the Newton series > >&g

Re: [AArch64] Emit square root using the Newton series

2016-03-19 Thread Evandro Menezes
On 03/17/16 09:55, James Greenhalgh wrote: On Wed, Mar 16, 2016 at 02:45:37PM -0500, Evandro Menezes wrote: On 03/08/16 16:08, Evandro Menezes wrote: On 02/16/16 14:56, Evandro Menezes wrote: On 12/08/15 15:35, Evandro Menezes wrote: Emit square root using the Newton series 2015-12-03

Emit square root using the Newton series

2016-03-19 Thread Evandro Menezes
bject: [PATCH] Emit square root using the Newton series 2016-03-17 Evandro Menezes Wilco Dijkstra gcc/ * config/aarch64/aarch64-tuning-flags.def (AARCH64_EXTRA_TUNE_APPROX_SQRT_{SF,DF}): New tuning macros. * config/aarch64/aarch64-protos.h (aarch64_emit_approx_rsqrt):

Re: [AArch64] Emit square root using the Newton series

2016-03-19 Thread Evandro Menezes
On 03/08/16 16:08, Evandro Menezes wrote: On 02/16/16 14:56, Evandro Menezes wrote: On 12/08/15 15:35, Evandro Menezes wrote: Emit square root using the Newton series 2015-12-03 Evandro Menezes gcc/ * config/aarch64/aarch64-protos.h (aarch64_emit_swsqrt): Declare new

Re: [AArch64] Emit square root using the Newton series

2016-03-18 Thread Evandro Menezes
according to exynos-1.md the above takes 44 cycles while my version would be 37. Emit square root using the Newton series 2016-03-16 Evandro Menezes Wilco Dijkstra gcc/ * config/aarch64/aarch64-tuning

Re: [AArch64] Emit square root using the Newton series

2016-03-14 Thread Wilco Dijkstra
Evandro Menezes wrote: > > I got the scalar version going, but I'm stuck with the vector version. > As you can see above, I need to use the complement of the mask produced > by FCMEQ to squelch the offending vector element. However, the way in > which FCMEQ is defined in GCC, it produces an intege

Re: [AArch64] Emit square root using the Newton series

2016-03-14 Thread Evandro Menezes
On 03/10/16 19:06, Wilco Dijkstra wrote: Evandro Menezes wrote: That's what I had in mind too, but around the approximation for x^-1/2 and using masks for vector cases thusly: fcmne v3.4s, v0.4s, #0.0 frsqrte v1.4s, v0.4s fmulv2.4s, v1.4s, v1.4s frsqrts

Re: [AArch64] Emit square root using the Newton series

2016-03-10 Thread Wilco Dijkstra
Evandro Menezes wrote: > > That's what I had in mind too, but around the approximation for x^-1/2 > and using masks for vector cases thusly: > >fcmne v3.4s, v0.4s, #0.0 > frsqrte v1.4s, v0.4s > fmulv2.4s, v1.4s, v1.4s > frsqrts v2.4s, v0.4s, v2.4s > fm

Re: [AArch64] Emit square root using the Newton series

2016-03-10 Thread Evandro Menezes
On 03/10/16 13:10, Wilco Dijkstra wrote: frsqrte s1, s0 fmul s2, s1, s1 frsqrts s2, s0, s2 fcmp s0, 0.0 fmul s1, s1, s2 fmul s2, s1, s1 fmul s1, s0, s1 frsqrts s2, s0, s2 fcsels1, s0, s1, eq fmul s0, s1, s2 That's

Re: [AArch64] Emit square root using the Newton series

2016-03-10 Thread Wilco Dijkstra
On 03/10/16 10:52, Wilco Dijkstra wrote: > Hi Evandro, > >> I have however encountered precision issues with DF, namely some benchmarks >> in the SPECfp CPU2000 suite would fail to validate. > Accuracy is not an issue, the computation is extremely accurate. The issue is > that your patch doesn't

Re: [AArch64] Emit square root using the Newton series

2016-03-10 Thread Evandro Menezes
On 03/10/16 10:52, Wilco Dijkstra wrote: Hi Evandro, I have however encountered precision issues with DF, namely some benchmarks in the SPECfp CPU2000 suite would fail to validate. Accuracy is not an issue, the computation is extremely accurate. The issue is that your patch doesn't support s

Re: [AArch64] Emit square root using the Newton series

2016-03-10 Thread Wilco Dijkstra
Hi Evandro, > I have however encountered precision issues with DF, namely some benchmarks > in the SPECfp CPU2000 suite would fail to validate. Accuracy is not an issue, the computation is extremely accurate. The issue is that your patch doesn't support sqrt(0.0) - it returns NaN rather than z

Re: [AArch64] Emit square root using the Newton series

2016-03-08 Thread Evandro Menezes
On 03/08/16 16:08, Evandro Menezes wrote: On 02/16/16 14:56, Evandro Menezes wrote: On 12/08/15 15:35, Evandro Menezes wrote: Emit square root using the Newton series 2015-12-03 Evandro Menezes gcc/ * config/aarch64/aarch64-protos.h (aarch64_emit_swsqrt): Declare new

Re: [AArch64] Emit square root using the Newton series

2016-03-08 Thread Evandro Menezes
On 03/08/16 16:08, Evandro Menezes wrote: On 02/16/16 14:56, Evandro Menezes wrote: On 12/08/15 15:35, Evandro Menezes wrote: Emit square root using the Newton series 2015-12-03 Evandro Menezes gcc/ * config/aarch64/aarch64-protos.h (aarch64_emit_swsqrt): Declare new

Re: [AArch64] Emit square root using the Newton series

2016-03-08 Thread Evandro Menezes
On 02/16/16 14:56, Evandro Menezes wrote: On 12/08/15 15:35, Evandro Menezes wrote: Emit square root using the Newton series 2015-12-03 Evandro Menezes gcc/ * config/aarch64/aarch64-protos.h (aarch64_emit_swsqrt): Declare new function. * config

Re: [AArch64] Emit square root using the Newton series

2016-03-03 Thread Evandro Menezes
On 02/16/16 14:56, Evandro Menezes wrote: On 12/08/15 15:35, Evandro Menezes wrote: Emit square root using the Newton series 2015-12-03 Evandro Menezes gcc/ * config/aarch64/aarch64-protos.h (aarch64_emit_swsqrt): Declare new function. * config

Re: [AArch64] Emit square root using the Newton series

2016-02-26 Thread Evandro Menezes
On 02/26/16 17:42, Evandro Menezes wrote: On 02/26/16 08:59, James Greenhalgh wrote: On Mon, Feb 22, 2016 at 06:50:44PM -0600, Evandro Menezes wrote: In preparation for the patch adding the Newton series also for square root, I'd like to propose this patch changing the name of the existing tuni

Re: [AArch64] Emit square root using the Newton series

2016-02-26 Thread Evandro Menezes
On 02/26/16 08:59, James Greenhalgh wrote: On Mon, Feb 22, 2016 at 06:50:44PM -0600, Evandro Menezes wrote: In preparation for the patch adding the Newton series also for square root, I'd like to propose this patch changing the name of the existing tuning flag for the reciprocal square root. Th

Re: [AArch64] Emit square root using the Newton series

2016-02-26 Thread James Greenhalgh
On Mon, Feb 22, 2016 at 06:50:44PM -0600, Evandro Menezes wrote: > In preparation for the patch adding the Newton series also for > square root, I'd like to propose this patch changing the name of the > existing tuning flag for the reciprocal square root. This is fine, other names like sw_rsqrt, e

Re: [AArch64] Emit square root using the Newton series

2016-02-22 Thread Evandro Menezes
, Evandro Menezes wrote: Emit square root using the Newton series 2015-12-03 Evandro Menezes gcc/ * config/aarch64/aarch64-protos.h (aarch64_emit_swsqrt): Declare new function. * config/aarch64/aarch64-simd.md (sqrt2): New expansion and

Re: [AArch64] Emit square root using the Newton series

2016-02-16 Thread Evandro Menezes
On 12/08/15 15:35, Evandro Menezes wrote: Emit square root using the Newton series 2015-12-03 Evandro Menezes gcc/ * config/aarch64/aarch64-protos.h (aarch64_emit_swsqrt): Declare new function. * config/aarch64/aarch64-simd.md (sqrt2): New

Re: [AArch64] Emit square root using the Newton series

2015-12-10 Thread Kyrill Tkachov
using the Newton series 2015-12-03 Evandro Menezes gcc/ * config/aarch64/aarch64-protos.h (aarch64_emit_swsqrt): Declare new function. * config/aarch64/aarch64-simd.md (sqrt2): New expansion and insn definitions. * config

Re: [AArch64] Emit square root using the Newton series

2015-12-09 Thread Evandro Menezes
On 12/09/2015 11:16 AM, Kyrill Tkachov wrote: On 09/12/15 17:02, Kyrill Tkachov wrote: On 09/12/15 16:59, Evandro Menezes wrote: On 12/09/2015 10:52 AM, Kyrill Tkachov wrote: Hi Evandro, On 08/12/15 21:35, Evandro Menezes wrote: Emit square root using the Newton series 2015-12-03

Re: [AArch64] Emit square root using the Newton series

2015-12-09 Thread Kyrill Tkachov
On 09/12/15 17:02, Kyrill Tkachov wrote: On 09/12/15 16:59, Evandro Menezes wrote: On 12/09/2015 10:52 AM, Kyrill Tkachov wrote: Hi Evandro, On 08/12/15 21:35, Evandro Menezes wrote: Emit square root using the Newton series 2015-12-03 Evandro Menezes gcc/ * config

Re: [AArch64] Emit square root using the Newton series

2015-12-09 Thread Kyrill Tkachov
On 09/12/15 16:59, Evandro Menezes wrote: On 12/09/2015 10:52 AM, Kyrill Tkachov wrote: Hi Evandro, On 08/12/15 21:35, Evandro Menezes wrote: Emit square root using the Newton series 2015-12-03 Evandro Menezes gcc/ * config/aarch64/aarch64-protos.h (aarch64_emit_swsqrt

Re: [AArch64] Emit square root using the Newton series

2015-12-09 Thread Evandro Menezes
On 12/09/2015 10:52 AM, Kyrill Tkachov wrote: Hi Evandro, On 08/12/15 21:35, Evandro Menezes wrote: Emit square root using the Newton series 2015-12-03 Evandro Menezes gcc/ * config/aarch64/aarch64-protos.h (aarch64_emit_swsqrt): Declare new function

Re: [AArch64] Emit square root using the Newton series

2015-12-09 Thread Kyrill Tkachov
Hi Evandro, On 08/12/15 21:35, Evandro Menezes wrote: Emit square root using the Newton series 2015-12-03 Evandro Menezes gcc/ * config/aarch64/aarch64-protos.h (aarch64_emit_swsqrt): Declare new function. * config/aarch64/aarch64-simd.md (sqrt2

RE: [AArch64] Emit square root using the Newton series

2015-12-09 Thread Evandro Menezes
GCC Patches; Marcus Shawcroft; James Greenhalgh; Andrew Pinski; Benedikt > Huber; philipp.toms...@theobroma-systems.com > Subject: Re: [AArch64] Emit square root using the Newton series > > On 8 December 2015 at 21:35, Evandro Menezes wrote: > >Emit square root using the Newt

Re: [AArch64] Emit square root using the Newton series

2015-12-09 Thread Marcus Shawcroft
On 8 December 2015 at 21:35, Evandro Menezes wrote: > Emit square root using the Newton series > >2015-12-03 Evandro Menezes > >gcc/ > * config/aarch64/aarch64-protos.h (aarch64_emit_swsqrt): >Declare new > function. >

[AArch64] Emit square root using the Newton series

2015-12-08 Thread Evandro Menezes
Emit square root using the Newton series 2015-12-03 Evandro Menezes gcc/ * config/aarch64/aarch64-protos.h (aarch64_emit_swsqrt): Declare new function. * config/aarch64/aarch64-simd.md (sqrt2): New expansion and insn definitions