Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Bitscanning on the Opteron

Author: Gerd Isenberg

Date: 02:37:18 12/05/03

Go up one level in this thread


On December 05, 2003 at 00:22:11, Russell Reagan wrote:

>I found an old piece of code I had written to test the speed of a few
>bitscanning routines (ex. FirstOne() in Crafty). I was curious how different
>they would run on a 64-bit machine, so I sent them to Dr. Hyatt and he was kind
>enough to run them for me on the Opteron. Thanks Bob ;-)

<snip>

>
>Here are some short descriptions of the different bitscans:
>
>magic bitscan
>Created by (I think) Matt Taylor, or maybe it was Gerd Isenburg. It uses de
>Bruijn sequences (in the form of a "magic" number). Really cool.

Hi Russell,

No, seems that Matt Taylor did a kind of reinvention:

Using de Bruijn Sequences to Index a 1 in a Computer Word

Charles E.Leiserso
Harald Prokop
Keith H, Randall

MIT Laboratory for Computer Science, Cambridge, MA 02139, USA
July 7, 1998

>
>table 16
>I got this one from Dann Corbit, who (I think) got it from Beowulf. It uses a
>16-bit lookup table, which kind of makes me cringe on a machine with a small
>amount of cache, but the Opteron has 1 MB of L2 so maybe we can live with it.
>
>gerd
>I got this one from (I think) Gerd Isenburg, or maybe it was Matt Taylor. It
>uses the same magic number concept, but in a way that is intended to be more
>32-bit friendly, so it is not suprising that it is slower than the magic bitscan
>on 64-bit hardware.

Honor to honor is due - definitely Matt Taylor.
He invents the magic folding trick for the 32-bit
de Bruijn multiplication!
So please call the routine matt ;-)

Cheers,
Gerd






This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.