From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10503 invoked by alias); 16 Jun 2011 13:06:01 -0000 Received: (qmail 10492 invoked by uid 22791); 16 Jun 2011 13:06:01 -0000 X-SWARE-Spam-Status: No, hits=-0.2 required=5.0 tests=AWL,BAYES_20,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_NONE,TW_LR,TW_RX X-Spam-Check-By: sourceware.org Received: from mo-p00-ob.rzone.de (HELO mo-p00-ob.rzone.de) (81.169.146.161) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 16 Jun 2011 13:05:43 +0000 X-RZG-AUTH: :LXoWVUeid/7A29J/hMvvT2k715jHQaJercGObUOFkj18odoYNahU4Q== X-RZG-CLASS-ID: mo00 Received: from [192.168.0.22] (business-188-111-022-002.static.arcor-ip.net [188.111.22.2]) by post.strato.de (jimi mo3) (RZmta 25.18) with ESMTPA id g013d3n5GBqDn7 ; Thu, 16 Jun 2011 15:05:42 +0200 (MEST) Message-ID: <4DF9FFA5.5010409@gjlay.de> Date: Thu, 16 Jun 2011 13:10:00 -0000 From: Georg-Johann Lay User-Agent: Thunderbird 2.0.0.24 (X11/20100302) MIME-Version: 1.0 To: Bernd Schmidt CC: GCC Patches Subject: Re: Add __builtin_clrsb, similar to clz/ctz References: <4DF9FA9A.8040505@codesourcery.com> In-Reply-To: <4DF9FA9A.8040505@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/msg01245.txt.bz2 Bernd Schmidt schrieb: > Several processors have a "count redundant sign bits" instruction: > > * SIGNBITS on Blackfin > * NORM on C6X > * SBC, apparently, on picochip > > and probably others. For example, for a value of 0 or -1, it returns 31, > while e.g. an input 0xc0000000 produces 1. > > Other compilers tend to define builtin functions called "norm" for this, > and the operation is used in some DSP benchmarks. The patch below adds a > __builtin_clrsb family of functions, similar to __builtin_clz. I'm open > to suggestions about the name; I don't particularly like "norm" but > maybe that's what users expect. Some call it cls "count leading signs". A clrxx reminds me rather of "clear xx". Johann > > Bernd >