public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: Chung-Lin Tang <chunglin.tang@gmail.com>,
	gcc-patches <gcc-patches@gcc.gnu.org>,
	Catherine Moore <clm@codesourcery.com>
Subject: Re: [PATCH, nvptx, 2/2] Reimplement libgomp barriers for nvptx: bar.red instruction support in GCC
Date: Fri, 16 Dec 2022 15:08:05 +0100	[thread overview]
Message-ID: <d2c1e4d1-8fc8-b078-0bf4-c457c33837d2@suse.de> (raw)
In-Reply-To: <16675a67-3dd2-fc62-fd38-6eaa24da66f7@gmail.com>

On 9/21/22 09:45, Chung-Lin Tang wrote:
> Hi Tom, following the first patch.
> 
> This new barrier implementation I posted in the first patch uses the 
> 'bar.red' instruction. > Usually this could've been easily done with a single line of inline
> assembly. However I quickly
> realized that because the NVPTX GCC port is implemented with all virtual 
> general registers,
> we don't have a register constraint usable to select "predicate registers".
> Since bar.red uses predicate typed values, I can't create it directly 
> using inline asm.
> 
> So it appears that the most simple way of accessing it is with a target 
> builtin.
> The attached patch adds bar.red instructions to the nvptx port, and 
> __builtin_nvptx_bar_red_* builtins
> to use it. The code should support all variations of bar.red (and, or, 
> and popc operations).
> 
> (This support was used to implement the first libgomp barrier patch, so 
> must be approved together)
> 

What I conclude from what you're telling me here is that this is the 
first patch in the series rather than the second.

So, LGTM, please apply it, unless it cannot be applied by itself without 
causing regressions, in which case you need to fix those first.

IWBN if this also included standalone test-cases in 
gcc/testsuite/gcc.target/nvptx, but I suppose we can live without for now.

Thanks,
- Tom

> Thanks,
> Chung-Lin
> 
> 2022-09-21  Chung-Lin Tang  <cltang@codesourcery.com>
> 
> gcc/ChangeLog:
> 
>      * config/nvptx/nvptx.cc (nvptx_print_operand): Add 'p'
>      case, adjust comments.
>      (enum nvptx_builtins): Add NVPTX_BUILTIN_BAR_RED_AND,
>      NVPTX_BUILTIN_BAR_RED_OR, and NVPTX_BUILTIN_BAR_RED_POPC.
>      (nvptx_expand_bar_red): New function.
>      (nvptx_init_builtins):
>      Add DEFs of __builtin_nvptx_bar_red_[and/or/popc].
>      (nvptx_expand_builtin): Use nvptx_expand_bar_red to expand
>      NVPTX_BUILTIN_BAR_RED_[AND/OR/POPC] cases.
> 
>      * config/nvptx/nvptx.md (define_c_enum "unspecv"): Add
>      UNSPECV_BARRED_AND, UNSPECV_BARRED_OR, and UNSPECV_BARRED_POPC.
>      (BARRED): New int iterator.
>      (barred_op,barred_mode,barred_ptxtype): New int attrs.
>      (nvptx_barred_<barred_op>): New define_insn.

  reply	other threads:[~2022-12-16 14:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-21  7:45 Chung-Lin Tang
2022-12-16 14:08 ` Tom de Vries [this message]
2023-01-12  8:15 ` Thomas Schwinge

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=d2c1e4d1-8fc8-b078-0bf4-c457c33837d2@suse.de \
    --to=tdevries@suse.de \
    --cc=chunglin.tang@gmail.com \
    --cc=clm@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).