Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
toxik
on Feb 2, 2022
|
parent
|
context
|
favorite
| on:
Singapore prime minister Lee Hsien Loong’s Sudoku ...
I think there’s an Intel intrinsic for this, but nonetheless neat.
Cthulhu_
on Feb 2, 2022
[–]
It's the kind of thing that I would expect a compiler to know about and use; when writing code in a high level language you shouldn't have to think too much about what happens on the hardware level.
xxs
on Feb 2, 2022
|
parent
[–]
It's done in Java, Integer.lowestOneBit(int), citing HD 2-1. Java defines ints to be 2-complimentary. I can't recall if it's compiled tzcnt[0], though
[0]:
https://www.felixcloutier.com/x86/tzcnt
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: