From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 1182F3877235 for ; Fri, 16 Dec 2022 14:08:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1182F3877235 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 047CD5CFA8; Fri, 16 Dec 2022 14:08:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1671199686; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/jZ4gGS3gj/mLmPHn7XmkReNzKvSQs0fedyO3thJtew=; b=NpWhhsv/9UcMIezTKpRt2rvHDZDx8Mxp24UJ4bV3ytjSre84rKBHJEyS6eJoLo8GqkqeCu ny0k61Lesj3IfpMk8s1sSIECTe9+ozYl0KHv7lI/Bu7tgxi1Ueq1fNexzTZEpLDngsEpsP 5LNrp3mpqxWa6wUcR25kJFkUENoX9EY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1671199686; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/jZ4gGS3gj/mLmPHn7XmkReNzKvSQs0fedyO3thJtew=; b=WmzoD2ikPEmMD/4vOdwLCdo9+I3oMXQ8u8vHQ2NropbqUtJprFWkjeKxjFdMne1k7X1sya xpSN9WoIUJBhegBg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id E12A4138F0; Fri, 16 Dec 2022 14:08:05 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 1d3ZNcV7nGMNXwAAMHmgww (envelope-from ); Fri, 16 Dec 2022 14:08:05 +0000 Message-ID: Date: Fri, 16 Dec 2022 15:08:05 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: Re: [PATCH, nvptx, 2/2] Reimplement libgomp barriers for nvptx: bar.red instruction support in GCC To: Chung-Lin Tang , gcc-patches , Catherine Moore References: <16675a67-3dd2-fc62-fd38-6eaa24da66f7@gmail.com> Content-Language: en-US From: Tom de Vries In-Reply-To: <16675a67-3dd2-fc62-fd38-6eaa24da66f7@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_SHORT,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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  > > 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_): New define_insn.