Use hardware support for byteswapping on glibc x86 etc.
commit4eed3157327f8406921658442a11af7e9d84d603
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 4 Oct 2013 07:36:22 +0000 (4 00:36 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 4 Oct 2013 07:36:22 +0000 (4 00:36 -0700)
treee727a3017628ce840707d71998d4f6423a8fbde3
parent157fec2e190a84345138a0cc69e35f177c4d4a56
Use hardware support for byteswapping on glibc x86 etc.

On Fedora 19 x86-64, the new bswap_64 needs 1 instruction,
whereas the old swap64 needed 30.
* admin/merge-gnulib (GNULIB_MODULES): Add byteswap.
* lib/byteswap.in.h, m4/byteswap.m4: New files, copied from Gnulib.
* lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
* src/fringe.c (init_fringe_bitmap) [WORDS_BIGENDIAN]:
* src/sound.c (le2hl, le2hs, be2hl) [!WINDOWSNT]:
Use byteswap.h's macros to swap bytes.
* src/lisp.h (swap16, swap32, swap64): Remove.
All uses replaced by bswap_16, bswap_32, bswap_64.
13 files changed:
ChangeLog
admin/ChangeLog
admin/merge-gnulib
lib/byteswap.in.h [new file with mode: 0644]
lib/gnulib.mk
m4/byteswap.m4 [new file with mode: 0644]
m4/gnulib-comp.m4
src/ChangeLog
src/data.c
src/fringe.c
src/lisp.h
src/sound.c
src/xsettings.c