libc: Implement popcount/popcountl/popcountll

specified here:
https://www.unix.com/man-page/netbsd/3/popcountll/

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao
2020-09-21 16:34:16 +08:00
committed by Brennan Ashton
parent 657d1c9fdc
commit ba3f12c93f
6 changed files with 173 additions and 2 deletions
+4
View File
@@ -89,6 +89,10 @@ int flsl(long j);
int flsll(long long j);
#endif
unsigned int popcount(unsigned int j);
unsigned int popcountl(unsigned long j);
unsigned int popcountll(unsigned long long j);
FAR char *index(FAR const char *s, int c);
FAR char *rindex(FAR const char *s, int c);