public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <jeffreyalaw@gmail.com>
To: YunQiang Su <yunqiang.su@cipunited.com>, gcc-patches@gcc.gnu.org
Cc: macro@orcam.me.uk, jiaxun.yang@flygoat.com, syq@debian.org,
	richard.sandiford@arm.com
Subject: Re: [PATCH] MIPS: don't expand large block move
Date: Fri, 19 May 2023 10:56:58 -0600	[thread overview]
Message-ID: <62638b5e-d9a5-0ede-0642-ea363d23d055@gmail.com> (raw)
In-Reply-To: <20230519061152.3154332-1-yunqiang.su@cipunited.com>



On 5/19/23 00:11, YunQiang Su wrote:
> On platform with LWL/LWR, mips_block_move_loop is always used,
> which expand __buildin_memcpy/strcpy to a loop of lwl/lwr/swl/swl etc.
> 
> For short (normally <=64), it has better performance,
> but when the src/dest are long, use memcpy/strcpy lib call may have
> better performance.
> 
> At the same time, lib call may be optimized with SIMD, so,
> on the platform with SIMD, lib call may have much better performace.
> 
> gcc/ChangeLog:
> 	* config/mips/mips.cc (mips_expand_block_move): don't expand
> 	  if length>=64.
> 
> gcc/testsuite/ChangeLog:
> 	* gcc.target/mips/expand-block-move-large.c: New test.
> ---
>   gcc/config/mips/mips.cc                         |  6 ++++++
>   .../gcc.target/mips/expand-block-move-large.c   | 17 +++++++++++++++++
>   2 files changed, 23 insertions(+)
>   create mode 100644 gcc/testsuite/gcc.target/mips/expand-block-move-large.c
> 
> diff --git a/gcc/config/mips/mips.cc b/gcc/config/mips/mips.cc
> index ca491b981a3..00f26d5e923 100644
> --- a/gcc/config/mips/mips.cc
> +++ b/gcc/config/mips/mips.cc
> @@ -8313,6 +8313,12 @@ mips_expand_block_move (rtx dest, rtx src, rtx length)
>   	}
>         else if (optimize)
>   	{
> +	  /* When the length is big enough, the lib call has better performace
> +	     than load/store insns.
> +	     In most platform, the value is about 64-128.
> +	     And in fact lib call may be optimized with SIMD */
> +	  if (INTVAL(length) >= 64)
> +	    return false;
Just a formatting nit.  Space between INTVAL and the open paren for its 
argument list.

OK with that change.

jeff

  reply	other threads:[~2023-05-19 16:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-19  6:11 YunQiang Su
2023-05-19 16:56 ` Jeff Law [this message]
2023-05-19 19:21   ` Maciej W. Rozycki
2023-05-24  2:04     ` YunQiang Su
2023-05-30 11:44       ` Maciej W. Rozycki

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=62638b5e-d9a5-0ede-0642-ea363d23d055@gmail.com \
    --to=jeffreyalaw@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jiaxun.yang@flygoat.com \
    --cc=macro@orcam.me.uk \
    --cc=richard.sandiford@arm.com \
    --cc=syq@debian.org \
    --cc=yunqiang.su@cipunited.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).