From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by sourceware.org (Postfix) with ESMTPS id 523533858D32 for ; Tue, 11 Apr 2023 16:19:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 523533858D32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pl1-x62c.google.com with SMTP id p8so8400064plk.9 for ; Tue, 11 Apr 2023 09:19:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681229947; x=1683821947; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=2MpJDZv6zFCYlyO/DsrGzXa5daplm71QLNWrkDRt+n0=; b=Kjne1fqdm7X96C/BnANtRhFhFhyH4se+QzmiqpMoL6pq24Pr6Xl2Pxvr9EgBnPWAN9 fG9nPGzpiCYu0iivyXWVTkscMPtBMCJcwJ8y2QCZh1F6VRxk3nAQdlRFwvAngcjI//AA hlGKqpjEkXD+prHjScIlfXtaKDj75kMk4TeUX4OELdU+KCLO4xWAnVYbCgt/y5rgPSYJ gBhUCJDJjdqa+tJ65I4UaCFq7d5ClYXd4bDflqV/wttnqRPumfZtckXxkQLHx+TVlSh8 UZeuiU01m79HrEeSAUCC0nlVGU2zOPINKltjUOpWd7Z9E/w0Jurn6M07Yln1V7MFEMPT jPeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1681229947; x=1683821947; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=2MpJDZv6zFCYlyO/DsrGzXa5daplm71QLNWrkDRt+n0=; b=zMM5TOd/zeW8BIxURYN2BU9TIR28dKvy8IDfS/75K5Ovkf6V9C6xBApdpJblKQtl3D o/2c224rhzC6RSf0obrMUPi3zpZev8yDeJZdyuukWVokcx66vYZLi9Rb8qGam8/d5nly myPz8CqFqAwBYnMADWLYCCVrKp9Nb+gkEv6jF2nwDOIG9jSoqQmpQ1C41/qLL9D6ECNf Z1qdlQFfosX5omOkPyc+a3vOi/1p/WmZS383sd3dX1dnwc+IOX3yNYIDjmrfnactOBsW 7/JcKT8yIHbhKtXDH/zhjrvtnxVlrZEMKZvvcgXENTfWZKmY7tIgjeXle8hee57Dz0zy XxZQ== X-Gm-Message-State: AAQBX9dK+Tp954xQdyYsgyrdHhzQmt/dvw/2BHDn8My7zVChEW0ecjEe 9+fhEYAdb91jLsU579ca6tg= X-Google-Smtp-Source: AKy350bmVO6O/R0exIq0/BdLD+AwYhgUD+Mc7CImCJKElt4Pdp0XvxWMWwJ8N6z0GVN3swRVq7IWvg== X-Received: by 2002:a17:902:d192:b0:19c:e664:5e64 with SMTP id m18-20020a170902d19200b0019ce6645e64mr10749921plb.2.1681229947158; Tue, 11 Apr 2023 09:19:07 -0700 (PDT) Received: from ?IPV6:2601:681:8600:13d0::f0a? ([2601:681:8600:13d0::f0a]) by smtp.gmail.com with ESMTPSA id x17-20020a1709027c1100b001a51402dea1sm8024543pll.20.2023.04.11.09.19.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 11 Apr 2023 09:19:06 -0700 (PDT) Message-ID: Date: Tue, 11 Apr 2023 10:19:05 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH] RISC-V: avoid splitting small constant in i_extrabit pattern Content-Language: en-US To: Philipp Tomsich Cc: Lin Sinan , gcc-patches@gcc.gnu.org, kito.cheng@gmail.com, palmer@dabbelt.com, andrew@sifive.com, Sinan Lin References: <20230410050701.10254-1-mynameisxiaou@gmail.com> <88a0ea4e-7d5d-13c2-b73c-87fc35f682bb@gmail.com> From: Jeff Law In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_SHORT,NICE_REPLY_A,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 List-Id: On 4/10/23 14:59, Philipp Tomsich wrote: > On Mon, 10 Apr 2023 at 17:57, Jeff Law wrote: >> >> >> >> On 4/9/23 23:07, Lin Sinan via Gcc-patches wrote: >>> From: Sinan Lin >>> >>> there is no need to split an xori/ori with an small constant. take the test >>> case `int foo(int idx) { return idx|3; }` as an example, >>> >>> rv64im_zba generates: >>> ori a0,a0,3 >>> ret >>> but, rv64im_zba_zbs generates: >>> ori a0,a0,1 >>> ori a0,a0,2 >>> ret >>> >>> with this change, insn `ori r2,r1,3` will not be splitted in zbs. >>> --- >>> gcc/config/riscv/predicates.md | 2 +- >>> .../gcc.target/riscv/zbs-extra-bit-or-twobits.c | 14 ++++++++++++++ >>> 2 files changed, 15 insertions(+), 1 deletion(-) >>> create mode 100644 gcc/testsuite/gcc.target/riscv/zbs-extra-bit-or-twobits.c >> A minor oversight in the VRULL patches in this space. This is actually >> a regression as we were previously generating the single [xo]ri. > > Thanks for catching this one! > > I looked this change over and it looks fine. I hope this is the last > fallout from this set of changes. Just for completeness, I bootstrapped and regression tested Sinan's change on rv64. Given it's a regression, I'm going to go ahead and commit it to the trunk momentarily. jeff