Author: Miguel A. Ballicora
Date: 09:01:07 01/22/02
Go up one level in this thread
On January 22, 2002 at 11:23:36, Leen Ammeraal wrote:
>I did an experiment with your function lowbit, adapting
>it (by using a union of both an __int64 and a
>struct of two ints, in view of 64 bit bitboards)
>but it was slightly slower (with very little difference)
>than the following assembly routine which you (Dann) also
>provided:
>
>__forceinline
>int FirstPiece(BITBOARD bits)
>{
>// Given is: bits != 0
>__asm {
>; 64-bit number to move into ECX:EBX, will never be zero!
> mov ecx,dword ptr [bits+4]
> mov ebx,dword ptr [bits]
> bsf eax,ecx
> add eax,32
> bsf eax,ebx
> }
>}
>
>So I think I will stick to this assembly function.
>Leen
Hi Leen,
I am a bit confused. You answer to Dann but you talk about the function lowbit()
I posted a function lowbit and Dann posted a macro LOWBIT (by L.Kirby).
Which one you say you tested and is slightly slower than the assembler version?
If the difference is not high, maybe the C version of (LOWBIT or lowbit or
whatever) could be optimized and or coded in assembler.
Regards,
Miguel
PS: did you test lowbit2?
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.