fls64(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… fls64(9) β€” the Kernel API Manual, but make it make sense

okay so bestie, quick vibe check: this is fls64, from the Kernel API Manual section 9 (iykyk, that's the kernel-internals girlies 🧚).


🌸 NAME 🌸

fls64 β€” find last set bit in a 64-bit word. that's the whole job. that's her main character energy. ✨


πŸŽ€ SYNOPSIS πŸŽ€

int fls64 (__u64 x );

πŸ’– ARGUMENTS πŸ’–

  • x β€” the word to search. like, the 64-bit word. the one you're hunting through πŸ•΅οΈβ€β™€οΈ

✨ DESCRIPTION ✨

okay so this is defined in a similar way as the libc and compiler builtin ffsll β€” same family, same bloodline πŸ’… 🫢 β€” but she returns the position of the most significant set bit instead. so not the first one, bestie, the last one. highkey a completely different girl.

fls64(value) returns 0 if value is 0 or the position of the last set bit if value is nonzero. yes, that's real, and yes, that's the whole contract. πŸ“

the last (most significant) bit is at position 64. sixty-four. the very top. the it-girl of the word πŸ”₯πŸ‘‘


πŸ¦‹ SEE ALSO πŸ¦‹

  • Kernel file ./tools/include/asm-generic/bitops/fls64.h β€” go read the source, she ate πŸ’…

so yeah, that's fls64. no cap, she's iconic. πŸ’œ

and a little sign-off to close the group chat: this was the Kernel API Manual for fls64(9), dropped in October 2026, straight from the source path ./tools/include/asm-generic/bi... (they truncated her name and honestly she deserved better 😭). mwah, bye bestie πŸ“πŸŒˆβ­

πŸ“¦ where this page comes from