X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fbitbase.cpp;h=fdfb207ba3be86d786b849af9b126e15513674bb;hp=ceb94a0f9ef002f7c5bcc6218c8bf5a09df47b7a;hb=7c1f8dbde93267c7958a4de5e167a43e38c9e1e9;hpb=0ecc920a09f479cb9b568716597e0756da557174 diff --git a/src/bitbase.cpp b/src/bitbase.cpp index ceb94a0f..fdfb207b 100644 --- a/src/bitbase.cpp +++ b/src/bitbase.cpp @@ -62,14 +62,14 @@ namespace { } -uint32_t probe_kpk_bitbase(Square wksq, Square wpsq, Square bksq, Color stm) { +uint32_t Bitbases::probe_kpk(Square wksq, Square wpsq, Square bksq, Color stm) { int idx = index(wksq, bksq, wpsq, stm); return KPKBitbase[idx / 32] & (1 << (idx & 31)); } -void kpk_bitbase_init() { +void Bitbases::init_kpk() { Result db[IndexMax]; KPKPosition pos; @@ -117,7 +117,7 @@ namespace { stm = Color(idx & 1); bksq = Square((idx >> 1) & 63); wksq = Square((idx >> 7) & 63); - psq = make_square(File((idx >> 13) & 3), Rank((idx >> 15) + 1)); + psq = File((idx >> 13) & 3) | Rank((idx >> 15) + 1); } Result KPKPosition::classify_leaf(int idx) { @@ -196,8 +196,8 @@ namespace { while (b) { - r |= Us == WHITE ? db[index(pop_1st_bit(&b), bksq, psq, BLACK)] - : db[index(wksq, pop_1st_bit(&b), psq, WHITE)]; + r |= Us == WHITE ? db[index(pop_lsb(&b), bksq, psq, BLACK)] + : db[index(wksq, pop_lsb(&b), psq, WHITE)]; if (Us == WHITE && (r & WIN)) return WIN;