From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg1-x533.google.com (mail-pg1-x533.google.com [IPv6:2607:f8b0:4864:20::533]) by sourceware.org (Postfix) with ESMTPS id 663793858421 for ; Mon, 2 Jan 2023 17:38:31 +0000 (GMT) Received: by mail-pg1-x533.google.com with SMTP id b12so18678033pgj.6 for ; Mon, 02 Jan 2023 09:38:31 -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=G+7ttLo+wnBiVHBSk/Mzjy1GVZPaHt5qLuIHkhDm/3E=; b=Tov29L3rsmcxEo93wSl83tZbs3ecXi0g2Z5xirNPqJBarW6D5Vs2IWZvP02XDiPOMM B0KAIKD2wdr0ERIxmI+dPtr/GLIDk8f8513/XMZL5g9fTCZpFFLiiiXYOVBq1/xUPDDc 8ckdizBNFaAshscCAvTCRnbjhJAuqI2KlLV6YWBSLa3Rd5qafkgKr6oBH/GYrXHU3Spi yPQ3iGd3TmW+Y8rPXZXLA4+usC6tDJFu3gYORLyFCgvJWNjGrXcl6De7ovUnQS/nInXC /PHUlDzGK6k8thKzck881Xd1FuRt2jOgIEunDeGOloLkS+XZgXwaf+/h29/cy4PNeH4R 3ThQ== 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=G+7ttLo+wnBiVHBSk/Mzjy1GVZPaHt5qLuIHkhDm/3E=; b=E5fT670Vk358H0EUh5eMJnBAMjXKHYe2SmOFClCwbmmSAuOH53luLBkDoGQmp3ypvo CvyCi3gTvVIi4Qn7fR0yCJeIqZNAyHKdRm/puDnjUVVUpzhsV79/mJjVuLB49SZ4HL4V LGpFGHwIupIP6XILMonskdf3mpkSvuEvVy4rszk8DoAtliinmoB/TEfDi2EzwNxlAk2j pn46hmf5qkdV7m1Ia4+SnpJBM0mPg52siglBv3CB5wk+GQViTFudJYICnR7t8GqRQlo/ 26ePbFV9Fmh25IGjvBvaZr3KKF0j36xpfUvjHk+PbfDadmGWVV+UGFzOr5kgpfp2jpHq xZmg== X-Gm-Message-State: AFqh2koYFmkXqCkdPC1omG5Z8uP46F4Gf5IPhpHtt+s3gb3PmoPX57oi LcLiAWPx5F45gmmCs34VeWc= X-Google-Smtp-Source: AMrXdXtB25F8UGdJCt7pMp5Zl3G59Ty3lZTK4SSTV6UvUmo/Tznfwpsi0HgxcviX+9b1CjgDIxGOkQ== X-Received: by 2002:a62:6483:0:b0:577:7cfb:a896 with SMTP id y125-20020a626483000000b005777cfba896mr38131574pfb.31.1672681110140; Mon, 02 Jan 2023 09:38:30 -0800 (PST) Received: from ?IPV6:2601:681:8600:13d0::f0a? ([2601:681:8600:13d0::f0a]) by smtp.gmail.com with ESMTPSA id o131-20020a62cd89000000b005800cb7cbcasm4447402pfg.120.2023.01.02.09.38.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 02 Jan 2023 09:38:29 -0800 (PST) Message-ID: <83e0e930-222d-28f9-9e78-a8d8a11c8525@gmail.com> Date: Mon, 2 Jan 2023 10:38:28 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: Re: [PATCH] Fix RTL simplifications of FFS, POPCOUNT and PARITY. Content-Language: en-US To: Jakub Jelinek Cc: Roger Sayle , 'GCC Patches' , 'Segher Boessenkool' References: <002e01d91df9$79df2670$6d9d7350$@nextmovesoftware.com> <06fc4f7f-264c-7955-96a1-6e51be401818@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=-4.0 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 1/2/23 10:22, Jakub Jelinek wrote: > On Mon, Jan 02, 2023 at 09:20:33AM -0700, Jeff Law wrote: >>>> In fact Raphael and I were about to submit a patch which takes advantage of >>>> that capability to improve the code slightly for risc-v. >>> >>> Just use a pattern with zero_extend or sign_extend around it or subreg of >>> it? >> If it were only that easy ;( In the bowels of the simplifications the >> zero_extension turns into either a pair of shifts or an AND with a mask (I >> forget which offhand). I'm sure we *can* work around this in the target, >> but it'll be ugly. >> >> The documentation definitely needs to be updated. I looked at the whole >> family a few weeks ago and my recollection was they all need to be fixed >> (ffs, clrsb, clz, ctz, popcount & parity) if the defined semantics are that >> the input and output operand modes must match. > > When I look at the documentation of all the above, all of them have > "The mode of @var{x} must be @var{m} or @code{VOIDmode}." M is the mode on the insn (ie clzsi2). I don't see a reference to ^^ @var{x}. Weird. jeff