mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-04 18:28:30 +00:00
Rename _bsr/_bsf to bsr/bsf
Now that these functions are behind _COSMO_SOURCE there's no reason for having the ugly underscore anymore. To use these functions, you need to pass -mcosmo to cosmocc.
This commit is contained in:
parent
a6baba1b07
commit
8bfd56b59e
53 changed files with 110 additions and 93 deletions
|
@ -23,7 +23,7 @@
|
|||
* Returns binary logarithm of 𝑥.
|
||||
*
|
||||
* ctz(𝑥) 31^clz(𝑥) clz(𝑥)
|
||||
* uint32 𝑥 _bsf(𝑥) tzcnt(𝑥) ffs(𝑥) _bsr(𝑥) lzcnt(𝑥)
|
||||
* uint32 𝑥 bsf(𝑥) tzcnt(𝑥) ffs(𝑥) bsr(𝑥) lzcnt(𝑥)
|
||||
* 0x00000000 wut 32 0 wut 32
|
||||
* 0x00000001 0 0 1 0 31
|
||||
* 0x80000001 0 0 1 31 0
|
||||
|
@ -36,7 +36,7 @@
|
|||
* @param x is a 32-bit integer
|
||||
* @return number in range 0..31 or undefined if 𝑥 is 0
|
||||
*/
|
||||
int(_bsr)(int x) {
|
||||
int(bsr)(int x) {
|
||||
int r = 0;
|
||||
if(x & 0xFFFF0000u) { x >>= 16; r |= 16; }
|
||||
if(x & 0xFF00) { x >>= 8; r |= 8; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue