public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Earnshaw <Richard.Earnshaw@foss.arm.com>
To: Alexandre Oliva <oliva@adacore.com>, gcc-patches@gcc.gnu.org
Cc: Nick Clifton <nickc@redhat.com>,
	Richard Earnshaw <richard.earnshaw@arm.com>,
	Ramana Radhakrishnan <ramana.gcc@gmail.com>,
	Kyrylo Tkachov <kyrylo.tkachov@arm.com>
Subject: Re: [PATCH] [PR40457] [arm] expand SI-aligned movdi into pair of movsi
Date: Wed, 11 Jan 2023 18:34:48 +0000	[thread overview]
Message-ID: <883a2052-0934-a224-a8ce-4ef7bc033e87@foss.arm.com> (raw)
In-Reply-To: <oro7smxieq.fsf@lxoliva.fsfla.org>



On 02/12/2022 09:29, Alexandre Oliva via Gcc-patches wrote:
> 
> When expanding a misaligned DImode move, emit aligned SImode moves if
> the parts are sufficiently aligned.  This enables neighboring stores
> to be peephole-combined into stm, as expected by the PR40457 testcase,
> even after SLP vectorizes the originally aligned SImode stores into a
> misaligned DImode store.
> 
> Regstraped on x86_64-linux-gnu, also tested with crosses to riscv64-elf
> and arm-eabi (tms570).  Ok to install?
> 
> 
> for  gcc/ChangeLog
> 
> 	PR target/40457
> 	* config/arm/arm.md (movmisaligndi): Prefer aligned SImode
> 	moves.

OK.

R.

> ---
>   gcc/config/arm/arm.md |   12 ++++++++++--
>   1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
> index 69bf343fb0ed6..a9eb0299aa761 100644
> --- a/gcc/config/arm/arm.md
> +++ b/gcc/config/arm/arm.md
> @@ -12783,8 +12783,16 @@ (define_expand "movmisaligndi"
>     rtx hi_op0 = gen_highpart_mode (SImode, DImode, operands[0]);
>     rtx hi_op1 = gen_highpart_mode (SImode, DImode, operands[1]);
>   
> -  emit_insn (gen_movmisalignsi (lo_op0, lo_op1));
> -  emit_insn (gen_movmisalignsi (hi_op0, hi_op1));
> +  if (aligned_operand (lo_op0, SImode) && aligned_operand (lo_op1, SImode))
> +    {
> +      emit_move_insn (lo_op0, lo_op1);
> +      emit_move_insn (hi_op0, hi_op1);
> +    }
> +  else
> +    {
> +      emit_insn (gen_movmisalignsi (lo_op0, lo_op1));
> +      emit_insn (gen_movmisalignsi (hi_op0, hi_op1));
> +    }
>     DONE;
>   })
>   
> 

      reply	other threads:[~2023-01-11 18:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-02  9:29 Alexandre Oliva
2023-01-11 18:34 ` Richard Earnshaw [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=883a2052-0934-a224-a8ce-4ef7bc033e87@foss.arm.com \
    --to=richard.earnshaw@foss.arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=kyrylo.tkachov@arm.com \
    --cc=nickc@redhat.com \
    --cc=oliva@adacore.com \
    --cc=ramana.gcc@gmail.com \
    --cc=richard.earnshaw@arm.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).