From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KwGyz-0004Me-2T for qemu-devel@nongnu.org; Sat, 01 Nov 2008 09:57:41 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KwGyx-0004LI-26 for qemu-devel@nongnu.org; Sat, 01 Nov 2008 09:57:40 -0400 Received: from [199.232.76.173] (port=53232 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KwGyw-0004LB-Tv for qemu-devel@nongnu.org; Sat, 01 Nov 2008 09:57:38 -0400 Received: from rv-out-0708.google.com ([209.85.198.240]:26582) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KwGyw-0008Af-NN for qemu-devel@nongnu.org; Sat, 01 Nov 2008 09:57:38 -0400 Received: by rv-out-0708.google.com with SMTP id f25so1573938rvb.22 for ; Sat, 01 Nov 2008 06:57:36 -0700 (PDT) Message-ID: Date: Sat, 1 Nov 2008 14:57:36 +0100 From: "andrzej zaborowski" Subject: Re: [Qemu-devel] [5592] target-ppc: optimize popcntb In-Reply-To: <761ea48b0811010535t51088dd5n8362b0b34db48a0@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <761ea48b0811010529w50904850h41028a811609fefc@mail.gmail.com> <761ea48b0811010535t51088dd5n8362b0b34db48a0@mail.gmail.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 2008/11/1 Laurent Desnogues : > On Sat, Nov 1, 2008 at 1:29 PM, Laurent Desnogues > wrote: >> >> Wouldn't it make sense to use builtin's as is done in host-utils.h? > > Forget that, I thought it was traditional bit counting. On ppc host there might be a builtin for it, on the x86 Xeon cpus with SSE4 there's also a bitcounting instruction but this approach is actually faster than transferring the number to the MMX register, running the instruction and copying the value back. In the benchmarks I've seen the speed is comparable with table lookup on x86 and -O3. Cheers