public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Szabolcs Nagy <szabolcs.nagy@arm.com>
To: gcc@gcc.gnu.org
Cc: Jakub Jelinek <jakub@redhat.com>,
	kyrylo.tkachov@arm.com, graham.hunter@arm.com,
	paul.walker@arm.com
Subject: AArch64 vector ABI vs OpenMP
Date: Wed, 29 Jun 2022 16:16:30 +0100	[thread overview]
Message-ID: <Yrxszvt265ht2ein@arm.com> (raw)

Last time aarch64 libmvec was discussed, the OpenMP
declare variant syntax support was not ready in gcc
and there were open questions around how simd isa
variants would be supported.

https://gcc.gnu.org/pipermail/gcc-patches/2019-October/532940.html

The vector function ABI for aarch64 allows the declare
variant syntax and that is the only way to declare
vector math functions for a particular isa only.

https://github.com/ARM-software/abi-aa/blob/main/vfabia64/vfabia64.rst#aarch64-variant-traits

I would like to get feedback if there may be anything
preventing declare variant simd support on aarch64 like

  float64x2_t simd_cos (float64x2_t);

  #pragma omp declare variant(simd_cos) \
     match(construct={simd(simdlen(2), notinbranch)}, device={isa("simd")})
  double cos (double);

where isa("simd") means simd_cos can be used when
auto vectorizing cos calls with advanced simd.

Our hope is that this enables libmvec on aarch64
such that at least advanced simd variants of
some math functions can be declared in math.h
and implemented in libm, suitable for vectorization.
(Using the vector ABI names of those functions.)

Eventually we want to add isa("sve") support too,
but that may require further work on how scalable
vector length is represented.

Please let me know if there are outstanding issues
with this approach.

thanks.

                 reply	other threads:[~2022-06-29 15:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=Yrxszvt265ht2ein@arm.com \
    --to=szabolcs.nagy@arm.com \
    --cc=gcc@gcc.gnu.org \
    --cc=graham.hunter@arm.com \
    --cc=jakub@redhat.com \
    --cc=kyrylo.tkachov@arm.com \
    --cc=paul.walker@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).