]> git.ipfire.org Git - thirdparty/gcc.git/commit
aarch64: PR target/120999: Adjust operands for movprfx alternative of NBSL implementa...
authorKyrylo Tkachov <ktkachov@nvidia.com>
Wed, 9 Jul 2025 17:04:01 +0000 (10:04 -0700)
committerKyrylo Tkachov <ktkachov@nvidia.com>
Mon, 14 Jul 2025 13:52:53 +0000 (15:52 +0200)
commit944ecdf085219453e91831100e0bbf1c76f44f46
tree334d8573f136c09acdd761779b9da4f5811d3881
parent6d9253b7bcf48bd42685206327b2b88b602e85cc
aarch64: PR target/120999: Adjust operands for movprfx alternative of NBSL implementation of NOR

While the SVE2 NBSL instruction accepts MOVPRFX to add more flexibility
due to its tied operands, the destination of the movprfx cannot be also
a source operand.  But the offending pattern in aarch64-sve2.md tries
to do exactly that for the "=?&w,w,w" alternative and gas warns for the
attached testcase.

This patch adjusts that alternative to avoid taking operand 0 as an input
in the NBSL again.

So for the testcase in the patch we now generate:
nor_z:
        movprfx z0, z1
        nbsl    z0.d, z0.d, z2.d, z1.d
        ret

instead of the previous:
nor_z:
        movprfx z0, z1
        nbsl    z0.d, z0.d, z2.d, z0.d
        ret

which generated a gas warning.

Bootstrapped and tested on aarch64-none-linux-gnu.

Signed-off-by: Kyrylo Tkachov <ktkachov@nvidia.com>
gcc/

PR target/120999
* config/aarch64/aarch64-sve2.md (*aarch64_sve2_nor<mode>):
Adjust movprfx alternative.

gcc/testsuite/

PR target/120999
* gcc.target/aarch64/sve2/pr120999.c: New test.

(cherry picked from commit b7bd72ce71df5266e7a7039da318e49862389a72)
gcc/config/aarch64/aarch64-sve2.md
gcc/testsuite/gcc.target/aarch64/sve2/pr120999.c [new file with mode: 0644]