mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 16:53:09 +00: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:
parent
e3b0327812
commit
94ecdef8ac
1 changed files with 1 additions and 1 deletions
|
@ -280,7 +280,7 @@ FORCE_INLINE Square msb(Bitboard b) {
|
|||
|
||||
FORCE_INLINE Square pop_lsb(Bitboard* b) {
|
||||
const Square s = lsb(*b);
|
||||
*b &= ~(1ULL << s);
|
||||
*b &= *b - 1;
|
||||
return s;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue