From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oa1-x2e.google.com (mail-oa1-x2e.google.com [IPv6:2001:4860:4864:20::2e]) by sourceware.org (Postfix) with ESMTPS id 581203846456 for ; Tue, 14 Jun 2022 00:31:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 581203846456 Received: by mail-oa1-x2e.google.com with SMTP id 586e51a60fabf-1011df6971aso8150538fac.1 for ; Mon, 13 Jun 2022 17:31:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3iePGckCXJF2eUiyKPTG8cGSXpX9U74X9+56iH6OvvM=; b=hBMhZQgXi7eXPN6ptWwQCR8w6Mdhgf6QCUPT65pyZmLANbN0wg26FYSa0cQrlZg2Gu FLzSL714cbJqJ9B8Ft7y/8FQwjTXSuNViMZpxRwoZTpeQn8gl1A4krIIHjaZpukwaccp LUIOEoq+Vr3PjTcdC61rjup3/SiT1X3RVIpfuj3TDxFdJMxiEKxtOvSOlSWmpJe4G80K 7wxRw+TkGD9ZBwi1njNHY/H/12V+ygxBgdDRxqN95+bMqLgqokqY964xYwPj5I6WyedI 1wM7DlRIw3q+PUIDrBVRutk0g7PXbjBZW4OEipiBQ/JeI+O+F/1NRoRv6eeaW2joHdkJ fEHQ== X-Gm-Message-State: AJIora+fwz9aZ8RJDzXeuut22vBtc1f4jel7ce+D+yuGYVOurRQUsGyc +Oo/2Y8wex8xKwtgvxIp2ah313hYBMBFB78Dxak= X-Google-Smtp-Source: AGRyM1ueXeNYCNGxQopTDnRmtrCUPIepl8BrDls+JFn9NmH0PptbR0Xx6cARzKIITD4wgDFMClhgvCsfgZ8KeNjfgN4= X-Received: by 2002:a05:6870:e616:b0:fe:9f2:2a76 with SMTP id q22-20020a056870e61600b000fe09f22a76mr866998oag.55.1655166684289; Mon, 13 Jun 2022 17:31:24 -0700 (PDT) MIME-Version: 1.0 References: <84fed208-0253-b04d-c8e5-b910fc8cb321@yahoo.co.jp> In-Reply-To: <84fed208-0253-b04d-c8e5-b910fc8cb321@yahoo.co.jp> From: Max Filippov Date: Mon, 13 Jun 2022 17:31:13 -0700 Message-ID: Subject: Re: [PATCH v2 1/4] xtensa: Improve shift operations more To: "Takayuki 'January June' Suwa" Cc: GCC Patches Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=1.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, FROM_LOCAL_NOVOWEL, HK_RANDOM_ENVFROM, HK_RANDOM_FROM, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * 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: , X-List-Received-Date: Tue, 14 Jun 2022 00:31:26 -0000 On Mon, Jun 13, 2022 at 9:39 AM Takayuki 'January June' Suwa wrote: > > Changes from v1: > (*shift_per_byte_omit_AND_1): changed to be split as early as possible > > > === > This patch introduces funnel shifter utilization, and rearranges existing > "per-byte shift" insn patterns. > > gcc/ChangeLog: > > * config/xtensa/predicates.md (logical_shift_operator, > xtensa_shift_per_byte_operator): New predicates. > * config/xtensa/xtensa-protos.h (xtensa_shlrd_which_direction): > New prototype. > * config/xtensa/xtensa.cc (xtensa_shlrd_which_direction): > New helper function for funnel shift patterns. > * config/xtensa/xtensa.md (ior_op): New code iterator. > (*ashlsi3_1): Replace with new split pattern. > (*shift_per_byte): Unify *ashlsi3_3x, *ashrsi3_3x and *lshrsi3_3x. > (*shift_per_byte_omit_AND_0, *shift_per_byte_omit_AND_1): > New insn-and-split patterns that redirect to *xtensa_shift_per_byte, > in order to omit unnecessary bitwise AND operation. > (*shlrd_reg_, *shlrd_const_, *shlrd_per_byte_, > *shlrd_per_byte__omit_AND): > New insn patterns for funnel shifts. > > gcc/testsuite/ChangeLog: > > * gcc.target/xtensa/funnel_shifter.c: New. > --- > gcc/config/xtensa/predicates.md | 6 + > gcc/config/xtensa/xtensa-protos.h | 1 + > gcc/config/xtensa/xtensa.cc | 14 ++ > gcc/config/xtensa/xtensa.md | 213 ++++++++++++++---- > .../gcc.target/xtensa/funnel_shifter.c | 17 ++ > 5 files changed, 213 insertions(+), 38 deletions(-) > create mode 100644 gcc/testsuite/gcc.target/xtensa/funnel_shifter.c Regtested for target=xtensa-linux-uclibc, no new regressions. Committed to master. -- Thanks. -- Max