Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
X
xz
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OpenVMS
tools
xz
Commits
ddb6913fa8fd
Commit
ddb6913fa8fd
authored
5 years ago
by
Lasse Collin
Browse files
Options
Downloads
Patches
Plain Diff
tuklib_integer.m4: Optimize the check order.
The __builtin byteswapping is the preferred one so check for it first.
parent
7c6653df864d
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
m4/tuklib_integer.m4
+29
-27
29 additions, 27 deletions
m4/tuklib_integer.m4
with
29 additions
and
27 deletions
m4/tuklib_integer.m4
+
29
−
27
View file @
ddb6913f
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
#
#
# Checks for tuklib_integer.h:
# Checks for tuklib_integer.h:
# - Endianness
# - Endianness
# - Does operating system provide byte swapping macros
# - Does
the compiler or the
operating system provide byte swapping macros
# - Does the hardware support fast unaligned access to 16-bit
# - Does the hardware support fast unaligned access to 16-bit
# and 32-bit integers
# and 32-bit integers
#
#
...
@@ -22,5 +22,20 @@
...
@@ -22,5 +22,20 @@
AC_DEFUN_ONCE([TUKLIB_INTEGER], [
AC_DEFUN_ONCE([TUKLIB_INTEGER], [
AC_REQUIRE([TUKLIB_COMMON])
AC_REQUIRE([TUKLIB_COMMON])
AC_REQUIRE([AC_C_BIGENDIAN])
AC_REQUIRE([AC_C_BIGENDIAN])
AC_MSG_CHECKING([if __builtin_bswap16/32/64 are supported])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],
[[__builtin_bswap16(1);
__builtin_bswap32(1);
__builtin_bswap64(1);]])],
[
AC_DEFINE([HAVE___BUILTIN_BSWAPXX], [1],
[Define to 1 if the GNU C extensions
__builtin_bswap16/32/64 are supported.])
AC_MSG_RESULT([yes])
], [
AC_MSG_RESULT([no])
# Look for other byteswapping methods.
AC_CHECK_HEADERS([byteswap.h sys/endian.h sys/byteorder.h], [break])
AC_CHECK_HEADERS([byteswap.h sys/endian.h sys/byteorder.h], [break])
...
@@ -25,6 +40,6 @@
...
@@ -25,6 +40,6 @@
AC_CHECK_HEADERS([byteswap.h sys/endian.h sys/byteorder.h], [break])
AC_CHECK_HEADERS([byteswap.h sys/endian.h sys/byteorder.h], [break])
# Even if we have byteswap.h
,
we may lack the specific macros/functions.
# Even if we have byteswap.h we may lack the specific macros/functions.
if test x$ac_cv_header_byteswap_h = xyes ; then
if test x$ac_cv_header_byteswap_h = xyes ; then
m4_foreach([FUNC], [bswap_16,bswap_32,bswap_64], [
m4_foreach([FUNC], [bswap_16,bswap_32,bswap_64], [
AC_MSG_CHECKING([if FUNC is available])
AC_MSG_CHECKING([if FUNC is available])
...
@@ -44,19 +59,6 @@
...
@@ -44,19 +59,6 @@
])dnl
])dnl
fi
fi
AC_MSG_CHECKING([if __builtin_bswap16/32/64 are supported])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],
[[__builtin_bswap16(1);
__builtin_bswap32(1);
__builtin_bswap64(1);]])],
[
AC_DEFINE([HAVE___BUILTIN_BSWAPXX], [1],
[Define to 1 if the GNU C extensions
__builtin_bswap16/32/64 are supported.])
AC_MSG_RESULT([yes])
], [
AC_MSG_RESULT([no])
])
])
AC_MSG_CHECKING([if unaligned memory access should be used])
AC_MSG_CHECKING([if unaligned memory access should be used])
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment