From patchwork Wed Jan 31 10:36:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 1893386 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=n9g7Qld7; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TPz526t3mz23dQ for ; Wed, 31 Jan 2024 21:37:42 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6A0AB3857C4C for ; Wed, 31 Jan 2024 10:37:39 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by sourceware.org (Postfix) with ESMTPS id 4AC603858437 for ; Wed, 31 Jan 2024 10:37:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4AC603858437 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=baylibre.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 4AC603858437 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::42c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706697432; cv=none; b=F7JXhPfyBG2zKH5g+xahTQFKYwWwbw0sVGVdy/zpGHwF99DhxIUugS2KkCxtd/glxzkc0CrUsGu8ucRE8IYpH5AsZmnOyaPFGIaxmP/brKwo0W4JU3LO99ah72ooMo9qc2innVC4tLsjhPoRMMbK+Lkxo7G/bIf5nUKrHbrctVc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706697432; c=relaxed/simple; bh=9PRW5h9TdvrdKqNfQXtW2qz9vBpJM5nRICxnl/qIZzY=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=tklVZJfPhmEZ5StiWJk3wdB4MDU+0ZMFHzmMS2Gkwe8hlHMVunwHTeZhsGd+YAg1xcQq9gXLRZp2h0hRbZYg7K8glTDG8L0UU4ItpnT3IDknACk8ZfjQRaZccP0LbRHgGog3p3jTLBp4y5zEEY/FYSoDWFu6MRbwOh484rDy+9U= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-33ae3cc8a6aso2900662f8f.2 for ; Wed, 31 Jan 2024 02:37:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1706697429; x=1707302229; darn=gcc.gnu.org; h=mime-version:message-id:date:user-agent:subject:to:from:from:to:cc :subject:date:message-id:reply-to; bh=V1GdcvFskKfBHxpayMW2mXgonnhEdXVUyrdvcMGAiPE=; b=n9g7Qld7t2E1lNO5Bbe+VOVgvYNIDWqd0Z2cionLF1kYZH+2fupx/OaRjl64GgYZ9U jGTo21aFkRQeN3cRVUEpjghEKhp8bzh1V3ihoL4y+dhl4YiNkY/Z2uHnq7pTHx/Tu/dQ CqGNDdRbIYKvpylZuaKntZ/6Chtc9BszP4U2PDjY9yL2cumXvtIiiwISUeakG/T3Uc/r rQd+PuZvzuAnkLrpHOGoIxJJO8t3YNdefeKfCgh2XG2b8iPJnY6gBvvziq7v9tNtRXMv +X3lKayf0zH5k1grJPYzl9C/5ytW9lLLZNDakrJhL9PmD7oH0RT316g+LFQLGHrAHnhd 0r9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706697429; x=1707302229; h=mime-version:message-id:date:user-agent:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=V1GdcvFskKfBHxpayMW2mXgonnhEdXVUyrdvcMGAiPE=; b=Hi+gOAoO9/phEUr8l/jTn8nI39vI0gd+B9/eFlHUAh9DpYi4L2My1gtHME1kTv9985 sU10bFox8/vkGWkmNNZf9YzAzTX1mjScJn39zSjQ5jbzlAqdwbtszsefbPMforJ4Ln+P 2CIg81cjKqx8XdXjXLgwFBzCatcDtncoTB29P295xHvdMkdyq8QEcIhUuwziE1SfiFsQ mY2kiZ9wAx1aTNYpHhtlXzhh1tx3W+WL/VAiM1eh/VQMsDJppbtC6rA1gLYqpmPGM3YX oAbXmtQxpj3IbZRTQ0JnmIj8IYOscCJ13zDD4Zv7sGzIVU9GhjmacSwHNL/KsawskiXi KMvw== X-Gm-Message-State: AOJu0YwD26he+9fY142uZtdicUVN1ZoceG1tRtKghRMJb63PnrpxHnzm Ee5rJX+eZyBZtkw0e4jTuC+t+d/0HGdI86ONyQ/24BL2NJWAT/V8QBb5KCqwPB4= X-Google-Smtp-Source: AGHT+IHEvqrmO2gA+n81CtoKvtSUBPBaiMa0AJy/v5EBojGJbwJkM4t5wQD05l9hV8GIaW4ofT/x0Q== X-Received: by 2002:adf:e3cf:0:b0:33a:eadb:f4cd with SMTP id k15-20020adfe3cf000000b0033aeadbf4cdmr756276wrm.58.1706697428996; Wed, 31 Jan 2024 02:37:08 -0800 (PST) Received: from euler.schwinge.homeip.net (p200300c8b7344200b5efa23283b9f09b.dip0.t-ipconnect.de. [2003:c8:b734:4200:b5ef:a232:83b9:f09b]) by smtp.gmail.com with ESMTPSA id bo16-20020a056000069000b0033af49f5819sm6103056wrb.19.2024.01.31.02.37.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 02:37:08 -0800 (PST) From: Thomas Schwinge To: Andrew Stubbs , gcc-patches@gcc.gnu.org Subject: GCN, RDNA 3: Adjust 'sync_compare_and_swap_lds_insn' User-Agent: Notmuch/0.29.3+94~g74c3f1b (https://notmuchmail.org) Emacs/29.1 (x86_64-pc-linux-gnu) Date: Wed, 31 Jan 2024 11:36:36 +0100 Message-ID: <87plxhlrgr.fsf@euler.schwinge.ddns.net> MIME-Version: 1.0 X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Hi! OK to push "GCN, RDNA 3: Adjust 'sync_compare_and_swap_lds_insn'", see attached? In pre-RDNA 3 ISA manuals, there are notes for 'DS_CMPST_[...]', like: Caution, the order of src and cmp are the *opposite* of the BUFFER_ATOMIC_CMPSWAP opcode. ..., and conversely in the RDNA 3 ISA manual, for 'DS_CMPSTORE_[...]': In this architecture the order of src and cmp agree with the BUFFER_ATOMIC_CMPSWAP opcode. Is my understanding correct, that this isn't something we have to worry about at the GCC machine description level; that's resolved at the assembler level? Grüße Thomas From df6e031bf4b46d9e5b2de117fecd66b8b9b6dd20 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Wed, 31 Jan 2024 10:19:00 +0100 Subject: [PATCH] GCN, RDNA 3: Adjust 'sync_compare_and_swap_lds_insn' For OpenACC/GCN '-march=gfx1100', a lot of test cases FAIL: /tmp/ccGfLJ8a.mkoffload.2.s:406:2: error: instruction not supported on this GPU ds_cmpst_rtn_b32 v0, v0, v4, v3 ^ Apparently, in RDNA 3, 'ds_cmpst_[...]' has been replaced by 'ds_cmpstore_[...]'. gcc/ * config/gcn/gcn.md (sync_compare_and_swap_lds_insn) [TARGET_RDNA3]: Adjust. --- gcc/config/gcn/gcn.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gcc/config/gcn/gcn.md b/gcc/config/gcn/gcn.md index 8abaef3bbdec..bbb75704140b 100644 --- a/gcc/config/gcn/gcn.md +++ b/gcc/config/gcn/gcn.md @@ -2095,7 +2095,12 @@ (match_operand:SIDI 3 "register_operand" " v")] UNSPECV_ATOMIC))] "" - "ds_cmpst_rtn_b %0, %1, %2, %3\;s_waitcnt\tlgkmcnt(0)" + { + if (TARGET_RDNA3) + return "ds_cmpstore_rtn_b %0, %1, %2, %3\;s_waitcnt\tlgkmcnt(0)"; + else + return "ds_cmpst_rtn_b %0, %1, %2, %3\;s_waitcnt\tlgkmcnt(0)"; + } [(set_attr "type" "ds") (set_attr "length" "12")]) -- 2.43.0