From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6611 invoked by alias); 27 Feb 2013 15:51:25 -0000 Received: (qmail 6571 invoked by uid 22791); 27 Feb 2013 15:51:24 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,TW_CL X-Spam-Check-By: sourceware.org Received: from unicorn.mansr.com (HELO unicorn.mansr.com) (78.86.181.103) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 27 Feb 2013 15:51:18 +0000 Received: by unicorn.mansr.com (Postfix, from userid 51770) id 831AF15600; Wed, 27 Feb 2013 15:51:17 +0000 (GMT) From: =?iso-8859-1?Q?M=E5ns_Rullg=E5rd?= To: Richard Henderson Cc: libc-ports@sourceware.org, Joseph Myers Subject: Re: [PATCH 19/26] arm: Add optimized ffs for armv6t2 References: <1361934986-17018-1-git-send-email-rth@twiddle.net> <1361934986-17018-20-git-send-email-rth@twiddle.net> Date: Wed, 27 Feb 2013 15:51:00 -0000 In-Reply-To: <1361934986-17018-20-git-send-email-rth@twiddle.net> (Richard Henderson's message of "Tue, 26 Feb 2013 19:16:19 -0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Mailing-List: contact libc-ports-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: libc-ports-owner@sourceware.org X-SW-Source: 2013-02/txt/msg00100.txt.bz2 Richard Henderson writes: > +ENTRY(__ffs) > + cmp r0, #0 > + ittt ne > + rbitne r0, r0 > + clzne r0, r0 > + addne r0, r0, #1 > + bx lr > +END(__ffs) Making the RBIT unconditional (bit-reverse of zero is still zero) is better since it reduces dependencies between instructions. Depending on microarchitecture details, this might save a cycle. --=20 M=E5ns Rullg=E5rd mans@mansr.com