mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-08 14:20:07 +00:00
Minor optimization of popcount in l10nflist
This commit is contained in:
parent
89edf2e911
commit
8e999d2962
@ -1,5 +1,8 @@
|
||||
2011-08-11 Ulrich Drepper <drepper@gmail.com>
|
||||
|
||||
* intl/l10nflist.c: Allow architecture-specific pop function.
|
||||
* sysdeps/x86_64/l10nflist.c: New file.
|
||||
|
||||
* intl/l10nflist.c (_nl_make_l10nflist): Use locale-independent
|
||||
classification.
|
||||
|
||||
|
@ -150,6 +150,7 @@ argz_next__ (argz, argz_len, entry)
|
||||
|
||||
|
||||
/* Return number of bits set in X. */
|
||||
#ifndef ARCH_POP
|
||||
static int pop PARAMS ((int x));
|
||||
|
||||
static inline int
|
||||
@ -164,6 +165,7 @@ pop (x)
|
||||
|
||||
return x;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
struct loaded_l10nfile *
|
||||
|
13
sysdeps/x86_64/l10nflist.c
Normal file
13
sysdeps/x86_64/l10nflist.c
Normal file
@ -0,0 +1,13 @@
|
||||
#ifdef __POPCNT__
|
||||
# include <popcntintrin.h>
|
||||
|
||||
static inline unsigned int
|
||||
pop (unsigned int x)
|
||||
{
|
||||
return _mm_popcnt_u32 (x);
|
||||
}
|
||||
# define ARCH_POP 1
|
||||
|
||||
#endif
|
||||
|
||||
#include <intl/l10nflist.c>
|
Loading…
Reference in New Issue
Block a user