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.
2013-10-04 07:36:22 +00:00
|
|
|
# byteswap.m4 serial 4
|
2016-01-01 09:12:52 +00:00
|
|
|
dnl Copyright (C) 2005, 2007, 2009-2016 Free Software Foundation, Inc.
|
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.
2013-10-04 07:36:22 +00:00
|
|
|
dnl This file is free software; the Free Software Foundation
|
|
|
|
dnl gives unlimited permission to copy and/or distribute it,
|
|
|
|
dnl with or without modifications, as long as this notice is preserved.
|
|
|
|
|
|
|
|
dnl Written by Oskar Liljeblad.
|
|
|
|
|
|
|
|
AC_DEFUN([gl_BYTESWAP],
|
|
|
|
[
|
|
|
|
dnl Prerequisites of lib/byteswap.in.h.
|
|
|
|
AC_CHECK_HEADERS([byteswap.h], [
|
|
|
|
BYTESWAP_H=''
|
|
|
|
], [
|
|
|
|
BYTESWAP_H='byteswap.h'
|
|
|
|
])
|
|
|
|
AC_SUBST([BYTESWAP_H])
|
|
|
|
AM_CONDITIONAL([GL_GENERATE_BYTESWAP_H], [test -n "$BYTESWAP_H"])
|
|
|
|
])
|