From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x62a.google.com (mail-pl1-x62a.google.com [IPv6:2607:f8b0:4864:20::62a]) by sourceware.org (Postfix) with ESMTPS id B08B83AA803E for ; Thu, 17 Nov 2022 14:53:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B08B83AA803E 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-x62a.google.com with SMTP id y10so643016plp.3 for ; Thu, 17 Nov 2022 06:53:11 -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=vZiUkLyeNpXH34yHqBFAbHxvs7lTRhSr9xbOGIr7Dug=; b=bl3WSTZye8WiIxuRemS73UKhCq/6LbkjWX/aC79IC7JPmOE9teQQQHQTa4lg/mWA3m JHONVGhS5rTWDNnZ/UngxofzL0AUuWY4rkymaixoYDVCuwmEg+OyNmUqdJ3w6zZa0N0E mEGv1Ri3ulGcXFJw+rA87kSAztqsl2wTuAW/Y9uCPSui3noK4jNi42dWxo+7ggEe5QZ5 uNIUV834Y8W4915rVtXwOQqbgxe3xyeYjXnVKGZfz4u4o19+9rRGTUV/9Jw4Vgurxkgq Iu0JPsHkHvBqIkg5hI8H/LSAjbiWFRdogazefUVa49PO1nsrbHHAW3Jj0yBJqBKgluRu VGJQ== 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=vZiUkLyeNpXH34yHqBFAbHxvs7lTRhSr9xbOGIr7Dug=; b=dAUZ7gP4WgvFkP2oAATxxRVsdrgDNHujw2CYcmD7yfoycqTh+ooFU6UkbOIyel673m 0MrklPrc4r5FxugTaMowKjvHZMB3g16Qmo1Ao1dzs8RaGQl37Fw8qYinEIrMjL/K0qJe 0/uTru55SQhHnlwtmCfjBqSRZHXvjM/4H0XSiaQwEBsS2JyZ0cu2cpcVV0Kypf+2IT9b pelemLBZ1FvUrxA6NEzZDVnJvD8Gm8Oc/kebsRJRbL7wSyd/Nh5koP5VYW5bzvEOaydW NbYif9Vs+c0qT5lafNKo2nXrhhFoy+u3hwgVJpEBK8h6Nedk+CM8dbQ/DnRon5EOJMII 7u+g== X-Gm-Message-State: ANoB5pncJVaJhzwiA8nOs60h20yZMwDIJVXoZaE4qDbfeA6gCD3NMJWv tiD0OXD+6h5zLnNJD1TEHnM= X-Google-Smtp-Source: AA0mqf6gXJxQgragS0LiAc7iDsoWMBDcg19z/szawDrU1SWEgkEJbAXBmKGbqwb86xfA4BCqJJsr6A== X-Received: by 2002:a17:902:b707:b0:188:584d:b6d4 with SMTP id d7-20020a170902b70700b00188584db6d4mr2899608pls.170.1668696790568; Thu, 17 Nov 2022 06:53:10 -0800 (PST) Received: from ?IPV6:2601:681:8600:13d0::f0a? ([2601:681:8600:13d0::f0a]) by smtp.gmail.com with ESMTPSA id z24-20020aa79498000000b0056281da3bcbsm1251303pfk.149.2022.11.17.06.53.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 17 Nov 2022 06:53:09 -0800 (PST) Message-ID: <61be3eab-68b0-67d0-262a-32106971ad32@gmail.com> Date: Thu, 17 Nov 2022 07:53:07 -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] RISC-V: Optimize masking with two clear bits not a SMALL_OPERAND Content-Language: en-US To: Philipp Tomsich Cc: gcc-patches@gcc.gnu.org, Jeff Law , Palmer Dabbelt , Christoph Muellner , Kito Cheng , Vineet Gupta References: <20221110213617.3592572-1-philipp.tomsich@vrull.eu> <1d164b26-57b6-8c17-18cd-79e8dc77d29d@gmail.com> From: Jeff Law In-Reply-To: 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,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 11/17/22 07:43, Philipp Tomsich wrote: > On Thu, 17 Nov 2022 at 15:30, Jeff Law wrote: >> >> On 11/10/22 14:36, Philipp Tomsich wrote: >>> Add a split for cases where we can use two bclri (or one bclri and an >>> andi) to clear two bits. >>> >>> gcc/ChangeLog: >>> >>> * config/riscv/bitmanip.md (*bclri_nottwobits): New pattern. >>> (*bclridisi_nottwobits): New pattern, handling the sign-bit. >>> * config/riscv/predicates.md (const_nottwobits_operand): >>> New predicate. >>> >>> gcc/testsuite/ChangeLog: >>> >>> * gcc.target/riscv/zbs-bclri.c: New test. >> Don't we only have to worry about (subreg:DI (reg:SI )) to preserve the >> extension constraints? Not that I think there's any value in allowing > That is the reason for the !paradoxical_subreg_p(...) check in > "bclri_nottwobits"... so at pattern will always be safe. > > Do you see a risk on the "*bclridisi_nottwobits"? It's jut a sanity check for me, I don't have any concerns since you're avoiding this when working on a paradoxical.  But it does make me wonder if we need a paradoxical check on the other bit twiddles patterns to prevent them from changing the SImode sign bit in a paradoxical. Jeff