From patchwork Thu Apr 27 16:22:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick O'Neill X-Patchwork-Id: 88319 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp392094vqo; Thu, 27 Apr 2023 09:31:56 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6fB3T2S85ivx8jPdRBoZLhXTuPyS1dt1lnk90ffxYL3Go+Zf6dtx/8AEpNW+xjKXL1onO6 X-Received: by 2002:a17:907:72c3:b0:94e:e859:7b07 with SMTP id du3-20020a17090772c300b0094ee8597b07mr2460455ejc.32.1682613115960; Thu, 27 Apr 2023 09:31:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682613115; cv=none; d=google.com; s=arc-20160816; b=TeCn3+iegw/J8LDN+UqO1bsKnyKfzHBqliRYuNZ/rsepBHUnAqYQKusY3nFML0RXp/ ko+zXxGUdoisZ5C9XzJvJvyhZRh62vQVEvKzUz1+50KWgYEJXdwrrmmSIE1O1zOnK6hk x5IprxSnahLOfx5ii+gJj06TTvRWlRXhimQCzu6HeZ/Y59bGhw8IoLbPdlI0YrpyyI8v mov5imyR0J0ZY64gR/ugl/Ut7aEfn6c1RXDSPowVwvvneyXmmPHii04KwfoDRaHVZ8mE AcIivlY4QW3c96cz7sv3IV64tD+8Gbmm+3Zt65CDx9IJcRVzploOABS2NV7eDBF+H/tK pMBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:dmarc-filter:delivered-to; bh=bNjSgMTTHLV0g1Ugg2ndTxjKWJO/vLcHLnGM5M4SXmU=; b=aL8cQrXMP7Ww+IgOFTPqtd1IIyv9zuF87DFf8+paTS28E8ImKCOhiiJaYwAzhG7soC e5Tiyop0cIk4ZuLlYYeb9nG1u6M8B/UcFsZ6g5/yHqWplMcB7IEZTJ5GADqSMz8VqUI8 cau487fKc3HF1LKlmXBqEhFFmYw7F4FiF5eOcAfERiLMono0esF4R4sHhHiKjBGHkOtj Im11VOGllgiszou1/3Kh2EbhbLVKnlY/v7fPJRt2GR91w8/JUj7CT4iBgrLcNPjCSqQf INvB/XgazpwTt3YqmgBP+6nf33f8F091VNEV72LtPNZPO95XkZzVbcWOGuSCuxactOx7 vTyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b=19osVDk5; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id h16-20020a1709063b5000b0094efeef69c1si16473920ejf.1031.2023.04.27.09.31.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Apr 2023 09:31:55 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b=19osVDk5; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 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 CE9E03834684 for ; Thu, 27 Apr 2023 16:26:22 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by sourceware.org (Postfix) with ESMTPS id 173093856248 for ; Thu, 27 Apr 2023 16:24:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 173093856248 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivosinc.com Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1a69f686345so67671385ad.2 for ; Thu, 27 Apr 2023 09:24:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20221208.gappssmtp.com; s=20221208; t=1682612656; x=1685204656; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=bNjSgMTTHLV0g1Ugg2ndTxjKWJO/vLcHLnGM5M4SXmU=; b=19osVDk5TFg6tB+U3Q0eYb7Z0YBWR4Lz4gYp8OTzTVb2aAsaYCPTLzlledfJSYVqAo 44d5MnUI4igEC9RcOdhtbnRyXmtkrpY+/ZR1x7I7e23VdXAlN+23rAlvRUD/pgxO7MH/ lcRjwuCZ550ZdV55q1NBL7BByLvPYL5A0i7/UyLhf5MNW5zvc8nH5qbEchN76PkynePg wouPxZYZ2oDxYk9AT7D4WQi1meP6eYIYToTK3GtGRZJmUjWGrNDF8gq0tyEmRzh81yNg 1+Lc/GOJkkONt0slh8DGt7jaQqbkgkq28ESUrD7mhX6ScP6r+gJC+BlG5VAjAN/yvErN /Cgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682612656; x=1685204656; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bNjSgMTTHLV0g1Ugg2ndTxjKWJO/vLcHLnGM5M4SXmU=; b=hyTSbvJUxsE0+9epYWTVWQwbPOHCPYevQsyqlPUds4WyHJ4hC+j4z31QoApiutBKKa A6vSwhXgIY/crMFBc3W9o3hnrj4qHTww8kUPY1DADGxkpeygIFhFV7lI1PSX20NWBpD8 OXFIsVT7yNMv1glMayQjoZSIHGdviXRLd59+uKWDOAgYoyj8p8FltKV4NBAMZAWJFQW0 dWwCvhXYQ4Kr/xoi/5YaqJbCPcLhZY38LVRaQ5j+/26pzuTlORh9PTpEroeI5XWSh4Lw 7MY8w0OrwboKKUsIy4B6ilcVU9Dwor2c8uJegDuoqHlvsgrTsgfB+QA9yy3J8ykEjCHF lYBQ== X-Gm-Message-State: AC+VfDw52wGlK80Ud5lY8GB0i8bcy3/xOtmqxE6BGmcvyuaf+aNFhHd9 efQ2QcXWQnBl/Ydg2UIHZ329XSTMUAFoPsnfJzri2TO6 X-Received: by 2002:a17:902:868a:b0:1a6:9f09:866d with SMTP id g10-20020a170902868a00b001a69f09866dmr2097789plo.61.1682612656039; Thu, 27 Apr 2023 09:24:16 -0700 (PDT) Received: from patrick-ThinkPad-X1-Carbon-Gen-8.hq.rivosinc.com ([50.221.140.188]) by smtp.gmail.com with ESMTPSA id n19-20020a170902969300b001a6db2bef16sm11815906plp.303.2023.04.27.09.24.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Apr 2023 09:24:15 -0700 (PDT) From: Patrick O'Neill To: gcc-patches@gcc.gnu.org Cc: palmer@rivosinc.com, gnu-toolchain@rivosinc.com, vineetg@rivosinc.com, andrew@sifive.com, kito.cheng@sifive.com, dlustig@nvidia.com, cmuellner@gcc.gnu.org, andrea@rivosinc.com, hboehm@google.com, jeffreyalaw@gmail.com, Patrick O'Neill Subject: [PATCH v5 05/11] RISC-V: Add AMO release bits Date: Thu, 27 Apr 2023 09:22:55 -0700 Message-Id: <20230427162301.1151333-6-patrick@rivosinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230427162301.1151333-1-patrick@rivosinc.com> References: <20230414170942.1695672-1-patrick@rivosinc.com> <20230427162301.1151333-1-patrick@rivosinc.com> MIME-Version: 1.0 X-Spam-Status: No, score=-12.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.29 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 Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764347730958193573?= X-GMAIL-MSGID: =?utf-8?q?1764347730958193573?= This patch sets the relevant .rl bits on amo operations. 2023-04-27 Patrick O'Neill gcc/ChangeLog: * config/riscv/riscv.cc (riscv_print_operand): change behavior of %A to include release bits. Signed-off-by: Patrick O'Neill --- gcc/config/riscv/riscv.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc index 02eb5125ac1..d46781d8981 100644 --- a/gcc/config/riscv/riscv.cc +++ b/gcc/config/riscv/riscv.cc @@ -4503,8 +4503,13 @@ riscv_print_operand (FILE *file, rtx op, int letter) break; case 'A': - if (riscv_memmodel_needs_amo_acquire (model)) + if (riscv_memmodel_needs_amo_acquire (model) + && riscv_memmodel_needs_release_fence (model)) + fputs (".aqrl", file); + else if (riscv_memmodel_needs_amo_acquire (model)) fputs (".aq", file); + else if (riscv_memmodel_needs_release_fence (model)) + fputs (".rl", file); break; case 'F':