aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/lambda.c
diff options
context:
space:
mode:
authorSudakshina Das <sudi.das@arm.com>2018-03-19 18:50:32 +0000
committerSudakshina Das <sudi@gcc.gnu.org>2018-03-19 18:50:32 +0000
commitf7d884d45b929c3f0ab65b0830cce4517b5f968d (patch)
treed902629b27925595f99c85223f38fe0b948f3b42 /gcc/cp/lambda.c
parenta84677b84df4a05498f6741eea19f3042e4ee017 (diff)
downloadgcc-f7d884d45b929c3f0ab65b0830cce4517b5f968d.zip
gcc-f7d884d45b929c3f0ab65b0830cce4517b5f968d.tar.gz
gcc-f7d884d45b929c3f0ab65b0830cce4517b5f968d.tar.bz2
[PR81647][AARCH64] Fix handling of Unordered Comparisons in aarch64-simd.md
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 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)). ChangeLog Entries: *** gcc/ChangeLog *** 2018-03-19 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 *** 2018-03-19 Sudakshina Das <sudi.das@arm.com> PR target/81647 * gcc.target/aarch64/pr81647.c: New. From-SVN: r258653
Diffstat (limited to 'gcc/cp/lambda.c')
0 files changed, 0 insertions, 0 deletions