From: Jakub Jelinek <jakub@redhat.com>
To: Andrew Stubbs <ams@codesourcery.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH 1/3] omp-simd-clone: Allow fixed-lane vectors
Date: Fri, 26 Aug 2022 13:04:11 +0200 [thread overview]
Message-ID: <Ywioq3bGyj/4wo+O@tucnak> (raw)
In-Reply-To: <c031829e4f5b025e3ebfb15616f9667661c11365.1660051134.git.ams@codesourcery.com>
On Tue, Aug 09, 2022 at 02:23:48PM +0100, Andrew Stubbs wrote:
>
> The vecsize_int/vecsize_float has an assumption that all arguments will use
> the same bitsize, and vary the number of lanes according to the element size,
> but this is inappropriate on targets where the number of lanes is fixed and
> the bitsize varies (i.e. amdgcn).
>
> With this change the vecsize can be left zero and the vectorization factor will
> be the same for all types.
>
> gcc/ChangeLog:
>
> * doc/tm.texi: Regenerate.
> * omp-simd-clone.cc (simd_clone_adjust_return_type): Allow zero
> vecsize.
> (simd_clone_adjust_argument_types): Likewise.
> * target.def (compute_vecsize_and_simdlen): Document the new
> vecsize_int and vecsize_float semantics.
LGTM, except for a formatting nit.
> @@ -618,8 +621,12 @@ simd_clone_adjust_argument_types (struct cgraph_node *node)
> veclen = sc->vecsize_int;
> else
> veclen = sc->vecsize_float;
> - veclen = exact_div (veclen,
> - GET_MODE_BITSIZE (SCALAR_TYPE_MODE (parm_type)));
> + if (known_eq (veclen, 0))
> + veclen = sc->simdlen;
> + else
> + veclen = exact_div (veclen,
> + GET_MODE_BITSIZE
> + (SCALAR_TYPE_MODE (parm_type)));
Macro name on one line and ( on another is too ugly, can you please use:
veclen
= exact_div (veclen,
GET_MODE_BITSIZE (SCALAR_TYPE_MODE (parm_type)));
or:
{
scalar_mode m = SCALAR_TYPE_MODE (parm_type);
veclen = exact_div (veclen, GET_MODE_BITSIZE (m));
}
?
Jakub
next prev parent reply other threads:[~2022-08-26 11:04 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-09 13:23 [PATCH 0/3] OpenMP SIMD routines Andrew Stubbs
2022-08-09 13:23 ` [PATCH 1/3] omp-simd-clone: Allow fixed-lane vectors Andrew Stubbs
2022-08-26 11:04 ` Jakub Jelinek [this message]
2022-08-30 14:52 ` Andrew Stubbs
2022-08-30 16:54 ` Rainer Orth
2022-08-31 7:11 ` Martin Liška
2022-08-31 8:29 ` Jakub Jelinek
2022-08-31 8:35 ` Andrew Stubbs
2022-08-09 13:23 ` [PATCH 2/3] amdgcn: OpenMP SIMD routine support Andrew Stubbs
2022-08-30 14:53 ` Andrew Stubbs
2022-08-09 13:23 ` [PATCH 3/3] vect: inbranch SIMD clones Andrew Stubbs
2022-09-09 14:31 ` Jakub Jelinek
2022-09-14 8:09 ` Richard Biener
2022-09-14 8:34 ` Jakub Jelinek
2022-11-30 15:17 ` Andrew Stubbs
2022-11-30 15:37 ` Jakub Jelinek
2022-12-01 13:35 ` Andrew Stubbs
2022-12-01 14:16 ` Jakub Jelinek
2023-01-06 12:20 ` Andrew Stubbs
2023-02-10 9:11 ` Jakub Jelinek
2023-02-23 10:02 ` Andrew Stubbs
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=Ywioq3bGyj/4wo+O@tucnak \
--to=jakub@redhat.com \
--cc=ams@codesourcery.com \
--cc=gcc-patches@gcc.gnu.org \
/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).