public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tamar Christina <Tamar.Christina@arm.com>
To: Christophe Lyon <christophe.lyon@linaro.org>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>, nd <nd@arm.com>,
	Richard Earnshaw	<Richard.Earnshaw@arm.com>,
	Marcus Shawcroft <Marcus.Shawcroft@arm.com>
Subject: Re: [PATCH][GCC][AArch64] Inline calls to lrint when possible
Date: Mon, 12 Jun 2017 14:29:00 -0000	[thread overview]
Message-ID: <VI1PR0801MB20318B3C9665577969EE731EFFCD0@VI1PR0801MB2031.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <CAKdteOZyUL5j585+NkO0TX0dT49N1XPE43DV_1o=sWC10_k5EQ@mail.gmail.com>

Hi Christophe,

Thanks, I've committed a fix to the testcase.

Tamar
________________________________________
From: Christophe Lyon <christophe.lyon@linaro.org>
Sent: Monday, June 12, 2017 1:10:38 PM
To: Tamar Christina
Cc: GCC Patches; nd; Richard Earnshaw; Marcus Shawcroft
Subject: Re: [PATCH][GCC][AArch64] Inline calls to lrint when possible

Hi Tamar,

On 8 June 2017 at 18:50, James Greenhalgh <james.greenhalgh@arm.com> wrote:
> On Wed, Jun 07, 2017 at 12:38:27PM +0100, Tamar Christina wrote:
>> Hi All,
>>
>> This patch allows the inlining of lrint when -fno-math-errno
>> assuming that errno does not need to be set when the rounded value
>> is not representable as a long.
>>
>> The case
>>
>> void f(double *a, long *b, double x)
>> {
>>       *a = __builtin_rint(x);
>>       *b = __builtin_lrint(x);
>> }
>>
>> now generates with -fno-math-errno:
>>
>> f:
>>       frintx  d0, d0
>>       fcvtzs  x2, d0
>>       str     d0, [x0]
>>       str     x2, [x1]
>>       ret
>>
>> When the flag is not used the same function call is emitted as before:
>>
>> f:
>>       stp     x29, x30, [sp, -32]!
>>       frintx  d1, d0
>>       add     x29, sp, 0
>>       str     x19, [sp, 16]
>>       mov     x19, x1
>>       str     d1, [x0]
>>       bl      lrint
>>       str     x0, [x19]
>>       ldr     x19, [sp, 16]
>>       ldp     x29, x30, [sp], 32
>>       ret
>>
>> Bootstrapped and regtested on aarch64-none-linux-gnu and no regressions.
>> The patch also has no regressions on Spec2006.
>>
>> Ok for trunk?
>
> OK.
>
> Thanks,
> James
>
>>
>> gcc/
>> 2017-06-07  Tamar Christina  <tamar.christina@arm.com>
>>
>>       * config/aarch64/aarch64.md (lrint<GPF:mode><GPI:mode>2): New.
>>
>> gcc/testsuite/
>> 2017-06-07  Tamar Christina  <tamar.christina@arm.com>
>>
>>       * gcc.target/aarch64/lrint-matherr.h: New.
>>       * gcc.target/aarch64/inline-lrint_1.c: New.
>>       * gcc.target/aarch64/inline-lrint_2.c: New.
>>       * gcc.target/aarch64/no-inline-lrint_1.c: New.
>>       * gcc.target/aarch64/no-inline-lrint_2.c: New.
>
>

The tests
    gcc.target/aarch64/inline-lrint_1.c scan-assembler-times
fcvtzs\tx[0-9]+, d[0-9]+ 3
    gcc.target/aarch64/inline-lrint_1.c scan-assembler-times
fcvtzs\tx[0-9]+, s[0-9]+ 3
    gcc.target/aarch64/inline-lrint_1.c scan-assembler-times
frintx\td[0-9]+, d[0-9]+ 3
    gcc.target/aarch64/inline-lrint_1.c scan-assembler-times
frintx\ts[0-9]+, s[0-9]+ 3
    gcc.target/aarch64/no-inline-lrint_1.c scan-assembler-times
frintx\td[0-9]+, d[0-9]+ 3
    gcc.target/aarch64/no-inline-lrint_1.c scan-assembler-times
frintx\ts[0-9]+, s[0-9]+ 3
fail on aarch64 bare-metal targets (and pass on aarch64-linux-gnu)

  reply	other threads:[~2017-06-12 14:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-07 11:38 Tamar Christina
2017-06-08 16:51 ` James Greenhalgh
2017-06-12 12:10   ` Christophe Lyon
2017-06-12 14:29     ` Tamar Christina [this message]
2017-08-10 16:39 ` Szabolcs Nagy

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=VI1PR0801MB20318B3C9665577969EE731EFFCD0@VI1PR0801MB2031.eurprd08.prod.outlook.com \
    --to=tamar.christina@arm.com \
    --cc=Marcus.Shawcroft@arm.com \
    --cc=Richard.Earnshaw@arm.com \
    --cc=christophe.lyon@linaro.org \
    --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).