Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Bitboard question

Author: J. Wesley Cleveland

Date: 16:52:03 12/05/98

Go up one level in this thread


On December 03, 1998 at 17:58:06, Andrew Dados wrote:

>
>On December 03, 1998 at 13:34:31, Inmann Werner wrote:
>
>>Thanks a lot Robert and Peter!
>>
>>It is what I need, and i am on the right path.
>>
>>But-
>>are prozessors really as silly, not to have a simple code (in the prozessor)
>>doing the bit testing?
>>
>>Werner
>
>   All 32-bit Intel processors (and compatibles) since 386 have BSF/BSR
>instructions made just this sort of bit testing/setting/resetting. For example
>this assembler sequence:
>
>mov ecx,32
>bsf eax,ecx
>jz @@nobits
>
>will give you number of first set bit in eax (5 in this case). Zero flag will be
>set if no set bits
>were present. BSR additionally resets first found bit.
>
>  Andrew

Unfortunately, these instructions are slower than an equivalent loop of
"RISC-like" instructions.



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.