chess:programming:msb_most_significant_bit
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
chess:programming:msb_most_significant_bit [2021/10/30 12:28] – peter | chess:programming:msb_most_significant_bit [2021/10/30 12:29] (current) – [Using Built-in for GCC] peter | ||
---|---|---|---|
Line 41: | Line 41: | ||
<code cpp> | <code cpp> | ||
- | + | unsigned BSR64(uint64_t x) | |
- | unsigned BSR64(uint64_t x) { | + | { |
return 63-__builtin_clzll(x); | return 63-__builtin_clzll(x); | ||
} | } | ||
- | |||
</ | </ | ||
Line 56: | Line 55: | ||
- | * *< | + | * The returned value is undefined for 0 inputs. |
- | * See https:// | + | * See https:// |
</ | </ |
chess/programming/msb_most_significant_bit.1635596885.txt.gz · Last modified: 2021/10/30 12:28 by peter