mirror of
https://github.com/ceph/ceph
synced 2024-12-22 19:34:30 +00:00
60762338a2
ARMv8 defines a set of optional CRC32/CRC32C instructions. This patch defines an optimized function that uses these instructions when available rather than table-based lookup. Optimized function based on a Hadoop patch by Ed Nevill. Autotools updated to check for compiler support. Optimized function is selected at runtime based on HWCAP_CRC32. Added crc32c "performance" unit test and arch unit test. Tested on AMD Seattle. Passes all crc32c unit tests. Unit test shows ~4x performance increase versus sctp. Signed-off-by: Yazen Ghannam <yazen.ghannam@linaro.org> Reviewed-by: Steve Capper <steve.capper@linaro.org>
42 lines
1.5 KiB
Plaintext
42 lines
1.5 KiB
Plaintext
AC_DEFUN([AX_ARM_FEATURES],
|
|
[
|
|
AC_REQUIRE([AC_CANONICAL_HOST])
|
|
|
|
case $target_cpu in
|
|
arm*)
|
|
AX_CHECK_COMPILE_FLAG(-mfpu=neon, ax_cv_support_neon_ext=yes, [])
|
|
if test x"$ax_cv_support_neon_ext" = x"yes"; then
|
|
ARM_NEON_FLAGS="-mfpu=neon -DARM_NEON"
|
|
AC_SUBST(ARM_NEON_FLAGS)
|
|
ARM_FLAGS="$ARM_FLAGS $ARM_NEON_FLAGS"
|
|
AC_DEFINE(HAVE_NEON,,[Support NEON instructions])
|
|
fi
|
|
;;
|
|
aarch64*)
|
|
AX_CHECK_COMPILE_FLAG(-march=armv8-a, ax_cv_support_armv8=yes, [])
|
|
if test x"$ax_cv_support_armv8" = x"yes"; then
|
|
ARM_ARCH_FLAGS="-march=armv8-a"
|
|
ARM_DEFINE_FLAGS="-DARCH_AARCH64"
|
|
fi
|
|
AX_CHECK_COMPILE_FLAG(-march=armv8-a+simd, ax_cv_support_neon_ext=yes, [])
|
|
if test x"$ax_cv_support_neon_ext" = x"yes"; then
|
|
ARM_ARCH_FLAGS="$ARM_ARCH_FLAGS+simd"
|
|
ARM_DEFINE_FLAGS="$ARM_DEFINE_FLAGS -DARM_NEON"
|
|
ARM_NEON_FLAGS="-march=armv8-a+simd -DARCH_AARCH64 -DARM_NEON"
|
|
AC_DEFINE(HAVE_NEON,,[Support NEON instructions])
|
|
AC_SUBST(ARM_NEON_FLAGS)
|
|
fi
|
|
AX_CHECK_COMPILE_FLAG(-march=armv8-a+crc, ax_cv_support_crc_ext=yes, [])
|
|
if test x"$ax_cv_support_crc_ext" = x"yes"; then
|
|
ARM_ARCH_FLAGS="$ARM_ARCH_FLAGS+crc"
|
|
ARM_CRC_FLAGS="-march=armv8-a+crc -DARCH_AARCH64"
|
|
AC_DEFINE(HAVE_ARMV8_CRC,,[Support ARMv8 CRC instructions])
|
|
AC_SUBST(ARM_CRC_FLAGS)
|
|
fi
|
|
ARM_FLAGS="$ARM_ARCH_FLAGS $ARM_DEFINE_FLAGS"
|
|
;;
|
|
esac
|
|
|
|
AC_SUBST(ARM_FLAGS)
|
|
])
|