Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
man ffs (die.net)
2 points by jzwinck on Sept 8, 2014 | hide | past | favorite | 1 comment


Today I discovered ffs(3) is part of glibc. It's a family member of the GCC extensions __builtin_clz(), _ctz(), and _ffs(), for finding the first set bit in a word (dword, qword, multiple widths exist). See: http://en.wikipedia.org/wiki/Find_first_set

These functions are useful because they can be mapped to a single instruction, BSF on x86.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: