Fix memory constraint on MVE v[ld/st][2/4] instructions [PR107714]
authorStam Markianos-Wright <stam.markianos-wright@arm.com>
Fri, 30 Dec 2022 11:25:22 +0000 (11:25 +0000)
committerStam Markianos-Wright <stam.markianos-wright@arm.com>
Fri, 30 Dec 2022 11:25:22 +0000 (11:25 +0000)
commit4269a6567eb991e6838f40bda5be9e3a7972530c
treee589a6ae298d1f29b704bef1055a405eae8d3c86
parentcdc6bf44eec295805ae29a8aaddafd111de01c8e
Fix memory constraint on MVE v[ld/st][2/4] instructions [PR107714]

In the M-Class Arm-ARM:

https://developer.arm.com/documentation/ddi0553/bu/?lang=en

these MVE instructions only have '!' writeback variant and at:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107714

we found that the Um constraint would also allow through a
register offset writeback, resulting in an assembler error.

Here I have added a new constraint and predicate for these
instructions, which (uniquely, AFAICT), only support a `!` writeback
increment by the data size (inside the compiler this is a POST_INC).

No regressions in arm-none-eabi with MVE and MVE.FP.

gcc/ChangeLog:
PR target/107714
* config/arm/arm-protos.h (mve_struct_mem_operand): New protoype.
* config/arm/arm.cc (mve_struct_mem_operand): New function.
* config/arm/constraints.md (Ug): New constraint.
* config/arm/mve.md (mve_vst4q<mode>): Change constraint.
(mve_vst2q<mode>): Likewise.
(mve_vld4q<mode>): Likewise.
(mve_vld2q<mode>): Likewise.
* config/arm/predicates.md (mve_struct_operand): New predicate.

gcc/testsuite/ChangeLog:
PR target/107714
* gcc.target/arm/mve/intrinsics/vldst24q_reg_offset.c: New test.
gcc/config/arm/arm-protos.h
gcc/config/arm/arm.cc
gcc/config/arm/constraints.md
gcc/config/arm/mve.md
gcc/config/arm/predicates.md
gcc/testsuite/gcc.target/arm/mve/intrinsics/vldst24q_reg_offset.c [new file with mode: 0644]