From: Sudakshina Das <sudi.das@arm.com>
To: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Cc: nd <nd@arm.com>, James Greenhalgh <james.greenhalgh@arm.com>,
Richard Earnshaw <Richard.Earnshaw@arm.com>,
Marcus Shawcroft <Marcus.Shawcroft@arm.com>
Subject: Re: [PATCH PR81647][AARCH64] PING Fix handling of Unordered Comparisons in aarch64-simd.md
Date: Fri, 05 Jan 2018 11:47:00 -0000 [thread overview]
Message-ID: <5821e52a-519d-09ef-5ed8-5d31703a45f6@arm.com> (raw)
In-Reply-To: <caa2be80-94ed-026b-12c9-f74d8123d3b7@arm.com>
PING
On 15/12/17 11:57, Sudakshina Das wrote:
> Hi
>
> This patch fixes the inconsistent behavior observed at -O3 for the
> unordered comparisons. According to the online docs
> (https://gcc.gnu.org/onlinedocs/gcc-7.2.0/gccint/Unary-and-Binary-Expressions.html),
> all of the following should not raise an FP exception:
> - UNGE_EXPR
> - UNGT_EXPR
> - UNLE_EXPR
> - UNLT_EXPR
> - UNEQ_EXPR
> Also ORDERED_EXPR and UNORDERED_EXPR should only return zero or one.
>
> The aarch64-simd.md handling of these were generating exception raising
> instructions such as fcmgt. This patch changes the instructions that are
> emitted to in order to not give out the exceptions. We first check each
> operand for NaNs and force any elements containing NaN to zero before
> using them in the compare.
>
> Example: UN<cc> (a, b) -> UNORDERED (a, b) | (cm<cc> (isnan (a) ? 0.0 :
> a, isnan (b) ? 0.0 : b))
>
>
> The ORDERED_EXPR is now handled as (cmeq (a, a) & cmeq (b, b)) and
> UNORDERED_EXPR as ~ORDERED_EXPR and UNEQ as (~ORDERED_EXPR | cmeq (a,b)).
>
> Testing done: Checked for regressions on bootstrapped
> aarch64-none-linux-gnu and added a new test case.
>
> Is this ok for trunk? This will probably need a back-port to
> gcc-7-branch as well.
>
> Thanks
> Sudi
>
> ChangeLog Entries:
>
> *** gcc/ChangeLog ***
>
> 2017-12-15 Sudakshina Das <sudi.das@arm.com>
>
> Â Â Â Â PR target/81647
> Â Â Â Â * config/aarch64/aarch64-simd.md (vec_cmp<mode><v_int_equiv>):
> Modify instructions for
> Â Â Â Â UNLT, UNLE, UNGT, UNGE, UNEQ, UNORDERED and ORDERED.
>
> *** gcc/testsuite/ChangeLog ***
>
> 2017-12-15 Sudakshina Das <sudi.das@arm.com>
>
> Â Â Â Â PR target/81647
> Â Â Â Â * gcc.target/aarch64/pr81647.c: New.
next prev parent reply other threads:[~2018-01-05 11:47 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-15 11:57 [PATCH PR81647][AARCH64] " Sudakshina Das
2018-01-05 11:47 ` Sudakshina Das [this message]
2018-02-16 10:54 ` [PATCH PR81647][AARCH64][PING] " Sudakshina Das
2018-03-19 14:32 ` [PATCH PR81647][AARCH64] " James Greenhalgh
2018-03-19 19:31 ` Sudakshina Das
2018-03-20 8:19 ` Christophe Lyon
2018-03-20 10:58 ` Sudakshina Das
2018-03-28 11:37 ` Sudakshina Das
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=5821e52a-519d-09ef-5ed8-5d31703a45f6@arm.com \
--to=sudi.das@arm.com \
--cc=Marcus.Shawcroft@arm.com \
--cc=Richard.Earnshaw@arm.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=james.greenhalgh@arm.com \
--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).