]> git.ipfire.org Git - thirdparty/gcc.git/commit
AArch64: Fix signbit mask creation after late combine [PR116229]
authorTamar Christina <tamar.christina@arm.com>
Thu, 8 Aug 2024 17:51:30 +0000 (18:51 +0100)
committerTamar Christina <tamar.christina@arm.com>
Thu, 8 Aug 2024 17:51:30 +0000 (18:51 +0100)
commit2c24e0568392e51a77ebdaab629d631969ce8966
tree18cc0430f84ef96c499207a18db7c598a7bb3cf1
parentc4d3dba253b49fb0e8e32109783f76453bc53653
AArch64: Fix signbit mask creation after late combine [PR116229]

The optimization to generate a Di signbit constant by using fneg was relying
on nothing being able to push the constant into the negate.  It's run quite
late for this reason.

However late combine now runs after it and triggers RTL simplification based on
the neg.  When -fno-signed-zeros this ends up dropping the - from the -0.0 and
thus producing incorrect code.

This change adds a new unspec FNEG on DI mode which prevents this simplication.

gcc/ChangeLog:

PR target/116229
* config/aarch64/aarch64-simd.md (aarch64_fnegv2di2<vczle><vczbe>): New.
* config/aarch64/aarch64.cc (aarch64_maybe_generate_simd_constant):
Update call to gen_aarch64_fnegv2di2.
* config/aarch64/iterators.md: New UNSPEC_FNEG.

gcc/testsuite/ChangeLog:

PR target/116229
* gcc.target/aarch64/pr116229.c: New test.
gcc/config/aarch64/aarch64-simd.md
gcc/config/aarch64/aarch64.cc
gcc/config/aarch64/iterators.md
gcc/testsuite/gcc.target/aarch64/pr116229.c [new file with mode: 0644]