public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: David Malcolm <dmalcolm@redhat.com>
To: Richard Sandiford <richard.sandiford@arm.com>, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH 2/2] Add a general mapping from internal fns to target insns
Date: Fri, 10 Jun 2022 07:35:13 -0400	[thread overview]
Message-ID: <e9b4e6028369e94c830c395104036398851f722d.camel@redhat.com> (raw)
In-Reply-To: <mptr13wev8l.fsf@arm.com>

On Fri, 2022-06-10 at 10:14 +0100, Richard Sandiford via Gcc-patches
wrote:
Several existing internal functions map directly to an instruction
defined in target-insns.def.  This patch makes it easier to define
more such functions in future.

This should help to reduce cut-&-paste, but more importantly, it allows
the difference between optab functions and target-insns.def functions
to be abstracted away; both are now treated as “directly-mapped”.

Tested on aarch64-linux-gnu and x86_64-linux-gnu.  OK to install?

Richard


gcc/
        * internal-fn.def (DEF_INTERNAL_INSN_FN): New macro.
        (GOMP_SIMT_ENTER_ALLOC, GOMP_SIMT_EXIT, GOMP_SIMT_LANE)
        (GOMP_SIMT_LAST_LANE, GOMP_SIMT_ORDERED_PRED,
GOMP_SIMT_VOTE_ANY)
        (GOMP_SIMT_XCHG_BFLY, GOMP_SIMT_XCHG_IDX): Use it.
        * internal-fn.h (direct_internal_fn_info::directly_mapped): New
        member variable.
        (direct_internal_fn_info::vectorizable): Reduce to 1 bit.
        (direct_internal_fn_p): Also return true for internal functions
        that map directly to instructions defined target-insns.def.
        (direct_internal_fn): Adjust comment accordingly.
        * internal-fn.c (direct_insn, optab1, optab2,
vectorizable_optab1)

[...snip...]

---
 gcc/internal-fn.cc  | 152 +++++++++++++++-----------------------------
 gcc/internal-fn.def |  34 +++++++---
 gcc/internal-fn.h   |  20 +++---
 3 files changed, 87 insertions(+), 119 deletions(-)


[...snip...]

I can't comment on the correctness of the patch, but I happened to spot
that the filename in the changelog entry needs renaming for the .c to
.cc transition, or the git hooks will complain when you try to push
this.


Dave


  reply	other threads:[~2022-06-10 11:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-10  9:14 Richard Sandiford
2022-06-10 11:35 ` David Malcolm [this message]
2022-06-12 18:09 ` Jeff Law

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=e9b4e6028369e94c830c395104036398851f722d.camel@redhat.com \
    --to=dmalcolm@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=richard.sandiford@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).