Computer Chess Club Archives


Search

Terms

Messages

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

Author: Gerd Isenberg

Date: 03:50:35 05/19/02

Go up one level in this thread


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



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.