[vlc-commits] aarch64: allow run-time NEON detection
Rémi Denis-Courmont
git at videolan.org
Mon Dec 17 19:06:09 CET 2018
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Dec 17 20:04:46 2018 +0200| [797c455918e4b874f0b22e166df8eb6174bf35fd] | committer: Rémi Denis-Courmont
aarch64: allow run-time NEON detection
(if NEON is disabled in the C compiler settings)
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=797c455918e4b874f0b22e166df8eb6174bf35fd
---
configure.ac | 60 ++++++++++++++------------
modules/video_filter/deinterlace/merge_arm64.S | 1 +
2 files changed, 33 insertions(+), 28 deletions(-)
diff --git a/configure.ac b/configure.ac
index eedb12da6d..9b42a0b07d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1465,46 +1465,50 @@ AM_CONDITIONAL([HAVE_3DNOW], [test "$have_3dnow" = "yes"])
AC_ARG_ENABLE([neon],
AS_HELP_STRING([--disable-neon],
- [disable NEON optimizations (default auto)]),, [
- AS_IF([test "${host_cpu}" = "arm"], [enable_neon="yes"] ,[enable_neon="no"])
+ [disable ARM NEON optimizations (default auto)]),, [
+ case "${host_cpu}" in
+ "arm")
+ enable_neon="32"
+ ;;
+ "aarch64")
+ enable_neon="64"
+ ;;
+ *)
+ enable_neon="no"
+ ;;
+ esac
])
AS_IF([test "${enable_neon}" != "no"], [
VLC_SAVE_FLAGS
- CFLAGS="${CFLAGS} -mfpu=neon -mhard-float"
AC_CACHE_CHECK([if $CCAS groks ARM NEON assembly], [ac_cv_arm_neon], [
- AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM(,[[
+ AS_IF([test "${enable_neon}" != "64"], [
+ CFLAGS="${CFLAGS} -mfpu=neon -mhard-float"
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM(,[[
asm volatile("vqmovun.s64 d0, q1":::"d0");
]])
+ ], [
+ ac_cv_arm_neon="32"
+ ], [
+ ac_cv_arm_neon="no"
+ ])
], [
- ac_cv_arm_neon="yes"
- ], [
- ac_cv_arm_neon="no"
- ])
- ])
- VLC_RESTORE_FLAGS
-])
-AM_CONDITIONAL([HAVE_NEON], [test "${ac_cv_arm_neon}" = "yes"])
-
-AC_ARG_ENABLE([arm64],
- AS_HELP_STRING([--disable-arm64],
- [disable arm 64-bit optimizations (default auto)]),, [
- AS_IF([test "${host_cpu}" = "aarch64"], [enable_arm64="yes"] ,[enable_arm64="no"])
-])
-AS_IF([test "${enable_arm64}" != "no"], [
- AC_CACHE_CHECK([if $CCAS groks ARM 64 SIMD assembly], [ac_cv_arm64], [
- AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM(,[[
+ CFLAGS="${CFLAGS} -march=armv8-a+simd"
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM(,[[
asm volatile("uhadd v0.8b, v0.8b, v1.8b":::"v0");
]])
- ], [
- ac_cv_arm64="yes"
- ], [
- ac_cv_arm64="no"
+ ], [
+ ac_cv_arm_neon="64"
+ ], [
+ ac_cv_arm_neon="no"
+ ])
])
])
+ VLC_RESTORE_FLAGS
])
-AM_CONDITIONAL([HAVE_ARM64], [test "${ac_cv_arm64}" = "yes"])
+AM_CONDITIONAL([HAVE_NEON], [test "${ac_cv_arm_neon}" = "32"])
+AM_CONDITIONAL([HAVE_ARM64], [test "${ac_cv_arm_neon}" = "64"])
AC_ARG_ENABLE([sve],
AS_HELP_STRING([--disable-sve],
diff --git a/modules/video_filter/deinterlace/merge_arm64.S b/modules/video_filter/deinterlace/merge_arm64.S
index 7b70678891..9efc8f76b3 100644
--- a/modules/video_filter/deinterlace/merge_arm64.S
+++ b/modules/video_filter/deinterlace/merge_arm64.S
@@ -21,6 +21,7 @@
#include "../../arm_neon/asm.S"
+ .arch_extension simd
.text
#define DEST x0
More information about the vlc-commits
mailing list