From patchwork Wed Apr 5 21:01:14 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: 79942 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp589238vqo; Wed, 5 Apr 2023 14:05:12 -0700 (PDT) X-Google-Smtp-Source: AKy350ZxoJUCYNhBi7NzvZUN/JeAEXitXpAkLlw6AQkXxJPGkaUFcqTIZLDZr3fS8+gZ0sdjDqZP X-Received: by 2002:a17:907:7ea9:b0:92b:e1ff:be30 with SMTP id qb41-20020a1709077ea900b0092be1ffbe30mr5611954ejc.4.1680728712631; Wed, 05 Apr 2023 14:05:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680728712; cv=none; d=google.com; s=arc-20160816; b=oEWzkSLDUoPv804SiLRUwZ9HX/eXQoRiyma0ri5ZN2mqzaij1zvPFxsVtJJwtslFIA kkxTaVy/rAsTL48pQY6K1OXTkQu2rg2B0Di6D4d3Upem0uh+cJiqdHgklHcUHAgzlCkk GyvXR0xx3kW4VGj641/nD1NH9KsSM1HdiG+kmSmiabHeHt2u5H6XbwsMiqOFeRNzMURI 4Nk5zLY9I9LASCmOHtioN0HOHfQkAfhzdZxlBSNW2hNj1HAKDy8hpR43jP3IP1fni4O4 zzbF2cE/ONwzCGa7nM0lGkF7m0OYF47ClVd0yizl6tGPJtKqksOR34ugqYmDsivhZoi5 Apkw== 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=6ywSxDa6+bAZuEdeq9xREaPCG8lxpH/KGb1u4BvZgkw=; b=ltmbujK2V9faUkWxpkaTd2zF89kx34cCvEwlxdH4cJO0mP3AxkpwN7wVJo2uvjZ4Qk ls6QHzuqnanNEmYuWHwWqIwkVHA+OJjrWjHoUssZo9nBMivZdjOOjym1JxJ1ZC0SFxZL xzM5f+W+ALyPCyZoedkKTM8btMym/PaUUqzjocQLvlefmqX8SUZjP13mQds1Rfnde62V Aki3U919YixMJghkminxXj7gZ8oa+EkX4vWDQGO0QlTUtU3v76j2qTFX41GE0xjTl66y JJIci3sEQqq1D6p8b5rmPRePTtBNFjH0j4QLxkOPOlM+X8ZoR+O1LnD/GAtULwoFlewZ In7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20210112.gappssmtp.com header.s=20210112 header.b=BLIcGxCm; 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 sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id a18-20020a170906671200b00933acc77a33si1683018ejp.542.2023.04.05.14.05.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Apr 2023 14:05:12 -0700 (PDT) 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=@rivosinc-com.20210112.gappssmtp.com header.s=20210112 header.b=BLIcGxCm; 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 76E763870901 for ; Wed, 5 Apr 2023 21:03:37 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by sourceware.org (Postfix) with ESMTPS id 057993857714 for ; Wed, 5 Apr 2023 21:03:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 057993857714 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-pj1-x102d.google.com with SMTP id qe8-20020a17090b4f8800b0023f07253a2cso38548255pjb.3 for ; Wed, 05 Apr 2023 14:03:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20210112.gappssmtp.com; s=20210112; t=1680728584; x=1683320584; 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=6ywSxDa6+bAZuEdeq9xREaPCG8lxpH/KGb1u4BvZgkw=; b=BLIcGxCmbutNCLYaTmJK8twNBBbfsbeEyK7WsXvfi41gG2rz9ozeuvt1mb4df2/gYX qC0PyKhkcj97tKJPmHzaKglt79+NMnaNHhuHHgKEBEnIfIa36ahbfWc7G/C9LGndtnGX VqyIGLQvMnNstlPoBD3DC+SEcFZHtAvRvtTHcYl77OwftO1Zh5e2COL1AEi5DEXSJp3T NM9gD7cMUpB28cZLmEXN+9woEOzaaF/N2pnjogyxw7pacIGHwekqe/JAXVDofHRkWzvA 8z4w50pyje38ePist0GHs1PGVhrSVC3INJHyhA6A+RboqnrjYAsqqbHB3ty9so/YMaGU gooA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680728584; x=1683320584; 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=6ywSxDa6+bAZuEdeq9xREaPCG8lxpH/KGb1u4BvZgkw=; b=WYj6ujglfH9vANJTw2bRVuVmpuk+JpPY1IFTpJIfR2ag27hu4vxGV9tdXX0KLqcno+ CpzW714S4VRy7uug7TDe+jwax9+VKFSX2kCH1cuqpceV0+SLtxrkrgF6gFqe1BPTzZYp REP7KK1avUtLzM4Ow9uSMm7HxN9h3WjcAg3ARb2OiBpbX3YmboTmos11nWD+Wm6ORDJA 3Ol5srI2jzHVA+1z6gjArGEAkjwdu3rPrF7p+Spwsoo60Poq0qHo29yP2ToT0tvVN14f eOguOdVofvXMlbHamFAPGRRnr3FQoCBIMUUyeqUFeT3g3rHStAL+jykOiq9CChoz1n/+ TZbg== X-Gm-Message-State: AAQBX9cKK5+0Ff5H/zNb+wsz0fTDNE0U8c7Ycok1Ua3zQZJzY9/z+BbT K478J0pAw6bDqRTPPkZfqIuXjqM7alfHrNVnxDUlr34t X-Received: by 2002:a17:90b:38c6:b0:23b:3641:cf16 with SMTP id nn6-20020a17090b38c600b0023b3641cf16mr3889119pjb.11.1680728583801; Wed, 05 Apr 2023 14:03:03 -0700 (PDT) Received: from patrick-ThinkPad-X1-Carbon-Gen-8.hq.rivosinc.com ([50.221.140.188]) by smtp.gmail.com with ESMTPSA id e6-20020a17090a77c600b002342ccc8280sm1809477pjs.6.2023.04.05.14.03.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Apr 2023 14:03:03 -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, jeffreyalaw@gmail.com, cmuellner@gcc.gnu.org, andrea@rivosinc.com, Patrick O'Neill Subject: [PATCH v2 4/8] RISCV: Add AMO release bits Date: Wed, 5 Apr 2023 14:01:14 -0700 Message-Id: <20230405210118.1969283-5-patrick@rivosinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230405210118.1969283-1-patrick@rivosinc.com> References: <20220407182918.294892-1-patrick@rivosinc.com> <20230405210118.1969283-1-patrick@rivosinc.com> MIME-Version: 1.0 X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=unavailable 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?1762371790427566438?= X-GMAIL-MSGID: =?utf-8?q?1762371790427566438?= This patch sets the relevant .rl bits on amo operations. 2023-04-05 Patrick O'Neill * 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 8f5636c93ed..8ffee494fbe 100644 --- a/gcc/config/riscv/riscv.cc +++ b/gcc/config/riscv/riscv.cc @@ -4492,8 +4492,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':