From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27711 invoked by alias); 15 Jun 2011 11:07:16 -0000 Received: (qmail 27703 invoked by uid 22791); 15 Jun 2011 11:07:16 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_NONE,TW_CL X-Spam-Check-By: sourceware.org Received: from mo-p00-ob.rzone.de (HELO mo-p00-ob.rzone.de) (81.169.146.160) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 15 Jun 2011 11:07:02 +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 (cohen mo5) (RZmta 25.18) with ESMTPA id Y0182fn5FAJOHo ; Wed, 15 Jun 2011 13:03:09 +0200 (MEST) Message-ID: <4DF8916D.8010006@gjlay.de> Date: Wed, 15 Jun 2011 11:59:00 -0000 From: Georg-Johann Lay User-Agent: Thunderbird 2.0.0.24 (X11/20100302) MIME-Version: 1.0 To: Denis Chertykov CC: gcc-patches@gcc.gnu.org, "Eric B. Weddington" , Anatoly Sokolov , Ian Lance Taylor Subject: Re: [Patch, AVR]: PR49313, fix PR29524 References: <4DF87FAD.4090104@gjlay.de> In-Reply-To: Content-Type: text/plain; charset=UTF-8 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/msg01149.txt.bz2 Denis Chertykov schrieb: > 2011/6/15 Georg-Johann Lay : >> This is a patch that implements some libgcc functions in assembler. >> The functions are used only very seldom but if, they lead to an >> unpleasant waste of resource. For example, some SF functions >> eventually lead to __clz_tab being dragged in (PR29524). >> >> This patch avoids that by straight forward assembler implementation of >> functions that are easy to implement. >> >> Tested without regression. Moreover, I tested functions in some >> self-written code against the old C-implementation. HI/QI functions >> tested for all possible inputs. >> > > Approved for AVR. > May be you need another approval for longlong.h > > Denis. CCed Ian Taylor as libgcc maintainer (assuming this is his preferred address). Unfortunately, the original mail could not yet be delivered to gcc-patches; I got a message reading something like (backtranslated to en): Subject: [Patch, AVR]: PR49313, fix PR29524 Sender: avr@gjlay.de Attention: Mail could not be delivered since 1 hour. Following receiver is affected: gcc-patches@gcc.gnu.org Error : 452 4.0.0 Insufficient system storage Explanation: host gcc.gnu.org [209.132.180.131] said: Message denied temporarily Last try: Wednesday, 15. Juni 2011 12:47:22 +0200 (MEST) I never got such message, and the patch is not really big. As I cannot backlink to the original message :-( copy-pasteing the relevant change inline: -- gcc/ PR target/49313 PR target/29524 * longlong.h: Add AVR support: (count_leading_zeros): New macro. (count_trailing_zeros): New macro. (COUNT_LEADING_ZEROS_0): New macro. Index: gcc/longlong.h =================================================================== --- gcc/longlong.h (Revision 175036) +++ gcc/longlong.h (Arbeitskopie) @@ -250,6 +250,12 @@ UDItype __umulsidi3 (USItype, USItype); #define COUNT_LEADING_ZEROS_0 32 #endif +#if defined (__AVR__) && W_TYPE_SIZE == 32 +#define count_leading_zeros(COUNT,X) ((COUNT) = __builtin_clzl (X)) +#define count_trailing_zeros(COUNT,X) ((COUNT) = __builtin_ctzl (X)) +#define COUNT_LEADING_ZEROS_0 32 +#endif /* defined (__AVR__) && W_TYPE_SIZE == 32 */ + #if defined (__CRIS__) && __CRIS_arch_version >= 3 #define count_leading_zeros(COUNT, X) ((COUNT) = __builtin_clz (X)) #if __CRIS_arch_version >= 8