From patchwork Thu Mar 10 11:25:21 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: 51843 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 0BDE73857C65 for ; Thu, 10 Mar 2022 11:27:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0BDE73857C65 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1646911634; bh=8RH60LZYs+7vbeUt5dO/rCXRCZoCvX2oiC/hzJUKm40=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=mNnAyRgXQXXd+vrLdYXCnsF6V9O/esn99/2sKY+z1bLc5uaOKo1FCoTVK+RvaLuNq hfcreEk1gaVoXEvDwD9FFcTDQXTvZJmdcTEzoQUCKWWiiapHZ8/ihqnaES8oWRlYcD R78vKtalsoTOk8zcI0ZIV1+0Yv7LZfMeIZ14LP2w= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 566C1385802F for ; Thu, 10 Mar 2022 11:25:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 566C1385802F 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-out1.suse.de (Postfix) with ESMTPS id 544D6210E1 for ; Thu, 10 Mar 2022 11:25:23 +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 4189413FA3 for ; Thu, 10 Mar 2022 11:25:23 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id WDjqDiPgKWJmDAAAMHmgww (envelope-from ) for ; Thu, 10 Mar 2022 11:25:23 +0000 Date: Thu, 10 Mar 2022 12:25:21 +0100 To: gcc-patches@gcc.gnu.org Subject: [committed][nvptx] Use atom.and.b64 instead of atom.b64.and Message-ID: <20220310112520.GA16653@delia.home> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, 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 ptx manual prescribes the instruction format atom{.space}.op.type but the compiler currently emits: ... atom.b64.and %r31, [%r30], %r32; ... which uses the instruction format atom{.space}.type.op. Fix this by emitting instead: ... atom.and.b64 %r31, [%r30], %r32; ... Tested on nvptx. Committed to trunk. Thanks, - Tom [nvptx] Use atom.and.b64 instead of atom.b64.and gcc/ChangeLog: 2022-03-07 Tom de Vries * config/nvptx/nvptx.md (define_insn "atomic_fetch_"): Emit atom.and.b64 instead of atom.b64.and. gcc/testsuite/ChangeLog: 2022-03-07 Tom de Vries * gcc.target/nvptx/atomic_fetch-1.c: Update. * gcc.target/nvptx/atomic_fetch-2.c: Update. --- gcc/config/nvptx/nvptx.md | 2 +- gcc/testsuite/gcc.target/nvptx/atomic_fetch-1.c | 36 ++++++++++++------------- gcc/testsuite/gcc.target/nvptx/atomic_fetch-2.c | 18 ++++++------- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/gcc/config/nvptx/nvptx.md b/gcc/config/nvptx/nvptx.md index a453c1de503..8079763077f 100644 --- a/gcc/config/nvptx/nvptx.md +++ b/gcc/config/nvptx/nvptx.md @@ -2226,7 +2226,7 @@ (define_insn "atomic_fetch_" return ""; } const char *t - = "%.\\tatom%A1.b%T0.\\t%0, %1, %2;"; + = "%.\\tatom%A1..b%T0\\t%0, %1, %2;"; return nvptx_output_atomic_insn (t, operands, 1, 3); } diff --git a/gcc/testsuite/gcc.target/nvptx/atomic_fetch-1.c b/gcc/testsuite/gcc.target/nvptx/atomic_fetch-1.c index 941cf3a2ab4..801572928cb 100644 --- a/gcc/testsuite/gcc.target/nvptx/atomic_fetch-1.c +++ b/gcc/testsuite/gcc.target/nvptx/atomic_fetch-1.c @@ -66,35 +66,35 @@ main() /* Generic. */ /* { dg-final { scan-assembler-times "atom.add.u64" 1 } } */ -/* { dg-final { scan-assembler-times "atom.b64.and" 1 } } */ -/* { dg-final { scan-assembler-times "atom.b64.or" 1 } } */ -/* { dg-final { scan-assembler-times "atom.b64.xor" 1 } } */ +/* { dg-final { scan-assembler-times "atom.and.b64" 1 } } */ +/* { dg-final { scan-assembler-times "atom.or.b64" 1 } } */ +/* { dg-final { scan-assembler-times "atom.xor.b64" 1 } } */ /* { dg-final { scan-assembler-times "atom.add.u32" 1 } } */ -/* { dg-final { scan-assembler-times "atom.b32.and" 1 } } */ -/* { dg-final { scan-assembler-times "atom.b32.or" 1 } } */ -/* { dg-final { scan-assembler-times "atom.b32.xor" 1 } } */ +/* { dg-final { scan-assembler-times "atom.and.b32" 1 } } */ +/* { dg-final { scan-assembler-times "atom.or.b32" 1 } } */ +/* { dg-final { scan-assembler-times "atom.xor.b32" 1 } } */ /* Global. */ /* { dg-final { scan-assembler-times "atom.global.add.u64" 1 } } */ -/* { dg-final { scan-assembler-times "atom.global.b64.and" 1 } } */ -/* { dg-final { scan-assembler-times "atom.global.b64.or" 1 } } */ -/* { dg-final { scan-assembler-times "atom.global.b64.xor" 1 } } */ +/* { dg-final { scan-assembler-times "atom.global.and.b64" 1 } } */ +/* { dg-final { scan-assembler-times "atom.global.or.b64" 1 } } */ +/* { dg-final { scan-assembler-times "atom.global.xor.b64" 1 } } */ /* { dg-final { scan-assembler-times "atom.global.add.u32" 1 } } */ -/* { dg-final { scan-assembler-times "atom.global.b32.and" 1 } } */ -/* { dg-final { scan-assembler-times "atom.global.b32.or" 1 } } */ -/* { dg-final { scan-assembler-times "atom.global.b32.xor" 1 } } */ +/* { dg-final { scan-assembler-times "atom.global.and.b32" 1 } } */ +/* { dg-final { scan-assembler-times "atom.global.or.b32" 1 } } */ +/* { dg-final { scan-assembler-times "atom.global.xor.b32" 1 } } */ /* Shared. */ /* { dg-final { scan-assembler-times "atom.shared.add.u64" 1 } } */ -/* { dg-final { scan-assembler-times "atom.shared.b64.and" 1 } } */ -/* { dg-final { scan-assembler-times "atom.shared.b64.or" 1 } } */ -/* { dg-final { scan-assembler-times "atom.shared.b64.xor" 1 } } */ +/* { dg-final { scan-assembler-times "atom.shared.and.b64" 1 } } */ +/* { dg-final { scan-assembler-times "atom.shared.or.b64" 1 } } */ +/* { dg-final { scan-assembler-times "atom.shared.xor.b64" 1 } } */ /* { dg-final { scan-assembler-times "atom.shared.add.u32" 1 } } */ -/* { dg-final { scan-assembler-times "atom.shared.b32.and" 1 } } */ -/* { dg-final { scan-assembler-times "atom.shared.b32.or" 1 } } */ -/* { dg-final { scan-assembler-times "atom.shared.b32.xor" 1 } } */ +/* { dg-final { scan-assembler-times "atom.shared.and.b32" 1 } } */ +/* { dg-final { scan-assembler-times "atom.shared.or.b32" 1 } } */ +/* { dg-final { scan-assembler-times "atom.shared.xor.b32" 1 } } */ diff --git a/gcc/testsuite/gcc.target/nvptx/atomic_fetch-2.c b/gcc/testsuite/gcc.target/nvptx/atomic_fetch-2.c index f5131fc4984..fa8d158cac3 100644 --- a/gcc/testsuite/gcc.target/nvptx/atomic_fetch-2.c +++ b/gcc/testsuite/gcc.target/nvptx/atomic_fetch-2.c @@ -69,9 +69,9 @@ main() /* { dg-final { scan-assembler-times "atom.cas.b64" 3 } } */ /* { dg-final { scan-assembler-times "atom.add.u32" 1 } } */ -/* { dg-final { scan-assembler-times "atom.b32.and" 1 } } */ -/* { dg-final { scan-assembler-times "atom.b32.or" 1 } } */ -/* { dg-final { scan-assembler-times "atom.b32.xor" 1 } } */ +/* { dg-final { scan-assembler-times "atom.and.b32" 1 } } */ +/* { dg-final { scan-assembler-times "atom.or.b32" 1 } } */ +/* { dg-final { scan-assembler-times "atom.xor.b32" 1 } } */ /* Global. */ @@ -79,9 +79,9 @@ main() /* { dg-final { scan-assembler-times "atom.global.cas.b64" 3 } } */ /* { dg-final { scan-assembler-times "atom.global.add.u32" 1 } } */ -/* { dg-final { scan-assembler-times "atom.global.b32.and" 1 } } */ -/* { dg-final { scan-assembler-times "atom.global.b32.or" 1 } } */ -/* { dg-final { scan-assembler-times "atom.global.b32.xor" 1 } } */ +/* { dg-final { scan-assembler-times "atom.global.and.b32" 1 } } */ +/* { dg-final { scan-assembler-times "atom.global.or.b32" 1 } } */ +/* { dg-final { scan-assembler-times "atom.global.xor.b32" 1 } } */ /* Shared. */ @@ -89,6 +89,6 @@ main() /* { dg-final { scan-assembler-times "atom.shared.cas.b64" 3 } } */ /* { dg-final { scan-assembler-times "atom.shared.add.u32" 1 } } */ -/* { dg-final { scan-assembler-times "atom.shared.b32.and" 1 } } */ -/* { dg-final { scan-assembler-times "atom.shared.b32.or" 1 } } */ -/* { dg-final { scan-assembler-times "atom.shared.b32.xor" 1 } } */ +/* { dg-final { scan-assembler-times "atom.shared.and.b32" 1 } } */ +/* { dg-final { scan-assembler-times "atom.shared.or.b32" 1 } } */ +/* { dg-final { scan-assembler-times "atom.shared.xor.b32" 1 } } */