public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Stam Markianos-Wright <stam.markianos-wright@arm.com>
To: Kyrylo Tkachov <Kyrylo.Tkachov@arm.com>,
	"gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Cc: Richard Earnshaw <Richard.Earnshaw@arm.com>,
	Ramana Radhakrishnan <ramana.gcc@googlemail.com>,
	"nickc@redhat.com" <nickc@redhat.com>
Subject: Re: [PATCH] Fix memory constraint on MVE v[ld/st][2/4] instructions [PR107714]
Date: Tue, 10 Jan 2023 14:01:02 +0000	[thread overview]
Message-ID: <13f07cd4-f34a-c78f-65d9-890a68947a94@arm.com> (raw)
In-Reply-To: <PAXPR08MB6926370F7B5FD66FA3D0E77493E29@PAXPR08MB6926.eurprd08.prod.outlook.com>


On 12/12/2022 13:42, Kyrylo Tkachov wrote:
> Hi Stam,
>
>> -----Original Message-----
>> From: Stam Markianos-Wright <Stam.Markianos-Wright@arm.com>
>> Sent: Friday, December 9, 2022 1:32 PM
>> To: gcc-patches@gcc.gnu.org
>> Cc: Kyrylo Tkachov <Kyrylo.Tkachov@arm.com>; Richard Earnshaw
>> <Richard.Earnshaw@arm.com>; Ramana Radhakrishnan
>> <ramana.gcc@googlemail.com>; nickc@redhat.com
>> Subject: [PATCH] Fix memory constraint on MVE v[ld/st][2/4] instructions
>> [PR107714]
>>
>> Hi all,
>>
>> 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.
>>
>> Ok for trunk, and backport to GCC11 and GCC12 (testing pending)?
>>
>> Thanks,
>> Stam
>>
>> 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.
>
> diff --git a/gcc/config/arm/constraints.md b/gcc/config/arm/constraints.md
> index e5a36d29c7135943b9bb5ea396f70e2e4beb1e4a..8908b7f5b15ce150685868e78e75280bf32053f1 100644
> --- a/gcc/config/arm/constraints.md
> +++ b/gcc/config/arm/constraints.md
> @@ -474,6 +474,12 @@
>    (and (match_code "mem")
>         (match_test "TARGET_32BIT && arm_coproc_mem_operand (op, FALSE)")))
>   
> +(define_memory_constraint "Ug"
> + "@internal
> +  In Thumb-2 state a valid MVE struct load/store address."
> + (and (match_code "mem")
> +      (match_test "TARGET_HAVE_MVE && mve_struct_mem_operand (op)")))
> +
>
> I think you can define the constraints in terms of the new mve_struct_operand predicate directly (see how we define the "Ua" constraint, for example).
> Ok if that works (and testing passes of course).

Done as discussed and re-tested on all branches. Pushed as:

4269a6567eb991e6838f40bda5be9e3a7972530c to trunk

25edc76f2afba0b4eaf22174d42de042a6969dbe to gcc-12

08842ad274f5e2630994f7c6e70b2d31768107ea to gcc-11

Thank you!
Stam


> Thanks,
> Kyrill
>

      reply	other threads:[~2023-01-10 14:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-09 13:32 Stam Markianos-Wright
2022-12-12 13:42 ` Kyrylo Tkachov
2023-01-10 14:01   ` Stam Markianos-Wright [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=13f07cd4-f34a-c78f-65d9-890a68947a94@arm.com \
    --to=stam.markianos-wright@arm.com \
    --cc=Kyrylo.Tkachov@arm.com \
    --cc=Richard.Earnshaw@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=nickc@redhat.com \
    --cc=ramana.gcc@googlemail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).