Message ID | 20230405210118.1969283-4-patrick@rivosinc.com |
---|---|
State | Accepted |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6358:3d4a:b0:114:e959:cc0c with SMTP id b10csp621171rwc; Wed, 5 Apr 2023 14:09:56 -0700 (PDT) X-Google-Smtp-Source: AKy350ZwTHUeXBplvQnflJAB/wozrpd4E2HWJBNjoDz7RH2Wpc+zqp6/RIO8lzVfBfuPalcZgHXb X-Received: by 2002:a17:906:fa9b:b0:945:d94e:7054 with SMTP id lt27-20020a170906fa9b00b00945d94e7054mr5001581ejb.36.1680728995910; Wed, 05 Apr 2023 14:09:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680728995; cv=none; d=google.com; s=arc-20160816; b=JPDWg0IpmkPgffhf3Bq7/byjHsutQzVgSziGGIllMhQbCUfigjlQ4ReMDb+PbQqRec 00Nag3A3HS4iWZqgYPIv5uOpVz4lIYeY0JA5wIuk5Oe4o6kxpbiExzpXirEzftiO43tJ JaHCHFLc4VdCUbG3IZsw/dTZA2JE4aiLMLSU+jGY9bg2syYNo16Ddt5wMLMnQBKXJtuN ZnSPkVOKeLNuiFPGphb4Ytpev8lAF8g0oPoZ2SIid/JPilocP4/36bxdE9oFruy4gsVX kPDX9ns38ak6x60QndTIwIWudpemuIoKdcbOLDquDXmVs2TKOfv8cKnzW3nZhvuEE8jF PjcQ== 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=eRsKergMzYC6tajGopght9zcZxmMjs6Z05dcXlbHICg=; b=i8MxSynCzZVq036mbXkCOjWkFqd6k+r31c6Lcb9ijCFDrzrt31Ft/cA9C2fg1PqMEQ a6wNEDoZukMLp6MHl48uwiOfmeUVzSLFRnXw0IJh+YYUgAtxqAgvdaeEMJbsbkfYYwa8 WhiLOXlvcM1StN/Xjuyqu7Tsm1QVYUcjjssV/pHRjgWgJb+fe1mglebMFhWJJEW4UnhX hPMlaO2gqCOWS743aDt1uqwewUP7IuyqGBBGr5ZPvj4drXqlT6n5H2OTJYVfM/ZZOtBF IyjWvgxNfDrJgb1wzCus/JLvhU3lw+pvdjpSfkTwZnlRWTWU++qxqa2DDno2VL/mAG3M vbPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20210112.gappssmtp.com header.s=20210112 header.b=wXxplG6f; 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 hr8-20020a1709073f8800b0093fb84fcda5si2048001ejc.812.2023.04.05.14.09.55 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Apr 2023 14:09: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.20210112.gappssmtp.com header.s=20210112 header.b=wXxplG6f; 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 1DD803870900 for <ouuuleilei@gmail.com>; Wed, 5 Apr 2023 21:05:15 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pj1-x1042.google.com (mail-pj1-x1042.google.com [IPv6:2607:f8b0:4864:20::1042]) by sourceware.org (Postfix) with ESMTPS id B87F5385771D for <gcc-patches@gcc.gnu.org>; Wed, 5 Apr 2023 21:03:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B87F5385771D 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-x1042.google.com with SMTP id q102so35273777pjq.3 for <gcc-patches@gcc.gnu.org>; Wed, 05 Apr 2023 14:03:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20210112.gappssmtp.com; s=20210112; t=1680728582; x=1683320582; 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=eRsKergMzYC6tajGopght9zcZxmMjs6Z05dcXlbHICg=; b=wXxplG6flsfNGbgjOT00R9peWivF/cmawg/qMrFtEGhK7/qo5zJTYS6giDXO58g2o9 zQynAcWzTLerW5it94Be5HdPyInUJiuww+FMf4SRgdwwGV5tE+FnPI/znXLiZCozmOtv LBeFumY/o97LtJMrcooxXOEC508tP2VkjuKRIqr2VTDiqxQPQMqarBSm3NcchjlDgxOB 9oKxPphKYeNtdbMteprYkTf/DNuQJJ3Turkv2Jq6rzIwG92NFVoszafKvVUoRYBtCP6C 0S4y7vy1WM3KdzKYcNGNQzw/XccBqLPlNlS8GYmcFiA53OKgtFd2yQzxdXIpSLPs5Fk7 HF2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680728582; x=1683320582; 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=eRsKergMzYC6tajGopght9zcZxmMjs6Z05dcXlbHICg=; b=Ub8KIhvGG4j0HxpCtfTcuUeMTe+W83S5PdveZ0xAHyMpvKhp+kYeGwMBCbgLwHpTOj xo9nhCoc8QPKukbUhDJ03ys9Xs4gXV7Gjp9+AW+hM/wft5eFr6aX7PlUQqZdTPNNScdh LsAOTuVyXY3wB6QfbMEDsr/QwigyHcpRY9jwcdVScEgqmW/3z4EL03DcSCQbv0YjbthO 0HD7LxiKep3W3Ksrq0wWdR+mhjxa8/coFnXxA7Yx1+lDcwVWSb8ZMOMHAhAzmMtvChFx qS97MOUJMci3crrTqtkjWLdSJ3mxnPMP246tL89Ftvy/SxPW1hWP0S62NYBHiXyJDzvR DUKQ== X-Gm-Message-State: AAQBX9fBP6MbAqrHaSB+Kym9a23P2uJ44gu1HPi0KAH5FZZjQy35NJwc 5vLGm5d0YDMXsq7N1fab1CzJDdqBm22UTAIDD7C9IUwYBEU= X-Received: by 2002:a17:90b:3ece:b0:22c:6d7c:c521 with SMTP id rm14-20020a17090b3ece00b0022c6d7cc521mr8214433pjb.45.1680728582706; Wed, 05 Apr 2023 14:03:02 -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.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Apr 2023 14:03:02 -0700 (PDT) From: Patrick O'Neill <patrick@rivosinc.com> 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 <patrick@rivosinc.com> Subject: [PATCH v2 3/8] RISCV: Enforce atomic compare_exchange SEQ_CST Date: Wed, 5 Apr 2023 14:01:13 -0700 Message-Id: <20230405210118.1969283-4-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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, KAM_SHORT, 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 <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762372088044742713?= X-GMAIL-MSGID: =?utf-8?q?1762372088044742713?= |
Series |
RISCV: Implement ISA Manual Table A.6 Mappings
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
Commit Message
Patrick O'Neill
April 5, 2023, 9:01 p.m. UTC
This patch enforces SEQ_CST for atomic compare_exchange ops.
Replace Fence/LR.aq/SC.aq pairs with strong SEQ_CST LR.aqrl/SC.rl pairs
recommended by table A.6 of the ISA manual.
2023-04-05 Patrick O'Neill <patrick@rivosinc.com>
* sync.md: Change FENCE/LR.aq/SC.aq into sequentially
consistent LR.aqrl/SC.rl pair.
Signed-off-by: Patrick O'Neill <patrick@rivosinc.com>
---
gcc/config/riscv/sync.md | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/gcc/config/riscv/sync.md b/gcc/config/riscv/sync.md index c932ef87b9d..de42245981b 100644 --- a/gcc/config/riscv/sync.md +++ b/gcc/config/riscv/sync.md @@ -115,9 +115,16 @@ UNSPEC_COMPARE_AND_SWAP)) (clobber (match_scratch:GPR 6 "=&r"))] "TARGET_ATOMIC" - "%F5 1: lr.<amo>%A5 %0,%1; bne %0,%z2,1f; sc.<amo>%A4 %6,%z3,%1; bnez %6,1b; 1:" + { + return "1:\;" + "lr.<amo>.aqrl\t%0,%1\;" + "bne\t%0,%z2,1f\;" + "sc.<amo>.rl\t%6,%z3,%1\;" + "bnez\t%6,1b\;" + "1:"; + } [(set_attr "type" "atomic") - (set (attr "length") (const_int 20))]) + (set (attr "length") (const_int 16))]) (define_expand "atomic_compare_and_swap<mode>" [(match_operand:SI 0 "register_operand" "") ;; bool output