From patchwork Thu Mar 10 11:27:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 51847 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id DA5853858436 for ; Thu, 10 Mar 2022 11:31:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DA5853858436 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1646911887; bh=sXjjU3TQ570hgbdJmFFBwFvrYQVebtUfx/mSihRK+WU=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=IX3PWEsvqnDueUc8ljI20PAQFkiG+EF/xXaAKIUIwFAtawE4hhtbxvZgjcFD1wi9B QzbR6y+7ADyZn8g8mKG0u6DeC6HJZ+u+8682mF/rhjRRkUFNba0FkP73/L67uKKU0M pohJfyaCoR0VPtVA08oWw5A2YxpWyzH1d+H+BkGg= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id A2CEF3857C42 for ; Thu, 10 Mar 2022 11:27:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A2CEF3857C42 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 CF1511F38A for ; Thu, 10 Mar 2022 11:27:51 +0000 (UTC) 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 B67BF13FA3 for ; Thu, 10 Mar 2022 11:27:51 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 9ryBK7fgKWJpDQAAMHmgww (envelope-from ) for ; Thu, 10 Mar 2022 11:27:51 +0000 Date: Thu, 10 Mar 2022 12:27:50 +0100 To: gcc-patches@gcc.gnu.org Subject: [committed][nvptx] Use no,yes for attribute predicable Message-ID: <20220310112748.GA5236@delia.home> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_STOCKGEN, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Tom de Vries via Gcc-patches From: Tom de Vries Reply-To: Tom de Vries Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Hi, The documentation states about the predicable instruction attribute: ... This attribute must be a boolean (i.e. have exactly two elements in its list-of-values), with the possible values being no and yes. ... The nvptx port has instead: ... (define_attr "predicable" "false,true" (const_string "true")) ... Fix this by updating to: ... (define_attr "predicable" "no,yes" (const_string "yes")) ... Tested on nvptx. Committed to trunk. Thanks, - Tom [nvptx] Use no,yes for attribute predicable gcc/ChangeLog: 2022-03-08 Tom de Vries PR target/104840 * config/nvptx/nvptx.md (define_attr "predicable"): Use no,yes instead of false,true. --- gcc/config/nvptx/nvptx.md | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/gcc/config/nvptx/nvptx.md b/gcc/config/nvptx/nvptx.md index 1ccb0f11e4c..1dec7caa0d1 100644 --- a/gcc/config/nvptx/nvptx.md +++ b/gcc/config/nvptx/nvptx.md @@ -172,8 +172,8 @@ (define_predicate "symbol_ref_function_operand" return SYMBOL_REF_FUNCTION_P (op); }) -(define_attr "predicable" "false,true" - (const_string "true")) +(define_attr "predicable" "no,yes" + (const_string "yes")) (define_cond_exec [(match_operator 0 "predicate_operator" @@ -911,7 +911,7 @@ (define_insn "br_true" (pc)))] "" "%j0\\tbra\\t%l1;" - [(set_attr "predicable" "false")]) + [(set_attr "predicable" "no")]) (define_insn "br_false" [(set (pc) @@ -921,7 +921,7 @@ (define_insn "br_false" (pc)))] "" "%J0\\tbra\\t%l1;" - [(set_attr "predicable" "false")]) + [(set_attr "predicable" "no")]) ;; unified conditional branch (define_insn "br_true_uni" @@ -931,7 +931,7 @@ (define_insn "br_true_uni" (label_ref (match_operand 1 "" "")) (pc)))] "" "%j0\\tbra.uni\\t%l1;" - [(set_attr "predicable" "false")]) + [(set_attr "predicable" "no")]) (define_insn "br_false_uni" [(set (pc) (if_then_else @@ -940,7 +940,7 @@ (define_insn "br_false_uni" (label_ref (match_operand 1 "" "")) (pc)))] "" "%J0\\tbra.uni\\t%l1;" - [(set_attr "predicable" "false")]) + [(set_attr "predicable" "no")]) (define_expand "cbranch4" [(set (pc) @@ -1619,7 +1619,7 @@ (define_insn "return" { return nvptx_output_return (); } - [(set_attr "predicable" "false")]) + [(set_attr "predicable" "no")]) (define_expand "epilogue" [(clobber (const_int 0))] @@ -1712,7 +1712,7 @@ (define_insn "trap_if_true" (const_int 0))] "" "%j0 trap; %j0 exit;" - [(set_attr "predicable" "false")]) + [(set_attr "predicable" "no")]) (define_insn "trap_if_false" [(trap_if (eq (match_operand:BI 0 "nvptx_register_operand" "R") @@ -1720,7 +1720,7 @@ (define_insn "trap_if_false" (const_int 0))] "" "%J0 trap; %J0 exit;" - [(set_attr "predicable" "false")]) + [(set_attr "predicable" "no")]) (define_expand "ctrap4" [(trap_if (match_operator 0 "nvptx_comparison_operator" @@ -1769,28 +1769,28 @@ (define_insn "nvptx_fork" UNSPECV_FORK)] "" "// fork %0;" - [(set_attr "predicable" "false")]) + [(set_attr "predicable" "no")]) (define_insn "nvptx_forked" [(unspec_volatile:SI [(match_operand:SI 0 "const_int_operand" "")] UNSPECV_FORKED)] "" "// forked %0;" - [(set_attr "predicable" "false")]) + [(set_attr "predicable" "no")]) (define_insn "nvptx_joining" [(unspec_volatile:SI [(match_operand:SI 0 "const_int_operand" "")] UNSPECV_JOINING)] "" "// joining %0;" - [(set_attr "predicable" "false")]) + [(set_attr "predicable" "no")]) (define_insn "nvptx_join" [(unspec_volatile:SI [(match_operand:SI 0 "const_int_operand" "")] UNSPECV_JOIN)] "" "// join %0;" - [(set_attr "predicable" "false")]) + [(set_attr "predicable" "no")]) (define_expand "oacc_fork" [(set (match_operand:SI 0 "nvptx_nonmemory_operand" "") @@ -2035,7 +2035,7 @@ (define_insn "atomic_compare_and_swap_1_local" output_asm_insn ("}", NULL); return ""; } - [(set_attr "predicable" "false")]) + [(set_attr "predicable" "no")]) (define_insn "atomic_compare_and_swap_1" [(set (match_operand:SDIM 0 "nvptx_register_operand" "=R") @@ -2263,7 +2263,7 @@ (define_insn "nvptx_barsync" ? "\\tbarrier.sync\\t%0, %1;" : "\\tbar.sync\\t%0, %1;"); } - [(set_attr "predicable" "false")]) + [(set_attr "predicable" "no")]) (define_insn "nvptx_warpsync" [(unspec_volatile [(const_int 0)] UNSPECV_WARPSYNC)] @@ -2310,7 +2310,7 @@ (define_insn "*memory_barrier" (unspec_volatile:BLK [(match_dup 0)] UNSPECV_MEMBAR))] "" "\\tmembar.sys;" - [(set_attr "predicable" "false")]) + [(set_attr "predicable" "no")]) (define_expand "nvptx_membar_cta" [(set (match_dup 0) @@ -2326,7 +2326,7 @@ (define_insn "*nvptx_membar_cta" (unspec_volatile:BLK [(match_dup 0)] UNSPECV_MEMBAR_CTA))] "" "\\tmembar.cta;" - [(set_attr "predicable" "false")]) + [(set_attr "predicable" "no")]) (define_expand "nvptx_membar_gl" [(set (match_dup 0) @@ -2342,13 +2342,13 @@ (define_insn "*nvptx_membar_gl" (unspec_volatile:BLK [(match_dup 0)] UNSPECV_MEMBAR_GL))] "" "\\tmembar.gl;" - [(set_attr "predicable" "false")]) + [(set_attr "predicable" "no")]) (define_insn "nvptx_nounroll" [(unspec_volatile [(const_int 0)] UNSPECV_NOUNROLL)] "" "\\t.pragma \\\"nounroll\\\";" - [(set_attr "predicable" "false")]) + [(set_attr "predicable" "no")]) (define_insn "nvptx_red_partition" [(set (match_operand:DI 0 "nonimmediate_operand" "=R") @@ -2358,7 +2358,7 @@ (define_insn "nvptx_red_partition" { return nvptx_output_red_partition (operands[0], operands[1]); } - [(set_attr "predicable" "false")]) + [(set_attr "predicable" "no")]) ;; Expand QI mode operations using SI mode instructions. (define_code_iterator any_sbinary [plus minus smin smax])