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: 194655 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2087:b0:106:209c:c626 with SMTP id gs7csp1797606dyb; Wed, 31 Jan 2024 02:38:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IHqjyGn7GyLJ6V4sDOqS04ku9MXEuDQri6Q3SJ7t6dzZVdP6uWvKn1JoDTqsovUyWc5D0IE X-Received: by 2002:ad4:5f08:0:b0:68c:513d:bf1b with SMTP id fo8-20020ad45f08000000b0068c513dbf1bmr1134970qvb.65.1706697485251; Wed, 31 Jan 2024 02:38:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706697485; cv=pass; d=google.com; s=arc-20160816; b=0tLChyHNf7JnB8acshzuWu6F6edtLJj14J72tBJcUUPXAp/H79mYuUketg6te5kL4i fgQCKrusiUoK0zxD4RbtVi2fU7QnLIlf6E6nlBCQkmIgBUOjzaph9D34wPDn1HikWKLe 1FG9WQh5pWt2TghThLUAJ9xAsTUE1ppBwpYsFxeydhrz82QvVGE4jMo/aCFCEzuSEt5G Q4X7pzmLZmIvvO8AkD5IQ6/tjTz4IFTcGX5U55nc2N/TKSDDliJuT8liTnMW+9oBYQE4 VUGYnVVF0q5Yoi8TajAxFMCHeFrwYiuoDh9/Vizc8irTfq68lqFPUb2bRCntxSSrUCqX VlCA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mime-version:message-id:date :user-agent:subject:to:from:dkim-signature:arc-filter:dmarc-filter :delivered-to; bh=V1GdcvFskKfBHxpayMW2mXgonnhEdXVUyrdvcMGAiPE=; fh=RrRsqF0dal416WIOLWuYiFRA8RnF/9SaR5oA2FLd1bs=; b=FQJYGcToGP0BW9RptS3LiE64NG/sJensa729YepaQ4HaxDhbb8KGE/Ed4IFUDRBWxL 03KLg5kxnmWrHt4cbb9xgLnsThnBTBP7pkNt9d9TpbXzLqpIt4UFr8yH4g2vFqn1ERwG YeXw+5WlqE2GjrbyIeegBeB1zfU+aReGj1nC1xGTpegH909fNkIFjBB11nWnSBixnE9r pI6QE022G/cjRsYnQX1iI29ckwf4OgOyWW+K67rJ8JsfMpr5QvuZ8rg2zgxwT44JHkoW qVujR+IuGBFWDDT1eowsb7tKlC52sQyOyEACfnxfYaxcccESL4jSGBmTEaJ/hA9OB6o/ Z/ZA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=n9g7Qld7; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" X-Forwarded-Encrypted: i=1; AJvYcCXN1FWzq2y2iR/W765zvtRtvM059eqcYa2d1ac31ctqwIHhh6Qteww7MKlrGM3KxQqIg5YnlhM00jUNM/urcngGBrpeUg== Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id j4-20020a05621419c400b006819aeb2dd4si12711116qvc.365.2024.01.31.02.38.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 02:38:05 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=n9g7Qld7; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EDA3C3858008 for ; Wed, 31 Jan 2024 10:38:04 +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-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+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789602021934924261 X-GMAIL-MSGID: 1789602021934924261 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