From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by sourceware.org (Postfix) with ESMTPS id A45DA3858431 for ; Thu, 17 Nov 2022 23:17:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A45DA3858431 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-x62e.google.com with SMTP id y4so3049971plb.2 for ; Thu, 17 Nov 2022 15:17:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=NI8zwlUHlxbOzHPKPgvbjV4fIdTHCSQ9VYLbc/tC3gs=; b=Ean/lqshFSdcWw8qiupjZVr9yZwKfpFkrwFy8ucwxHg6QqMV9ld3kgJY32WguOZxZ3 To/SIZYtkO888gGt7VvTr5mi0uSyCFC+rYjIHhD1LBY7K+VdGUoNWsdHjE02UhDIEvbL hARn2RTo5hcQaP+t/XGJanLlfPCdx84usFGl9IXMU4k8I19/UwJCm5/M13roA07YNWew 16TEJjmloXjZQBSR9YhjqYSu5GiQs/TS2PdnEVDCg2/L6xhnOD97Cw8npnbaTp8RqMZn JA8YYO8avg63jiGH4juyCWglHNCRqAc4Zb5NfPQYZVSkRNaNu0IzFEfU0lR67ncl7YAA S8GQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=NI8zwlUHlxbOzHPKPgvbjV4fIdTHCSQ9VYLbc/tC3gs=; b=qhxtTLG+eOgYtXDHNrNPzXUk+sxdANhjqofgNOjtBxs6Ccz++5SZB8JONyT+GirrNM qERKnFDJFX9ha6zjk5ZQTRqKDibxxr3EqwI2/lt/auexdwDjshJ1EtfDZoaBXtOlys2V /Mfsrs5Ka6BPkT6Q4OkPGU2OPaA7hAInOW4cBvLfFi2NacJNoqVMRk1oMfx9VKR9Vh9+ 9Z7YoPaJsaOmVol3foYHjPWMhRnhfSIxoRIHwxY4sCvFqyZO5gPeSZEwkYt+vQmzSNrP MHjxoUv1/CBudlHWzuBVjcPfdg/Lm8szdsHUBZ5FMqyevr3uY/10qUni7who55CHJllo hbvA== X-Gm-Message-State: ANoB5plam5P1tQ2ktHOkp+ht7MJZfiRiTk/baNgxtegVFQTkan3fyL6Z NJIewrX9nQzfq8ZqknAFnjQ= X-Google-Smtp-Source: AA0mqf6SatKzBmhR1JVj6OKD5Y4/zCJD8HAyVesFdxvdPYEwtUOkHcFIghcd06NtztZaTLoWvthMfA== X-Received: by 2002:a17:903:26c7:b0:187:1d3:4620 with SMTP id jg7-20020a17090326c700b0018701d34620mr4943768plb.33.1668727077599; Thu, 17 Nov 2022 15:17:57 -0800 (PST) Received: from ?IPV6:2601:681:8600:13d0::f0a? ([2601:681:8600:13d0::f0a]) by smtp.gmail.com with ESMTPSA id u4-20020a17090341c400b001830ed575c3sm2001969ple.117.2022.11.17.15.17.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 17 Nov 2022 15:17:56 -0800 (PST) Message-ID: <17e5100f-4c71-5421-3051-5a571d31091a@gmail.com> Date: Thu, 17 Nov 2022 16:17:55 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Subject: Re: [PATCH 5/7] RISC-V: Recognize bexti in negated if-conversion Content-Language: en-US To: Philipp Tomsich , gcc-patches@gcc.gnu.org Cc: Vineet Gupta , Palmer Dabbelt , Christoph Muellner , Kito Cheng , Jeff Law References: <20221112212943.3068249-1-philipp.tomsich@vrull.eu> <20221112212943.3068249-6-philipp.tomsich@vrull.eu> From: Jeff Law In-Reply-To: <20221112212943.3068249-6-philipp.tomsich@vrull.eu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,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 11/12/22 14:29, Philipp Tomsich wrote: > While the positive case "if ((bits >> SHAMT) & 1)" for SHAMT 0..10 can > trigger conversion into efficient branchless sequences > - with Zbs (bexti + neg + and) > - with XVentanaCondOps (andi + vt.maskc) > the inverted/negated case results in > andi a5,a0,1024 > seqz a5,a5 > neg a5,a5 > and a5,a5,a1 > due to how the sequence presents to the combine pass. > > This adds an additional splitter to reassociate the polarity reversed > case into bexti + addi, if Zbs is present. > > Signed-off-by: Philipp Tomsich > > gcc/ChangeLog: > > * config/riscv/xventanacondops.md: Add split to reassociate > "andi + seqz + neg" into "bexti + addi". OK once we've cleared the non-technical hurdles to committing vendor specific extensions. Seeing the number of re association splitters that have been submitted and the fact that there's been a fair amount of commonality makes me wonder if we should instead be beefing up the generic split point code in combine.  Though IIRC that code may be strictly splitting without reassociation or rewriting..  Hmm, anyway, worth keeping in mind that we have some generic code to try and find good points to break down a complex insn into components that might be recognizable. jeff