Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Begging for assembler FirstOne() and LastOne()

Author: Matthias Gemuh

Date: 05:35:32 05/19/02

Go up one level in this thread


On May 19, 2002 at 06:50:35, Gerd Isenberg wrote:

>This one don't need conditional jumps:
>
>// precondition: bb not null
>__forceinline unsigned int BitSearch(BitBoard bb)
>{
>	__asm
>	{
>		bsf		eax,[bb+4]
>		xor		eax, 32
>		bsf		eax,[bb]
>	}
>}
>
>__forceinline unsigned int BitSearchReverse(BitBoard bb)
>{
>	__asm
>	{
>		bsr		eax,[bb]
>		bsr		eax,[bb+4]
>		setnz	dl
>		shl		dl, 5
>		add		al, dl
>	}
>}
>
>Gerd



Thanks, Gerd.
These also work fine.
I shall match the functions against their C versions and see by how much
assembler wins the race. I hope my engine will no go from 70 kn/s to 700 kn/s
:-).

Matthias.










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.