emacs/m4
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
..
00gnulib.m4 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
acl.m4 Use Gnulib ACL implementation, for benefit of Solaris etc. 2013-05-07 14:34:03 -07:00
alloca.m4 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
byteswap.m4 Use hardware support for byteswapping on glibc x86 etc. 2013-10-04 00:36:22 -07:00
c-strtod.m4 Merge from gnulib. 2013-01-02 08:37:04 -08:00
clock_time.m4 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
close-stream.m4 Merge from gnulib. 2013-01-02 08:37:04 -08:00
count-one-bits.m4 Improve support for popcount and counting trailing zeros. 2013-10-07 14:37:19 -07:00
count-trailing-zeros.m4 Improve support for popcount and counting trailing zeros. 2013-10-07 14:37:19 -07:00
dirent_h.m4 Use fdopendir, fstatat and readlinkat, for efficiency. 2013-01-31 22:30:51 -08:00
dup2.m4 Merge from gnulib. 2013-10-03 00:06:52 -07:00
environ.m4 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
errno_h.m4 Use Gnulib ACL implementation, for benefit of Solaris etc. 2013-05-07 14:34:03 -07:00
euidaccess.m4 Merge from gnulib. 2013-01-02 08:37:04 -08:00
execinfo.m4 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
extensions.m4 Comment fix, to match Gnulib upstream copy. 2013-05-07 14:04:51 -07:00
extern-inline.m4 Merge from gnulib. 2013-09-19 14:40:08 -07:00
faccessat.m4 Merge from gnulib. 2013-01-02 08:37:04 -08:00
fcntl.m4 Make file descriptors close-on-exec when possible. 2013-07-07 11:00:14 -07:00
fcntl_h.m4 Merge from gnulib. 2013-01-02 08:37:04 -08:00
fdatasync.m4 File synchronization fixes. 2013-03-13 11:42:22 -07:00
fdopendir.m4 Use fdopendir, fstatat and readlinkat, for efficiency. 2013-01-31 22:30:51 -08:00
filemode.m4 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
fpending.m4 Merge from gnulib. 2013-08-11 17:52:17 -07:00
fstatat.m4 Use fdopendir, fstatat and readlinkat, for efficiency. 2013-01-31 22:30:51 -08:00
fsync.m4 File synchronization fixes. 2013-03-13 11:42:22 -07:00
getdtablesize.m4 Merge from gnulib. 2013-10-03 00:06:52 -07:00
getgroups.m4 Merge from gnulib. 2013-01-02 08:37:04 -08:00
getloadavg.m4 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
getopt.m4 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
gettime.m4 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
gettimeofday.m4 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
gnulib-common.m4 Merge from gnulib. 2013-01-02 08:37:04 -08:00
gnulib-comp.m4 Improve support for popcount and counting trailing zeros. 2013-10-07 14:37:19 -07:00
gnulib-tool.m4 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
group-member.m4 Merge from gnulib. 2013-01-02 08:37:04 -08:00
include_next.m4 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
inttypes.m4 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
largefile.m4 Merge from gnulib. 2013-01-16 09:45:39 -08:00
longlong.m4 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
lstat.m4 Merge from gnulib. 2013-01-02 08:37:04 -08:00
manywarnings.m4 Merge from gnulib. 2013-09-24 20:44:34 -07:00
md5.m4 Merge from gnulib. 2013-01-02 08:37:04 -08:00
memrchr.m4 Tune by using memchr and memrchr. 2013-02-11 15:37:18 -08:00
mkostemp.m4 Fix some minor races in hosts lacking mkostemp. 2013-08-04 09:56:56 -07:00
mktime.m4 Merge from gnulib. 2013-03-12 17:38:42 -07:00
multiarch.m4 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
nocrash.m4 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
off_t.m4 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
pathmax.m4 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
pipe2.m4 Make file descriptors close-on-exec when possible. 2013-07-07 11:00:14 -07:00
pselect.m4 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
pthread_sigmask.m4 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
putenv.m4 Merge from gnulib: putenv: port to Solaris 10. 2013-03-13 00:15:17 -07:00
readlink.m4 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
readlinkat.m4 Use fdopendir, fstatat and readlinkat, for efficiency. 2013-01-31 22:30:51 -08:00
secure_getenv.m4 Fix some minor races in hosts lacking mkostemp. 2013-08-04 09:56:56 -07:00
setenv.m4 Merge from gnulib. 2013-01-02 08:37:04 -08:00
sha1.m4 Merge from gnulib. 2013-01-02 08:37:04 -08:00
sha256.m4 Minor merge from gnulib (mostly just for texinfo.tex). 2013-08-26 15:17:31 -07:00
sha512.m4 Minor merge from gnulib (mostly just for texinfo.tex). 2013-08-26 15:17:31 -07:00
sig2str.m4 Merge from gnulib. 2013-01-02 08:37:04 -08:00
signal_h.m4 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
socklen.m4 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
ssize_t.m4 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
st_dm_mode.m4 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
stat-time.m4 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
stat.m4 Merge from gnulib. 2013-01-02 08:37:04 -08:00
stdalign.m4 Try to fix FreeBSD 9.1 porting problem. 2013-07-07 23:15:38 -07:00
stdarg.m4 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
stdbool.m4 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
stddef_h.m4 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
stdint.m4 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
stdio_h.m4 Merge from gnulib. 2013-01-02 08:37:04 -08:00
stdlib_h.m4 Merge from gnulib. 2013-02-08 15:37:17 -08:00
strftime.m4 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
string_h.m4 Tune by using memchr and memrchr. 2013-02-11 15:37:18 -08:00
strtoimax.m4 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
strtoll.m4 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
strtoull.m4 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
strtoumax.m4 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
symlink.m4 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
sys_select_h.m4 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
sys_socket_h.m4 Merge from gnulib. 2013-01-02 08:37:04 -08:00
sys_stat_h.m4 Merge from gnulib. 2013-01-02 08:37:04 -08:00
sys_time_h.m4 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
sys_types_h.m4 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
tempname.m4 Fix some minor races in hosts lacking mkostemp. 2013-08-04 09:56:56 -07:00
time_h.m4 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
time_r.m4 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
timer_time.m4 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
timespec.m4 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
tm_gmtoff.m4 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
unistd_h.m4 Merge from gnulib. 2013-10-03 00:06:52 -07:00
utimbuf.m4 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
utimens.m4 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
utimes.m4 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00
warnings.m4 Merge from gnulib. 2013-09-24 20:44:34 -07:00
wchar_t.m4 Update copyright notices for 2013. 2013-01-01 09:11:05 +00:00