[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [5592] target-ppc: optimize popcntb
From: |
Laurent Desnogues |
Subject: |
Re: [Qemu-devel] [5592] target-ppc: optimize popcntb |
Date: |
Sat, 1 Nov 2008 15:34:53 +0100 |
On Sat, Nov 1, 2008 at 2:57 PM, andrzej zaborowski <address@hidden> wrote:
>
> 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.
Bit tricks are always very sensitive. BTW I would not trust any
benchmark that run them in loop for obvious reasons :-)
For those who like that kind of thing, here are some nice refs:
- Knuth: http://www-cs-faculty.stanford.edu/~uno/fasc1a.ps.gz
- Anderson: http://www-graphics.stanford.edu/~seander/bithacks.html
- Arndt: http://www.jjj.de/bitwizardry/bitwizardrypage.html
Many of these tricks are known or obvious, but it's good reading
anyway, especially for qemu target and back-end writers.
Laurent