I'm using Visual Studio 2008 and my 64-bit version of LittleThought is far slower than my 32-bit version. The culprit seems to be the intrinsic functions I use in VS. The 32-bit LSB function uses 2 x inline assembler 32-bit scans and the 64-bit LSB function has to use an intrinsic due to limitations with the VS 64-bit compiler (cant use inline asm). To my surprise instead of being faster, the intrinsic is about half the speed of the inline asm:
Code: Select all
__forceinline unsigned long LSB64(BitBoard b) {
unsigned long pos;
ASSERT(b);
_BitScanForward64(&pos,b);
return pos;
}
__forceinline unsigned int LSB(BitBoard b) {
// Assumes b is not zero.
ASSERT(b);
__asm
{
bsf eax,[b+4]
xor eax,32
bsf eax,[b]
}
}
Cheers,
- Nathan