public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Sandiford <richard.sandiford@arm.com>
To: Tejas Belagod <tejas.belagod@arm.com>
Cc: <gcc-patches@gcc.gnu.org>,  Tejas Belagod <tbelagod@arm.com>
Subject: Re: [PATCH v2] [PR96339] Optimise svlast[ab]
Date: Mon, 12 Jun 2023 09:45:35 +0100	[thread overview]
Message-ID: <mptcz21jcgg.fsf@arm.com> (raw)
In-Reply-To: <20230612082756.27638-1-tejas.belagod@arm.com> (Tejas Belagod's message of "Mon, 12 Jun 2023 09:27:56 +0100")

Tejas Belagod <tejas.belagod@arm.com> writes:
> From: Tejas Belagod <tbelagod@arm.com>
>
>   This PR optimizes an SVE intrinsics sequence where
>     svlasta (svptrue_pat_b8 (SV_VL1), x)
>   a scalar is selected based on a constant predicate and a variable vector.
>   This sequence is optimized to return the correspoding element of a NEON
>   vector. For eg.
>     svlasta (svptrue_pat_b8 (SV_VL1), x)
>   returns
>     umov    w0, v0.b[1]
>   Likewise,
>     svlastb (svptrue_pat_b8 (SV_VL1), x)
>   returns
>      umov    w0, v0.b[0]
>   This optimization only works provided the constant predicate maps to a range
>   that is within the bounds of a 128-bit NEON register.
>
> gcc/ChangeLog:
>
> 	PR target/96339
> 	* config/aarch64/aarch64-sve-builtins-base.cc (svlast_impl::fold): Fold sve
> 	calls that have a constant input predicate vector.
> 	(svlast_impl::is_lasta): Query to check if intrinsic is svlasta.
> 	(svlast_impl::is_lastb): Query to check if intrinsic is svlastb.
> 	(svlast_impl::vect_all_same): Check if all vector elements are equal.
>
> gcc/testsuite/ChangeLog:
>
> 	PR target/96339
> 	* gcc.target/aarch64/sve/acle/general-c/svlast.c: New.
> 	* gcc.target/aarch64/sve/acle/general-c/svlast128_run.c: New.
> 	* gcc.target/aarch64/sve/acle/general-c/svlast256_run.c: New.
> 	* gcc.target/aarch64/sve/pcs/return_4.c (caller_bf16): Fix asm
> 	to expect optimized code for function body.
> 	* gcc.target/aarch64/sve/pcs/return_4_128.c (caller_bf16): Likewise.
> 	* gcc.target/aarch64/sve/pcs/return_4_256.c (caller_bf16): Likewise.
> 	* gcc.target/aarch64/sve/pcs/return_4_512.c (caller_bf16): Likewise.
> 	* gcc.target/aarch64/sve/pcs/return_4_1024.c (caller_bf16): Likewise.
> 	* gcc.target/aarch64/sve/pcs/return_4_2048.c (caller_bf16): Likewise.
> 	* gcc.target/aarch64/sve/pcs/return_5.c (caller_bf16): Likewise.
> 	* gcc.target/aarch64/sve/pcs/return_5_128.c (caller_bf16): Likewise.
> 	* gcc.target/aarch64/sve/pcs/return_5_256.c (caller_bf16): Likewise.
> 	* gcc.target/aarch64/sve/pcs/return_5_512.c (caller_bf16): Likewise.
> 	* gcc.target/aarch64/sve/pcs/return_5_1024.c (caller_bf16): Likewise.
> 	* gcc.target/aarch64/sve/pcs/return_5_2048.c (caller_bf16): Likewise.

OK, thanks.

Richard

  reply	other threads:[~2023-06-12  8:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-12  8:27 Tejas Belagod
2023-06-12  8:45 ` Richard Sandiford [this message]
2023-06-13  7:08   ` Tejas Belagod
2023-06-14  7:13     ` Prathamesh Kulkarni
2023-06-14 16:40       ` Kyrylo Tkachov
2023-06-15  4:29         ` Tejas Belagod

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=mptcz21jcgg.fsf@arm.com \
    --to=richard.sandiford@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=tbelagod@arm.com \
    --cc=tejas.belagod@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).