public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Dr. Philipp Tomsich" <philipp.tomsich@theobroma-systems.com>
To: Evandro Menezes <e.menezes@samsung.com>
Cc: Benedikt Huber <benedikt.huber@theobroma-systems.com>,
	gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] [aarch64] Implemented reciprocal square root (rsqrt) estimation in -ffast-math
Date: Wed, 24 Jun 2015 20:11:00 -0000	[thread overview]
Message-ID: <3F0CA634-AF3D-4AD9-8702-9B5D19821889@theobroma-systems.com> (raw)
In-Reply-To: <02a401d0aeaa$5a5e7ec0$0f1b7c40$@samsung.com>

Evandro,

Shouldn't ‘execute_cse_reciprocals_1’ take care of this, once the reciprocal-division is implemented?
Do you think there’s additional work needed to catch all cases/opportunities?

Best,
Philipp.

> On 24 Jun 2015, at 20:19, Evandro Menezes <e.menezes@samsung.com> wrote:
> 
> Benedikt,
> 
> Are you developing the reciprocal approximation just for 1/x proper or for any division, as in x/y = x * 1/y?
> 
> Thank you,
> 
> -- 
> Evandro Menezes                              Austin, TX
> 
> 
>> -----Original Message-----
>> From: Benedikt Huber [mailto:benedikt.huber@theobroma-systems.com]
>> Sent: Wednesday, June 24, 2015 12:11
>> To: Dr. Philipp Tomsich
>> Cc: Evandro Menezes; gcc-patches@gcc.gnu.org
>> Subject: Re: [PATCH] [aarch64] Implemented reciprocal square root (rsqrt)
>> estimation in -ffast-math
>> 
>> Evandro,
>> 
>> Yes, we also have the 1/x approximation.
>> However we do not have the test cases yet, and it also would need some clean
>> up.
>> I am going to provide a patch for that soon (say next week).
>> Also, for this optimization we have *not* yet found a benchmark with
>> significant improvements.
>> 
>> Best Regards,
>> Benedikt
>> 
>> 
>>> On 24 Jun 2015, at 18:52, Dr. Philipp Tomsich <philipp.tomsich@theobroma-
>> systems.com> wrote:
>>> 
>>> Evandro,
>>> 
>>> We’ve seen a 28% speed-up on gromacs in SPECfp for the (scalar) reciprocal
>> sqrt.
>>> 
>>> Also, the “reciprocal divide” patches are floating around in various
>>> of our git-tree, but aren’t ready for public consumption, yet… I’ll
>>> leave Benedikt to comment on potential timelines for getting that pushed
>> out.
>>> 
>>> Best,
>>> Philipp.
>>> 
>>>> On 24 Jun 2015, at 18:42, Evandro Menezes <e.menezes@samsung.com> wrote:
>>>> 
>>>> Benedikt,
>>>> 
>>>> You beat me to it! :-)  Do you have the implementation for dividing
>>>> using the Newton series as well?
>>>> 
>>>> I'm not sure that the series is always for all data types and on all
>>>> processors.  It would be useful to allow each AArch64 processor to
>>>> enable this or not depending on the data type.  BTW, do you have some
>>>> tests showing the speed up?
>>>> 
>>>> Thank you,
>>>> 
>>>> --
>>>> Evandro Menezes                              Austin, TX
>>>> 
>>>>> -----Original Message-----
>>>>> From: gcc-patches-owner@gcc.gnu.org
>>>>> [mailto:gcc-patches-owner@gcc.gnu.org]
>>>> On
>>>>> Behalf Of Benedikt Huber
>>>>> Sent: Thursday, June 18, 2015 7:04
>>>>> To: gcc-patches@gcc.gnu.org
>>>>> Cc: benedikt.huber@theobroma-systems.com; philipp.tomsich@theobroma-
>>>>> systems.com
>>>>> Subject: [PATCH] [aarch64] Implemented reciprocal square root
>>>>> (rsqrt) estimation in -ffast-math
>>>>> 
>>>>> arch64 offers the instructions frsqrte and frsqrts, for rsqrt
>>>>> estimation
>>>> and
>>>>> a Newton-Raphson step, respectively.
>>>>> There are ARMv8 implementations where this is faster than using fdiv
>>>>> and rsqrt.
>>>>> It runs three steps for double and two steps for float to achieve
>>>>> the
>>>> needed
>>>>> precision.
>>>>> 
>>>>> There is one caveat and open question.
>>>>> Since -ffast-math enables flush to zero intermediate values between
>>>>> approximation steps will be flushed to zero if they are denormal.
>>>>> E.g. This happens in the case of rsqrt (DBL_MAX) and rsqrtf (FLT_MAX).
>>>>> The test cases pass, but it is unclear to me whether this is
>>>>> expected behavior with -ffast-math.
>>>>> 
>>>>> The patch applies to commit:
>>>>> svn+ssh://gcc.gnu.org/svn/gcc/trunk@224470
>>>>> 
>>>>> Please consider including this patch.
>>>>> Thank you and best regards,
>>>>> Benedikt Huber
>>>>> 
>>>>> Benedikt Huber (1):
>>>>> 2015-06-15  Benedikt Huber  <benedikt.huber@theobroma-systems.com>
>>>>> 
>>>>> gcc/ChangeLog                            |   9 +++
>>>>> gcc/config/aarch64/aarch64-builtins.c    |  60 ++++++++++++++++
>>>>> gcc/config/aarch64/aarch64-protos.h      |   2 +
>>>>> gcc/config/aarch64/aarch64-simd.md       |  27 ++++++++
>>>>> gcc/config/aarch64/aarch64.c             |  63 +++++++++++++++++
>>>>> gcc/config/aarch64/aarch64.md            |   3 +
>>>>> gcc/testsuite/gcc.target/aarch64/rsqrt.c | 113
>>>>> +++++++++++++++++++++++++++++++
>>>>> 7 files changed, 277 insertions(+)
>>>>> create mode 100644 gcc/testsuite/gcc.target/aarch64/rsqrt.c
>>>>> 
>>>>> --
>>>>> 1.9.1
>>>> <Mail Attachment.eml>
>>> 
> 
> 

  reply	other threads:[~2015-06-24 20:08 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-18 11:57 Benedikt Huber
2015-06-18 12:03 ` [PATCH] 2015-06-15 Benedikt Huber <benedikt.huber@theobroma-systems.com> Benedikt Huber
2015-06-27  8:12   ` Andrew Pinski
2015-06-18 12:36 ` [PATCH] [aarch64] Implemented reciprocal square root (rsqrt) estimation in -ffast-math Kumar, Venkataramanan
2015-06-24 16:49 ` Evandro Menezes
2015-06-24 16:55   ` Dr. Philipp Tomsich
2015-06-24 17:16     ` Benedikt Huber
2015-06-24 18:37       ` Evandro Menezes
2015-06-24 20:11         ` Dr. Philipp Tomsich [this message]
2015-06-24 20:54           ` Evandro Menezes
2015-06-25 11:52             ` Benedikt Huber
2015-06-25  7:01     ` Kumar, Venkataramanan
2015-06-25  7:03 ` pinskia
2015-06-25  9:43   ` Ramana Radhakrishnan
2015-06-27  2:01     ` Andrew Pinski
2015-06-25 11:07   ` Benedikt Huber
2015-06-25 13:27     ` Michael Matz
2015-06-25 15:43     ` Kumar, Venkataramanan
2015-06-25 15:52       ` Dr. Philipp Tomsich
2015-06-25 16:47         ` Kumar, Venkataramanan
2015-06-28 15:13           ` pinskia
2015-06-29  8:30             ` Kumar, Venkataramanan
2015-06-29  9:07               ` Dr. Philipp Tomsich
2015-06-29  9:22                 ` Kumar, Venkataramanan
2015-06-29 11:44                   ` James Greenhalgh
2015-06-29 11:56                     ` Dr. Philipp Tomsich
2015-06-29 16:57                       ` pinskia
2015-06-29 19:07                         ` Kumar, Venkataramanan
2015-07-14 22:26                           ` Evandro Menezes
2015-07-20  9:46                             ` Kumar, Venkataramanan
2015-07-20 15:58                               ` Evandro Menezes
2015-07-13 19:09                       ` Evandro Menezes
2015-07-14 22:20                 ` Evandro Menezes
2015-06-29 14:20               ` Benedikt Huber
2015-06-29 17:35               ` Benedikt Huber
2015-06-29 17:44                 ` Kumar, Venkataramanan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3F0CA634-AF3D-4AD9-8702-9B5D19821889@theobroma-systems.com \
    --to=philipp.tomsich@theobroma-systems.com \
    --cc=benedikt.huber@theobroma-systems.com \
    --cc=e.menezes@samsung.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).