Message ID | 1661015666-14659-1-git-send-email-apinski@marvell.com |
---|---|
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f406:0:0:0:0:0 with SMTP id g6csp290267wro; Sat, 20 Aug 2022 10:15:42 -0700 (PDT) X-Google-Smtp-Source: AA6agR7xTLDCBfSJkY6ebymBkMfDTpG/vdckfN8xYT/6Ey7O8QE6K5dg2S8Ni7i8uLE1pxb4vbvu X-Received: by 2002:a17:906:216:b0:711:f623:8bb0 with SMTP id 22-20020a170906021600b00711f6238bb0mr8644688ejd.174.1661015742627; Sat, 20 Aug 2022 10:15:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661015742; cv=none; d=google.com; s=arc-20160816; b=fHdVXbjuPpDXFmgcxsUzueDrrLtTAWrmHAMOn0z814d/P2aqSKw4+ObrEh99aONWGZ CsXCLzY9L4jar6WgFnZLGf1pGCv/EKZWb2ZUc754OKaBgHEaeI0xeg0PvQDuBZmYBsZ+ z0Dib5YSaXg2LTccWeQFN0LG5coLfG8BX46iiX+Jvw/r1KvL8i62RH4HsPkOLI7u/9Ej BT0uAbReqgiFeZKkWehK9ahIy8So4f6DlVCYikuUKlUEbUlqd1PjNuAhNB8mE8YIuFHD F/+Pi0Gd1PAHM+tJezopLcnpcONZvt5SqplPQrPcwUz8nC+CwaMgt0Mzt2+BEgkvc7Fh yvsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:reply-to:from:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mime-version:message-id:date:subject:to:dmarc-filter:delivered-to :dkim-signature:dkim-filter; bh=+VjhvxI2wg6V83Bp8cgMmV6Gqwgp92eVuH48epOMRfg=; b=h7ld/mbdOAQiL9JBNFXOEdFyaAku7NoxoMU6VfkeQZlrwmCHqI1a4OG2BLkgARIIH0 l51/FHvCpsBD6jL8/leAw4wEM7O0YV7ZQRlr6wIbwficfCV/KgnV8sDPDIfGkpPzGSPT q0vDi2iTGSdVlVPhkmpesdlrxSbIQwbalSCWVfZQdGwPMRD+nRY44DPKAiQwrbgwAMd3 gh2JJCWy1qa75ciXdZ5s0Rab/vLquC5fWdLqlYypO0wod1yVy3RCPdjxfQfIkmFjT7cg yO65kH1LHNcACvhpxPXrjiGD5HiQHVF6AoOASkFUN+DGHd1QxtVGu0gRYznbG5nuvmTr pAvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b="hWgGTZl/"; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id x2-20020a1709064a8200b0073c67b8a971si4485029eju.322.2022.08.20.10.15.42 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 Aug 2022 10:15:42 -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=@gcc.gnu.org header.s=default header.b="hWgGTZl/"; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B17D23858403 for <ouuuleilei@gmail.com>; Sat, 20 Aug 2022 17:15:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B17D23858403 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1661015717; bh=+VjhvxI2wg6V83Bp8cgMmV6Gqwgp92eVuH48epOMRfg=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=hWgGTZl/ciZqLg4SlNXBKEj94dIuxKUO4q1mE8sJ/kOm4Td8MfNxRfzr+f0q/KYyG lSM/7EhgqRU7f8bdhepOd1+5y7LQDEFfBCmtK8Xd9ALeUlwCCdcsSQDzoDovD8GY/S J5nHY4F6pRkigArLnzCrXzz3Nu4ckGEhNNLzaXAo= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by sourceware.org (Postfix) with ESMTPS id 5B4083858CDA for <gcc-patches@gcc.gnu.org>; Sat, 20 Aug 2022 17:14:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5B4083858CDA Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27KH0CPR017197 for <gcc-patches@gcc.gnu.org>; Sat, 20 Aug 2022 10:14:33 -0700 Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3j2y4jrm0k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for <gcc-patches@gcc.gnu.org>; Sat, 20 Aug 2022 10:14:33 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Sat, 20 Aug 2022 10:14:31 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Sat, 20 Aug 2022 10:14:31 -0700 Received: from linux.wrightpinski.org.com (unknown [10.69.242.198]) by maili.marvell.com (Postfix) with ESMTP id B946B3F7060; Sat, 20 Aug 2022 10:14:31 -0700 (PDT) To: <gcc-patches@gcc.gnu.org> Subject: [PATCH 0/3] [RISCV] Improve bswap for ZBB Date: Sat, 20 Aug 2022 10:14:23 -0700 Message-ID: <1661015666-14659-1-git-send-email-apinski@marvell.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-GUID: h1UR5by5cdd023ZtnBphFvVX07RozMKb X-Proofpoint-ORIG-GUID: h1UR5by5cdd023ZtnBphFvVX07RozMKb X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-20_08,2022-08-18_01,2022-06-22_01 X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_SHORT, 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 <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> From: apinski--- via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: apinski@marvell.com Cc: Andrew Pinski <apinski@marvell.com> 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?1741701243288789058?= X-GMAIL-MSGID: =?utf-8?q?1741701243288789058?= |
Series | Improve bswap for ZBB | |
Message
Li, Pan2 via Gcc-patches
Aug. 20, 2022, 5:14 p.m. UTC
From: Andrew Pinski <apinski@marvell.com>
Just some improvements for bswap and ZBB including a testsuite change that will
allow more testing to happen.
Thanks,
Andrew Pinski
Andrew Pinski (3):
Fix PR 106600: __builtin_bswap32 is not hooked up for ZBB for 32bit
Fix PR 106601: __builtin_bswap16 code gen could be improved with ZBB
enabled
Fix PR 106690: enable effective_target_bswap for RISCV targets with
ZBB enabled by default
gcc/config/riscv/bitmanip.md | 26 ++++++++++++++++++-
.../gcc.target/riscv/zbb_32_bswap-1.c | 11 ++++++++
.../gcc.target/riscv/zbb_32_bswap-2.c | 12 +++++++++
gcc/testsuite/gcc.target/riscv/zbb_bswap-1.c | 11 ++++++++
gcc/testsuite/gcc.target/riscv/zbb_bswap-2.c | 12 +++++++++
gcc/testsuite/lib/target-supports.exp | 7 +++++
6 files changed, 78 insertions(+), 1 deletion(-)
create mode 100644 gcc/testsuite/gcc.target/riscv/zbb_32_bswap-1.c
create mode 100644 gcc/testsuite/gcc.target/riscv/zbb_32_bswap-2.c
create mode 100644 gcc/testsuite/gcc.target/riscv/zbb_bswap-1.c
create mode 100644 gcc/testsuite/gcc.target/riscv/zbb_bswap-2.c
Comments
Hi Andrew: LGTM, Just checked what's clang gen, and saw LLVM already did the same optimization, thanks for improving the code gen! On Sun, Aug 21, 2022 at 1:15 AM apinski--- via Gcc-patches <gcc-patches@gcc.gnu.org> wrote: > > From: Andrew Pinski <apinski@marvell.com> > > Just some improvements for bswap and ZBB including a testsuite change that will > allow more testing to happen. > > Thanks, > Andrew Pinski > > > Andrew Pinski (3): > Fix PR 106600: __builtin_bswap32 is not hooked up for ZBB for 32bit > Fix PR 106601: __builtin_bswap16 code gen could be improved with ZBB > enabled > Fix PR 106690: enable effective_target_bswap for RISCV targets with > ZBB enabled by default > > gcc/config/riscv/bitmanip.md | 26 ++++++++++++++++++- > .../gcc.target/riscv/zbb_32_bswap-1.c | 11 ++++++++ > .../gcc.target/riscv/zbb_32_bswap-2.c | 12 +++++++++ > gcc/testsuite/gcc.target/riscv/zbb_bswap-1.c | 11 ++++++++ > gcc/testsuite/gcc.target/riscv/zbb_bswap-2.c | 12 +++++++++ > gcc/testsuite/lib/target-supports.exp | 7 +++++ > 6 files changed, 78 insertions(+), 1 deletion(-) > create mode 100644 gcc/testsuite/gcc.target/riscv/zbb_32_bswap-1.c > create mode 100644 gcc/testsuite/gcc.target/riscv/zbb_32_bswap-2.c > create mode 100644 gcc/testsuite/gcc.target/riscv/zbb_bswap-1.c > create mode 100644 gcc/testsuite/gcc.target/riscv/zbb_bswap-2.c > > -- > 2.17.1 >