summaryrefslogtreecommitdiff
path: root/src/fringe.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2013-10-04 00:36:22 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2013-10-04 00:36:22 -0700
commit4eed3157327f8406921658442a11af7e9d84d603 (patch)
treee727a3017628ce840707d71998d4f6423a8fbde3 /src/fringe.c
parent157fec2e190a84345138a0cc69e35f177c4d4a56 (diff)
downloademacs-4eed3157327f8406921658442a11af7e9d84d603.tar.gz
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.
Diffstat (limited to 'src/fringe.c')
-rw-r--r--src/fringe.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/fringe.c b/src/fringe.c
index 85103f7f08d..3537027f1dd 100644
--- a/src/fringe.c
+++ b/src/fringe.c
@@ -20,6 +20,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <stdio.h>
+#include <byteswap.h>
+
#include "lisp.h"
#include "frame.h"
#include "window.h"
@@ -1519,7 +1521,7 @@ init_fringe_bitmap (int which, struct fringe_bitmap *fb, int once_p)
| (swap_nibble[(b>>12) & 0xf]));
b >>= (16 - fb->width);
#ifdef WORDS_BIGENDIAN
- b = ((b >> 8) | (b << 8));
+ b = bswap_16 (b);
#endif
*bits++ = b;
}