1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-16 00:01:05 -08:00
emacs/lib
Paul Eggert 595e113b15 Improve support for popcount and counting trailing zeros.
Do this by using the Gnulib modules for this.
This should generate faster code on non-GCC, non-MSC platforms,
and make the code a bit more portable, at least in theory.
* admin/merge-gnulib (GNULIB_MODULES): Add count-one-bits
and count-trailing-zeros.
* lib/count-one-bits.c, lib/count-one-bits.h:
* lib/count-trailing-zeros.c, lib/count-trailing-zeros.h:
* m4/count-one-bits.m4, m4/count-trailing-zeros.m4:
New files, copied from gnulib.
* lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
* nt/gnulib.mk: Merge changes from lib/gnulib.mk.
* src/data.c: Include <count-one-bits.h>, <count-trailing-zeros.h>.
(USE_MSC_POPCOUNT, POPCOUNT_STATIC_INLINE)
(NEED_GENERIC_POPCOUNT, popcount_size_t_generic)
(popcount_size_t_msc, popcount_size_t_gcc):
Remove; now done by Gnulib.
(popcount_size_t): Now a macro that defers to Gnulib.
(count_trailing_zero_bits): Return int, for consistency with
Gnulib and because Emacs prefers signed to unsigned int.
Don't assume that size_t is either unsigned int or unsigned long
or unsigned long long.
(size_t_to_host_endian): Do not assume that size_t is either
exactly 32 or exactly 64 bits wide.
* src/lisp.h (BITS_PER_SIZE_T): Define consistently with BITS_PER_LONG
etc., so that it's now an enum constant, not a macro.
No need to assume that it's either 32 or 64.

Fixes: debbugs:15550
2013-10-07 14:37:19 -07:00
..
acl-errno-valid.c
acl-internal.h
acl.h
acl_entries.c
alloca.in.h
allocator.c
allocator.h
at-func.c
binary-io.c
binary-io.h
byteswap.in.h
c-ctype.c
c-ctype.h
c-strcase.h
c-strcasecmp.c
c-strncasecmp.c
careadlinkat.c
careadlinkat.h
close-stream.c
close-stream.h
COPYING
count-one-bits.c Improve support for popcount and counting trailing zeros. 2013-10-07 14:37:19 -07:00
count-one-bits.h Improve support for popcount and counting trailing zeros. 2013-10-07 14:37:19 -07:00
count-trailing-zeros.c Improve support for popcount and counting trailing zeros. 2013-10-07 14:37:19 -07:00
count-trailing-zeros.h Improve support for popcount and counting trailing zeros. 2013-10-07 14:37:19 -07:00
dirent.in.h
dosname.h
dtoastr.c
dtotimespec.c
dup2.c
errno.in.h
euidaccess.c
execinfo.c
execinfo.in.h
faccessat.c
fcntl.c
fcntl.in.h
fdatasync.c
fdopendir.c
file-has-acl.c
filemode.c
filemode.h
fpending.c
fpending.h
fstatat.c
fsync.c
ftoastr.c
ftoastr.h
getdtablesize.c
getgroups.c
getloadavg.c
getopt.c
getopt.in.h
getopt1.c
getopt_.h
getopt_int.h
gettext.h
gettime.c
gettimeofday.c
gnulib.mk Improve support for popcount and counting trailing zeros. 2013-10-07 14:37:19 -07:00
group-member.c
intprops.h
inttypes.in.h
lstat.c
Makefile.am
makefile.w32-in
md5.c
md5.h
memrchr.c
min-max.h
mkostemp.c
mktime-internal.h
mktime.c
openat-die.c
openat-priv.h
openat-proc.c
openat.h
pathmax.h
pipe2.c
pselect.c
pthread_sigmask.c
putenv.c
qcopy-acl.c
qset-acl.c
readlink.c
readlinkat.c
root-uid.h
save-cwd.c
save-cwd.h
secure_getenv.c
sha1.c
sha1.h
sha256.c
sha256.h
sha512.c
sha512.h
sig2str.c
sig2str.h
signal.in.h
stat-time.c
stat-time.h
stat.c
stdalign.in.h
stdarg.in.h
stdbool.in.h
stddef.in.h
stdint.in.h
stdio.in.h
stdlib.in.h
strftime.c
strftime.h
string.in.h
strtoimax.c
strtol.c
strtoll.c
strtoul.c
strtoull.c
strtoumax.c
symlink.c
sys_select.in.h
sys_stat.in.h
sys_time.in.h
sys_types.in.h
tempname.c
tempname.h
time.in.h
time_r.c
timespec-add.c
timespec-sub.c
timespec.c
timespec.h
u64.c
u64.h
unistd.c
unistd.in.h
unsetenv.c
utimens.c
utimens.h
verify.h
xalloc-oversized.h