From: "Laurent Desnogues" <laurent.desnogues@gmail.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [5592] target-ppc: optimize popcntb
Date: Sat, 1 Nov 2008 15:34:53 +0100 [thread overview]
Message-ID: <761ea48b0811010734s5d85f731v878752ee5af74673@mail.gmail.com> (raw)
In-Reply-To: <fb249edb0811010657m34bd144di43cb221f417e6dbb@mail.gmail.com>
On Sat, Nov 1, 2008 at 2:57 PM, andrzej zaborowski <balrogg@gmail.com> 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
prev parent reply other threads:[~2008-11-01 14:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-01 0:54 [Qemu-devel] [5592] target-ppc: optimize popcntb Aurelien Jarno
2008-11-01 12:29 ` Laurent Desnogues
2008-11-01 12:35 ` Laurent Desnogues
2008-11-01 13:57 ` andrzej zaborowski
2008-11-01 14:34 ` Laurent Desnogues [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=761ea48b0811010734s5d85f731v878752ee5af74673@mail.gmail.com \
--to=laurent.desnogues@gmail.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).