summaryrefslogtreecommitdiff
path: root/src/bitboard.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bitboard.c')
-rwxr-xr-xsrc/bitboard.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/bitboard.c b/src/bitboard.c
index ad45ea6..2832fdb 100755
--- a/src/bitboard.c
+++ b/src/bitboard.c
@@ -344,7 +344,11 @@ Return value:
**/
{
COOR c = ILLEGAL_COOR;
- ULONG uFirstBit = FirstBit(*pbb);
+ // FastFirstBit (chess.h): same bsf instruction as the extern
+ // FirstBit, but static inline -- no call/ret/arg-marshal overhead.
+ // Measured directly: ~7 cycles/call via the extern vs ~1-3 for the
+ // bare instruction (board_representation/EVAL.md section 9).
+ ULONG uFirstBit = FastFirstBit(*pbb);
ASSERT(uFirstBit == SlowFirstBit(*pbb));
if (0 != uFirstBit)
@@ -381,7 +385,9 @@ Return value:
**/
{
COOR c;
- ULONG uLastBit = LastBit(*pbb);
+ // FastLastBit (chess.h): same bsr instruction as the extern
+ // LastBit, but static inline -- no call/ret/arg-marshal overhead.
+ ULONG uLastBit = FastLastBit(*pbb);
ASSERT(SlowLastBit(*pbb) == uLastBit);
c = ILLEGAL_COOR;