Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introducing lsb_bb() #3391

Closed
wants to merge 2 commits into from
Closed

Conversation

BM123499
Copy link
Contributor

@BM123499 BM123499 commented Mar 13, 2021

Introducing lsb_bb. It's a function that return a value equal square_bb(lsb(bb)), but it uses fewer instruction. It should speed up more on older processors like armv7-a Clang.

Passed STC:
LLR: 2.93 (-2.94,2.94) {-0.25,1.25}
Total: 213200 W: 19171 L: 18753 D: 175276
Ptnml(0-2): 680, 14513, 75831, 14861, 715
https://tests.stockfishchess.org/tests/view/604bc7632433018de7a38982

No functional change

@BM123499
Copy link
Contributor Author

BM123499 commented Mar 15, 2021

If b & -b is not too reader-friendly, it can be rewritten into b & ~(b - 1) or b & (~b + 1). The compilers I tested make no different instruction on all 3 variant with -O3 flag.

@snicolet snicolet closed this in 9393957 Mar 16, 2021
@snicolet
Copy link
Member

merged via 9393957, thanks!

@snicolet snicolet added the to be merged Will be merged shortly label Mar 16, 2021
MichaelB7 pushed a commit to MichaelB7/Stockfish that referenced this pull request Apr 13, 2021
Introducing least_significant_square_bb(). It is a function that returns a value equal
to square_bb(lsb(bb)), but it uses fewer instruction. It should speed up more on older
processors like armv7-a Clang.

Passed STC:
LLR: 2.93 (-2.94,2.94) {-0.25,1.25}
Total: 213200 W: 19171 L: 18753 D: 175276
Ptnml(0-2): 680, 14513, 75831, 14861, 715
https://tests.stockfishchess.org/tests/view/604bc7632433018de7a38982

Closes official-stockfish#3391

No functional change
joergoster pushed a commit to joergoster/Stockfish-old that referenced this pull request May 7, 2021
Introducing least_significant_square_bb(). It is a function that returns a value equal
to square_bb(lsb(bb)), but it uses fewer instruction. It should speed up more on older
processors like armv7-a Clang.

Passed STC:
LLR: 2.93 (-2.94,2.94) {-0.25,1.25}
Total: 213200 W: 19171 L: 18753 D: 175276
Ptnml(0-2): 680, 14513, 75831, 14861, 715
https://tests.stockfishchess.org/tests/view/604bc7632433018de7a38982

Closes official-stockfish/Stockfish#3391

No functional change
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
to be merged Will be merged shortly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants