diff options
Diffstat (limited to 'src/chess.h')
| -rwxr-xr-x | src/chess.h | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/chess.h b/src/chess.h index 5c5bbf2..4bc3464 100755 --- a/src/chess.h +++ b/src/chess.h @@ -2894,18 +2894,29 @@ SlowGetAttacks(SEE_LIST *pList, POSITION *pos, COOR cSquare, ULONG uSide); -#ifdef CROUTINES -#define GetAttacks SlowGetAttacks -#endif -// board_representation/MIGRATION.md section 3: bbPieces-backed -// GetAttacks PoC -- not wired into the GetAttacks macro above yet. +// board_representation/MIGRATION.md section 3: bbPieces/bbPawns-backed +// GetAttacks primitive, verified correct (20,000-position sweep) and +// faster than asm GetAttacks (0.53-0.89x cycles/call across +// opening/middlegame/endgame -- see section 3's benchmark writeup). void CDECL _GetAttacksBB(SEE_LIST *pList, POSITION *pos, COOR cSquare, ULONG uSide); +// Three-way choice for which GetAttacks implementation is actually +// live -- see MIGRATION.md section 6: +// GETATTACKS_BITBOARD defined -> _GetAttacksBB (bitboard, new) +// else CROUTINES defined -> SlowGetAttacks (C mailbox) +// else (default) -> GetAttacks (asm x86/x64 mailbox, +// the literal function declared above) +#if defined(GETATTACKS_BITBOARD) +#define GetAttacks _GetAttacksBB +#elif defined(CROUTINES) +#define GetAttacks SlowGetAttacks +#endif + #ifdef _X86_ // // Note: this is most of the stuff that x86.asm assumes about the |
