From: Evandro Menezes <e.menezes@samsung.com>
To: James Greenhalgh <james.greenhalgh@arm.com>, gcc-patches@gcc.gnu.org
Cc: nd@arm.com, marcus.shawcroft@arm.com, richard.earnshaw@arm.com,
Venkataramanan.Kumar@amd.com,
philipp.tomsich@theobroma-systems.com, pinskia@gmail.com,
Kyrylo.Tkachov@arm.com
Subject: Re: [Patch AArch64] Use software sqrt expansion always for -mlow-precision-recip-sqrt
Date: Mon, 11 Jan 2016 22:58:00 -0000 [thread overview]
Message-ID: <56943374.1010607@samsung.com> (raw)
In-Reply-To: <1452513219-25168-1-git-send-email-james.greenhalgh@arm.com>
On 01/11/2016 05:53 AM, James Greenhalgh wrote:
> I'd like to switch the logic around in aarch64.c such that
> -mlow-precision-recip-sqrt causes us to always emit the low-precision
> software expansion for reciprocal square root. I have two reasons to do
> this; first is consistency across -mcpu targets, second is enabling more
> -mcpu targets to use the flag for peak tuning.
>
> I don't much like that the precision we use for -mlow-precision-recip-sqrt
> differs between cores (and possibly compiler revisions). Yes, we're
> under -ffast-math but I take this flag to mean the user explicitly wants the
> low-precision expansion, and we should not diverge from that based on an
> internal decision as to what is optimal for performance in the
> high-precision case. I'd prefer to keep things as predictable as possible,
> and here that means always emitting the low-precision expansion when asked.
>
> Judging by the comments in the thread proposing the reciprocal square
> root optimisation, this will benefit all cores currently supported by GCC.
> To be clear, we would still not expand in the high-precision case for any
> cores which do not explicitly ask for it. Currently that is Cortex-A57
> and xgene, though I will be proposing a patch to remove Cortex-A57 from
> that list shortly.
>
> Which gives my second motivation for this patch. -mlow-precision-recip-sqrt
> is intended as a tuning flag for situations where performance is more
> important than precision, but the current logic requires setting an
> internal flag which also changes the performance characteristics where
> high-precision is needed. This conflates two decisions the target might
> want to make, and reduces the applicability of an option targets might
> want to enable for performance. In particular, I'd still like to see
> -mlow-precision-recip-sqrt continue to emit the cheaper, low-precision
> sequence for floats under Cortex-A57.
>
> Based on that reasoning, this patch makes the appropriate change to the
> logic. I've checked with the current -mcpu values to ensure that behaviour
> without -mlow-precision-recip-sqrt does not change, and that behaviour
> with -mlow-precision-recip-sqrt is to emit the low precision sequences.
>
> I've also put this through bootstrap and test on aarch64-none-linux-gnu
> with no issues.
>
> OK?
Yes, it LGTM.
I appreciate the idea of uniformity whne an option is specified, which
led me to think if it wouldn't be a good ide to add an option that would
have the effect of focring the emission of the reciprocal square root,
effectively forcing the flag AARCH64_EXTRA_TUNE_RECIP_SQRT on,
regardless of the tuning flags for the given core. I think that this
flag would be particularly useful when specifying flags for specific
functions, irrespective of the core.
Thoughts?
--
Evandro Menezes
next prev parent reply other threads:[~2016-01-11 22:58 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-11 11:53 James Greenhalgh
2016-01-11 12:05 ` [AArch64] Remove AARCH64_EXTRA_TUNE_RECIP_SQRT from Cortex-A57 tuning James Greenhalgh
2016-01-11 13:31 ` Dr. Philipp Tomsich
2016-01-25 11:20 ` James Greenhalgh
2016-02-01 14:00 ` James Greenhalgh
2016-02-08 10:57 ` James Greenhalgh
2016-02-15 10:50 ` James Greenhalgh
2016-02-15 17:25 ` Evandro Menezes
2016-02-16 10:28 ` James Greenhalgh
2016-02-16 20:46 ` Evandro Menezes
2016-02-16 8:49 ` Marcus Shawcroft
2016-01-11 22:58 ` Evandro Menezes [this message]
2016-01-12 11:32 ` [Patch AArch64] Use software sqrt expansion always for -mlow-precision-recip-sqrt James Greenhalgh
2016-01-12 11:44 ` Kyrill Tkachov
2016-01-12 5:53 ` Kumar, Venkataramanan
2016-01-12 11:48 ` James Greenhalgh
2016-01-25 11:21 ` James Greenhalgh
2016-02-01 13:59 ` James Greenhalgh
2016-02-08 10:57 ` James Greenhalgh
2016-02-15 10:48 ` James Greenhalgh
2016-02-16 8:40 ` Marcus Shawcroft
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=56943374.1010607@samsung.com \
--to=e.menezes@samsung.com \
--cc=Kyrylo.Tkachov@arm.com \
--cc=Venkataramanan.Kumar@amd.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=james.greenhalgh@arm.com \
--cc=marcus.shawcroft@arm.com \
--cc=nd@arm.com \
--cc=philipp.tomsich@theobroma-systems.com \
--cc=pinskia@gmail.com \
--cc=richard.earnshaw@arm.com \
/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).