From patchwork Mon Apr 10 18:23:42 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: 81594 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2076193vqo; Mon, 10 Apr 2023 11:29:34 -0700 (PDT) X-Google-Smtp-Source: AKy350ZvqeYO8N2mdLPNEurrqHTum+z6QsCjge/JHJhayapBXDf2pjl5nQIZhERzF9921MKGqD7Z X-Received: by 2002:a17:907:3e0e:b0:94a:68dc:1c7b with SMTP id hp14-20020a1709073e0e00b0094a68dc1c7bmr6587117ejc.70.1681151374478; Mon, 10 Apr 2023 11:29:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681151374; cv=none; d=google.com; s=arc-20160816; b=abWGk3pXMf1D4ni7jIy5fxeUbHtGymqVV/0fUZoS/c/knDKwcMoMW4wZDf1YluDtDZ 9Wl3Iskcfjbz3ZVzmAzgEDgHQfdpX2CoVHig5XUMYq2OU+8I8W/bNguZix8kkSpjP6hG xg+HtARMWNAY4Z/88Ex80K7NFZT0ybFtPSTv338o3lWVE6DluEbEWnAwTMsht3DfcRRD rm4Znq9tRtyxLstXwUN+XkC91cRwZnA3gmaiSKR3ABxmkmeYTA6V9+qdop+IwF/s1nqa MaSIPVtYKzv30n8bD6OZXz+RxhhNrKKniyykZMBu/YMXMfWe6AJeFD2VwXxJMeN1K/Vn p5zw== 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=IGP2LgtvtisXp6wBChyNLzJpUiyuNOJa5di9Ua2pGJc=; b=kCvLMr4ASwfBMnEtSPriKx5XaF+kbytxM0qGjNkmE+dGCBMv9/bEQjPavmN95SgWvt h9IbR+NhPZZFlPqwGq0ehB+D2P5oEal/v1xns0TO4rsaFAJ2S+n8YHZaPCRyA2mbb5mq CbMl3GB6q4gm4T0inzpyoAtFwQtytjhePJjKJjmTjjhFxXiKaVZG6vl9qi5jjIy6BL7w 7R28RSnNnpXuP3Q1ai+3W0jP+UgYOkJstbadnVgR/WVtGhO5WdAu83LqE/Ws6c5TfspC 1z+zcVO/m8dnD8TbpyG/UsvWkt7+ZiyhCe380pX3714uIb2om5UngIeAkNVeSelprDMZ 3bTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20210112.gappssmtp.com header.s=20210112 header.b=VIZ4DXAA; 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 (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id s16-20020a170906169000b0094c4daef59csi838820ejd.175.2023.04.10.11.29.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Apr 2023 11:29:34 -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.20210112.gappssmtp.com header.s=20210112 header.b=VIZ4DXAA; 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 51DF13857715 for ; Mon, 10 Apr 2023 18:27:49 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by sourceware.org (Postfix) with ESMTPS id 4125B3857705 for ; Mon, 10 Apr 2023 18:26:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4125B3857705 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-x633.google.com with SMTP id kh6so3800099plb.0 for ; Mon, 10 Apr 2023 11:26:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20210112.gappssmtp.com; s=20210112; t=1681151214; x=1683743214; 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=IGP2LgtvtisXp6wBChyNLzJpUiyuNOJa5di9Ua2pGJc=; b=VIZ4DXAAYkyac4sZQGR5YykoPtqGj68+JmKdvAOOncH/VpKFJVcxMWFIuVpDkG4AaB 2AhAOKDN5yIh2gCwRERiIsFO1HMe1vT6mnt7HYcK6zI+6cQP52V/wiYBEPD2mWKsRMAo tc9jvj+/k7ExS/hU8UPJJyO3RHPYwT6gqmMqkm73So0USwBaZc7+ywAY059T1+NYeHko g5BlkSlEqzi8L7a1V9gvqXWLbJqkop8T58WrSHEU4QGkEllQKsnj0pL0mZxkZvyjcLbI G20Po5+oopLq4i26/lMfirXqOZ5Q4RJ2omLafPdO23cd5KjBMYmtAPb2vOEqGW452Nk0 eSjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681151214; x=1683743214; 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=IGP2LgtvtisXp6wBChyNLzJpUiyuNOJa5di9Ua2pGJc=; b=LpdxqpDDLve55pPXAoDrlFDGHUwvNrznS+e1EkeekhSaXh5UJ0iCnN8sV3gLhp4Ud7 37KZ3mBJaRW9b1D7nvn2IYPa3MQT2x9MDP3Jj6GMhRXnwJUVCOtwSvl+FYkZ49yl0apB PiK6UniRqtB3hSojOfBQbFE+kRavz/Rr9vkgSln0Ufl/GoSerkNA9olxtM3FS9mHCorN VEANP98K9ZDZgBPd9XbdxgBV9QaNdXSCbhKCHOEoaHZcZb5xZHV0bztwwxz70/4IhNx9 1gMct9OO44Q48uBTJHVPf6sUz4OgLljv+o84IzIsO7Fpa2wx38zhWrdYaJvkxOLNx1p5 sekA== X-Gm-Message-State: AAQBX9fdyUvDsTzPBPLy0l6dSLvXgiaw2AuK+gQX4ubemwelmtQZWLJp Wdkwb4uWLBUlIFbb1uZjQRZSIf1wZ9wbsgq42o/26GZ1 X-Received: by 2002:a05:6a20:4b0a:b0:d7:b09b:a723 with SMTP id fp10-20020a056a204b0a00b000d7b09ba723mr12054984pzb.8.1681151214727; Mon, 10 Apr 2023 11:26:54 -0700 (PDT) Received: from patrick-ThinkPad-X1-Carbon-Gen-8.hq.rivosinc.com ([50.221.140.188]) by smtp.gmail.com with ESMTPSA id d2-20020aa78e42000000b00627f054a3cdsm4478977pfr.31.2023.04.10.11.26.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Apr 2023 11:26:54 -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, jefferyalaw@gmail.com, cmuellner@gcc.gnu.org, andrea@rivosinc.com, hboehm@google.com, Patrick O'Neill Subject: [PATCH v3 04/10] RISCV: Add AMO release bits Date: Mon, 10 Apr 2023 11:23:42 -0700 Message-Id: <20230410182348.2168356-5-patrick@rivosinc.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230410182348.2168356-1-patrick@rivosinc.com> References: <20230405210118.1969283-1-patrick@rivosinc.com> <20230410182348.2168356-1-patrick@rivosinc.com> MIME-Version: 1.0 X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP 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?1762371790427566438?= X-GMAIL-MSGID: =?utf-8?q?1762814983806409033?= This patch sets the relevant .rl bits on amo operations. 2023-04-10 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':