mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-22 10:06:26 +08:00
Micro-optimize pop_lsb() for 64bit case
On Intel, perhaps due to 'lea' instruction this way of zeroing the lsb of *b seems faster than a shift+negate. On perft (where any speed difference is magnified) I got a 6% speed up on my Intel i5 64bit. Suggested by Hongzhi Cheng. No functional change.
This commit is contained in:
@@ -280,7 +280,7 @@ FORCE_INLINE Square msb(Bitboard b) {
|
|||||||
|
|
||||||
FORCE_INLINE Square pop_lsb(Bitboard* b) {
|
FORCE_INLINE Square pop_lsb(Bitboard* b) {
|
||||||
const Square s = lsb(*b);
|
const Square s = lsb(*b);
|
||||||
*b &= ~(1ULL << s);
|
*b &= *b - 1;
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user