From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by sourceware.org (Postfix) with ESMTPS id 17DAD3AA8CBE for ; Thu, 17 Nov 2022 14:43:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 17DAD3AA8CBE Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=vrull.eu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=vrull.eu Received: by mail-lf1-x129.google.com with SMTP id j4so3197425lfk.0 for ; Thu, 17 Nov 2022 06:43:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vrull.eu; s=google; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=eVHV1jQ59Oe1JMDWPFjufEMhcjHRiDBVOdHVho4SQTE=; b=YW7Q350AmO/gr3hrn2r5JV8vc47nEoLUW4DSNcfKsNT9mAkwRFk4uPCu6Izw8KQajY EaGzZ75n9pXpDksWL+X/Ikr39x6kImk0KYIb+YB/AFhl7YMY/5xAHvW90OvI7LrWwUK8 XepmrVnSMk/KX5yNpiqNLUGMmI0tX6zDJAzzx8cKRWgMFr22gTf3J1rX2hy7OLlqg+FU L7fizN2fRTyDj8uXnk84AbFcTcUtL6nOxFqFuvJarYMCJoRgfjc0pyMp/AUxCY9V9owN INkqOIB4Ktjl4tiFB/qnfS447+B0y914VfPgGqqyReMnit4dLfoadi1vPry127iP+Cq4 zeiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eVHV1jQ59Oe1JMDWPFjufEMhcjHRiDBVOdHVho4SQTE=; b=F/0924XrWVu7AYVlhQ15gp233tynmSzF23t0g3umgljxNDS21qxj+Qk6ZG9g+lqivk RHdyI8BNV5ZhqT9DU9oEfyocv8wN5MVr57vYnUNNnaJaXcesaRSRIfzdiyYIL1y0uSVF WoTp7FyRcbBQju8oBlht3BrUw50Wx9x/K2OhDHPrYvM/r5sKznco8jZQD9XuMnN7gY77 eBNb9oLPytaxnheaN3Nm9xBTHPGW8jxRcLFFN1dl1X9H83dHQ/9qjutWn5K4cFSC188i fJcEtAWX2mCyujTPzdUS9gGH6Y2/5PaXTX1dyFxvBaV1n282m7jWLsEohKQ18pI3l5HV f6yA== X-Gm-Message-State: ANoB5pmU7uYrtuDVP9SGCXWvfcS2p7EfCpxkSob0Y7NZrR8i2iMpQEFD bLiIoa/KHMp5Q9z7/utZzVua/iabYzEsNkorel3dXg== X-Google-Smtp-Source: AA0mqf5ZBs/1QBnVIQPi3+FQx6ra/sl90poGCI6T6DFG4mHrzUqHVhnKBcxbOYiRwpjysoQ+DlPMAOB7oR02bbepMCY= X-Received: by 2002:a05:6512:16a1:b0:4b1:4933:d0de with SMTP id bu33-20020a05651216a100b004b14933d0demr933897lfb.10.1668696193433; Thu, 17 Nov 2022 06:43:13 -0800 (PST) MIME-Version: 1.0 References: <20221110213617.3592572-1-philipp.tomsich@vrull.eu> <1d164b26-57b6-8c17-18cd-79e8dc77d29d@gmail.com> In-Reply-To: <1d164b26-57b6-8c17-18cd-79e8dc77d29d@gmail.com> From: Philipp Tomsich Date: Thu, 17 Nov 2022 15:43:01 +0100 Message-ID: Subject: Re: [PATCH] RISC-V: Optimize masking with two clear bits not a SMALL_OPERAND To: Jeff Law Cc: gcc-patches@gcc.gnu.org, Jeff Law , Palmer Dabbelt , Christoph Muellner , Kito Cheng , Vineet Gupta Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,JMQ_SPF_NEUTRAL,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no 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 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"? > HI/QI, mostly wanting to double check my understanding of the extension > constraints. QI will be fully covered by simm12 (e.g., using the andi instruction). For HI, we might in fact want to have a special case (similar to "*bclridisi_nottwobits") =E2=80=94 but the reach of the simm12 seems to cov= er enough of 16-bit space that this hasn't shown up (yet) as enough of a problem to warrant a special case. Philipp.