From: Richard Sandiford <richard.sandiford@linaro.org>
To: Michael Collison <Michael.Collison@arm.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>, nd <nd@arm.com>
Subject: Re: [PATCH 1/2][Aarch64] Improve FP to int conversions
Date: Sat, 19 May 2018 09:26:00 -0000 [thread overview]
Message-ID: <87lgcgm293.fsf@linaro.org> (raw)
In-Reply-To: <VI1PR08MB3053855D2D7D38769BB81EFF95900@VI1PR08MB3053.eurprd08.prod.outlook.com> (Michael Collison's message of "Fri, 18 May 2018 20:34:58 +0000")
Michael Collison <Michael.Collison@arm.com> writes:
> This patch improves additional cases of FP to integer conversions.
>
> Example 1:
>
> unsigned long
> f7 (double x)
> {
> return (unsigned) y;
> }
>
>
> At -O2
>
> Trunk generates:
>
> f7:
> fcvtzu w0, d0
> uxtw x0, w0
> ret
>
> With the patch we can merge the zero-extend and reduce the sequence to one instruction at -O2
>
> f7:
> fcvtzu x0, d0
> ret
Thanks for doing this, patch looks good to me FWIW. I think the
patch actually uses "fcvtzu w0, d0", which unlike "fcvtzu x0, d0"
preserves the rtl semantics exactly.
> +/* { dg-final { scan-assembler "fcvtzu\\tw\[0-9\]+, d\[0-9\]+" } } */
> +/* { dg-final { scan-assembler "fcvtzu\\tw\[0-9\]+, s\[0-9\]+" } } */
Just wanted to plug curly-brace quoting, which avoids the extra backslashes:
/* { dg-final { scan-assembler {fcvtzu\tw[0-9]+, d[0-9]+} } } */
/* { dg-final { scan-assembler {fcvtzu\tw[0-9]+, s[0-9]+} } } */
Either's fine though -- don't respin for that. :-)
Richard
next prev parent reply other threads:[~2018-05-19 9:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-18 20:35 Michael Collison
2018-05-19 9:26 ` Richard Sandiford [this message]
2018-05-21 16:57 ` Richard Earnshaw (lists)
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=87lgcgm293.fsf@linaro.org \
--to=richard.sandiford@linaro.org \
--cc=Michael.Collison@arm.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=nd@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).