Hi all,

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 just removes that alternative causing RA to emit a normal extra
move.
So for the testcase in the patch we now generate:
nor_z:
        nbsl z1.d, z1.d, z2.d, z1.d
        mov z0.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.
Ok for trunk?
Do we want to backport it?

Thanks,
Kyrill


Signed-off-by: Kyrylo Tkachov <ktkac...@nvidia.com>

gcc/

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

gcc/testsuite/

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

Attachment: 0001-aarch64-PR-target-120999-Avoid-movprfx-for-NBSL-impl.patch
Description: 0001-aarch64-PR-target-120999-Avoid-movprfx-for-NBSL-impl.patch

Reply via email to