From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7882 invoked by alias); 20 Jun 2011 20:12:28 -0000 Received: (qmail 7854 invoked by uid 22791); 20 Jun 2011 20:12:19 -0000 X-SWARE-Spam-Status: No, hits=-6.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 20 Jun 2011 20:12:00 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p5KKBpwu002961 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 20 Jun 2011 16:11:51 -0400 Received: from pebble.twiddle.home (vpn-239-71.phx2.redhat.com [10.3.239.71]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p5KKBoxh013644; Mon, 20 Jun 2011 16:11:50 -0400 Message-ID: <4DFFA971.4070206@redhat.com> Date: Mon, 20 Jun 2011 20:48:00 -0000 From: Richard Henderson User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Thunderbird/3.1.10 MIME-Version: 1.0 To: Bernd Schmidt CC: GCC Patches Subject: Re: Add __builtin_clrsb, similar to clz/ctz References: <4DF9FA9A.8040505@codesourcery.com> <4DFA2E85.2030601@redhat.com> <4DFFA1AE.7070405@codesourcery.com> In-Reply-To: <4DFFA1AE.7070405@codesourcery.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-06/txt/msg01528.txt.bz2 On 06/20/2011 12:38 PM, Bernd Schmidt wrote: > D'oh. Blackfin has a (clrsb:HI (operand:SI)) instruction, so adding this > showed a problem with some of the existing simplify_const_unop cases: > for ffs/clz/ctz/clrsb/parity/popcount, we should look at the mode of the > operand, rather than the mode of the operation. This limits what we can > do in that function, since op_mode is sometimes VOIDmode - we really > should add builtin folders for these at some point. > > New patch below. Retested on i686 and bfin. > Ok. I'm not going to bike-shed the function name. If, at some point before 4.7 is released we agree on another name, we can change it. r~