From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28269 invoked by alias); 16 Jun 2011 13:17:53 -0000 Received: (qmail 28258 invoked by uid 22791); 16 Jun 2011 13:17:52 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 16 Jun 2011 13:17:29 +0000 Received: (qmail 2129 invoked from network); 16 Jun 2011 13:17:28 -0000 Received: from unknown (HELO ?84.152.178.189?) (bernds@127.0.0.2) by mail.codesourcery.com with ESMTPA; 16 Jun 2011 13:17:28 -0000 Message-ID: <4DFA0260.8060605@codesourcery.com> Date: Thu, 16 Jun 2011 13:59:00 -0000 From: Bernd Schmidt User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110516 Lightning/1.0b3pre Thunderbird/3.1.10 MIME-Version: 1.0 To: Laurent Desnogues CC: GCC Patches Subject: Re: Add __builtin_clrsb, similar to clz/ctz References: <4DF9FA9A.8040505@codesourcery.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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/msg01248.txt.bz2 On 06/16/2011 03:10 PM, Laurent Desnogues wrote: > On Thu, Jun 16, 2011 at 2:44 PM, Bernd Schmidt wrote: >> Several processors have a "count redundant sign bits" instruction: >> >> * SIGNBITS on Blackfin >> * NORM on C6X >> * SBC, apparently, on picochip > > picoChip defines __builtin_sbc. Wouldn't that make it redundant > with your __builtin_clrsb? Yes. But the fact that many processors support the same operation suggests we shouldn't add a builtin function to every backend, but rather provide it as a general feature. > I'm not sure I like clrsb. The trailing 'b' looks superfluous if you > compare to clz. And clr looks too much like clear :-) Well, you would say "leading zeros" but not "leading signs". OTOH "leading" is redundant when talking about sign bits, so maybe "crsb"? I don't really care as long as the patch is otherwise approved :) Bernd