]> gcc.gnu.org Git - gcc.git/commit
AArch64: Fix scalar xorsign lowering
authorTamar Christina <tamar.christina@arm.com>
Mon, 2 Oct 2023 10:51:10 +0000 (11:51 +0100)
committerTamar Christina <tamar.christina@arm.com>
Mon, 2 Oct 2023 10:51:10 +0000 (11:51 +0100)
commitf2b23a59cbe46a7839811cbeb962c2081b329b73
tree29b7f71d0b461f6c22a0012f6ca69c4b20543998
parenta35ab1c1a3d04c28519a062fedfebda818b927a4
AArch64: Fix scalar xorsign lowering

In GCC-9 our scalar xorsign pattern broke and we didn't notice it because the
testcase was not strong enough.  With this commit

8d2d39587d941a40f25ea0144cceb677df115040 is the first bad commit
commit 8d2d39587d941a40f25ea0144cceb677df115040
Author: Segher Boessenkool <segher@kernel.crashing.org>
Date:   Mon Oct 22 22:23:39 2018 +0200

    combine: Do not combine moves from hard registers

combine started introducing useless moves on hard registers,  when one of the
arguments to our scalar xorsign is a hardreg we get an additional move inserted.

This leads to combine forming an AND with the immediate inside and using the
superflous move to do the r->w move, instead of what we wanted before which was
for the `and` to be a vector and and have reload pick the right alternative.

To fix this the patch just forces the use of the vector version directly and
so combine has no chance to mess it up.

gcc/ChangeLog:

* config/aarch64/aarch64-simd.md (xorsign<mode>3): Renamed to..
(@xorsign<mode>3): ...This.
* config/aarch64/aarch64.md (xorsign<mode>3): Renamed to...
(@xorsign<mode>3): ..This and emit vectors directly
* config/aarch64/iterators.md (VCONQ): Add SF and DF.

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/xorsign.c:
gcc/config/aarch64/aarch64-simd.md
gcc/config/aarch64/aarch64.md
gcc/config/aarch64/iterators.md
gcc/testsuite/gcc.target/aarch64/xorsign.c
This page took 0.065365 seconds and 5 git commands to generate.