[MPlayer-cvslog] r38141 - in trunk: configure libaf/af_format.c libaf/af_volume.c libmpcodecs/ad_ffmpeg.c

reimar subversion at mplayerhq.hu
Sun May 26 21:56:31 EEST 2019


Author: reimar
Date: Sun May 26 21:56:31 2019
New Revision: 38141

Log:
configure: improve aarch64 handling.

Automatically detect 64- vs. 32-bit build
like for other architectures.
Also detect NEON and VFP support correctly.
Lastly, disable inline assembly NEON code
on AARCH64 that only works on 32-bit.

Modified:
   trunk/configure
   trunk/libaf/af_format.c
   trunk/libaf/af_volume.c
   trunk/libmpcodecs/ad_ffmpeg.c

Modified: trunk/configure
==============================================================================
--- trunk/configure	Fri May 24 13:42:53 2019	(r38140)
+++ trunk/configure	Sun May 26 21:56:31 2019	(r38141)
@@ -270,9 +270,16 @@ alpha() {
   esac
 }
 
+aarch64() {
+  case "$host_arch" in
+    aarch64*) return 0;;
+    *) return 1;;
+  esac
+}
+
 arm() {
   case "$host_arch" in
-    arm*) return 0;;
+    arm*|aarch64*) return 0;;
     *) return 1;;
   esac
 }
@@ -1895,6 +1902,9 @@ fi
 if sparc ; then
   cc_check && host_arch=sparc64 || host_arch=sparc
 fi
+if arm ; then
+  cc_check && host_arch=aarch64 || host_arch=arm
+fi
 fi
 
 echo "Detected operating system: $system_name"
@@ -3223,6 +3233,7 @@ if arm ; then
   if test $_armvfp = "auto" ; then
     _armvfp=no
     inline_asm_check '"fadds s0, s0, s0"' && _armvfp=yes
+    inline_asm_check '"fmadd d0,    d0,    d1,    d2"' && _armvfp=yes
   fi
   echores "$_armvfp"
 
@@ -3254,9 +3265,15 @@ if arm ; then
   if test $neon = "auto" ; then
     neon=no
     inline_asm_check '"vadd.i16 q0, q0, q0"' && neon=yes
+    inline_asm_check '"ext   v0.8B, v0.8B, v1.8B, #1"' && neon=yes
   fi
   echores "$neon"
 
+  echocheck "ARM NEON intrinsics"
+  neon_intrinsics=no
+  statement_check "arm_neon.h" "int16x8_t test = vdupq_n_s16(0)" && neon_intrinsics=yes
+  echores "$neon_intrinsics"
+
   echocheck "ARM THUMB"
   if test $armthumb = "auto" ; then
     armthumb=no
@@ -3265,7 +3282,7 @@ if arm ; then
     extra_cflags="$extra_cflags -mthumb"
     def_armthumb='#define CONFIG_THUMB 1'
   else
-    extra_cflags="$extra_cflags -marm"
+    aarch64 || extra_cflags="$extra_cflags -marm"
     def_armthumb='#define CONFIG_THUMB 0'
   fi
   echores "$armthumb"
@@ -3278,7 +3295,8 @@ if arm ; then
   echores "$_iwmmxt"
 fi
 
-cpuexts_all='ALTIVEC XOP AVX AVX2 AVX512 FMA3 FMA4 MMX MMX2 MMXEXT AMD3DNOW AMD3DNOWEXT SSE SSE2 SSE3 SSSE3 SSE4 SSE42 FAST_CMOV I686 FAST_CLZ ARMV5TE ARMV6 ARMV6T2 VFP VFPV3 SETEND NEON IWMMXT MMI VIS MVI'
+intrinsics="none"
+cpuexts_all='ALTIVEC XOP AVX AVX2 AVX512 FMA3 FMA4 MMX MMX2 MMXEXT AMD3DNOW AMD3DNOWEXT SSE SSE2 SSE3 SSSE3 SSE4 SSE42 FAST_CMOV I686 FAST_CLZ ARMV5TE ARMV6 ARMV6T2 ARMV8 VFP VFPV3 SETEND NEON INTRINSICS_NEON IWMMXT MMI VIS MVI'
 test "$_altivec"   = yes && cpuexts="ALTIVEC $cpuexts"
 test "$_mmx"       = yes && cpuexts="MMX $cpuexts"
 test "$_mmxext"    = yes && cpuexts="MMX2 $cpuexts"
@@ -3303,10 +3321,12 @@ test "$_fast_clz"  = yes && cpuexts="FAS
 test "$_armv5te"   = yes && cpuexts="ARMV5TE $cpuexts"
 test "$_armv6"     = yes && cpuexts="ARMV6 $cpuexts"
 test "$_armv6t2"   = yes && cpuexts="ARMV6T2 $cpuexts"
+aarch64 && cpuexts="ARMV8 $cpuexts"
 test "$_armvfp"    = yes && cpuexts="VFP $cpuexts"
 test "$vfpv3"      = yes && cpuexts="VFPV3 $cpuexts"
 test "$setend"     = yes && cpuexts="SETEND $cpuexts"
 test "$neon"       = yes && cpuexts="NEON $cpuexts"
+test "$neon_intrinsics" = yes && cpuexts="INTRINSICS_NEON $cpuexts" && intrinsics="neon"
 test "$_iwmmxt"    = yes && cpuexts="IWMMXT $cpuexts"
 test "$_vis"       = yes && cpuexts="VIS $cpuexts"
 test "$_mvi"       = yes && cpuexts="MVI $cpuexts"
@@ -8790,7 +8810,7 @@ HAVE_W32THREADS = $_w32threads
 HAVE_THREADS    = $_threads
 HAVE_YASM       = $have_yasm
 HAVE_X86ASM     = $have_yasm
-INTRINSICS      = none
+INTRINSICS      = $intrinsics
 
 CONFIG_LIBXVID = $_xvid_lavc
 $(mak_enable "$libavdecoders_all"  "$libavdecoders"  CONFIG)
@@ -9340,7 +9360,6 @@ $def_openssl
 #define HAVE_INLINE_ASM 1
 #define HAVE_INLINE_ASM_NONLOCAL_LABELS 1
 #define HAVE_INLINE_ASM_DIRECT_SYMBOL_REFS 1
-#define HAVE_INTRINSICS_NEON 0
 #define HAVE_ISATTY 0
 #define HAVE_LDBRX 0
 #define HAVE_LIBC_MSVCRT 0

Modified: trunk/libaf/af_format.c
==============================================================================
--- trunk/libaf/af_format.c	Fri May 24 13:42:53 2019	(r38140)
+++ trunk/libaf/af_format.c	Sun May 26 21:56:31 2019	(r38141)
@@ -494,7 +494,7 @@ static void float2int(const float* in, v
       ((int8_t *)out)[i] = av_clip_int8(lrintf(128.0f * in[i]));
     break;
   case(2):
-#if HAVE_NEON
+#if HAVE_NEON && !ARCH_AARCH64
     {
     const float *in_end = in + len;
     while (in < in_end - 7) {

Modified: trunk/libaf/af_volume.c
==============================================================================
--- trunk/libaf/af_volume.c	Fri May 24 13:42:53 2019	(r38140)
+++ trunk/libaf/af_volume.c	Sun May 26 21:56:31 2019	(r38141)
@@ -125,7 +125,7 @@ static av_always_inline void s16_inner_l
 static av_always_inline void float_inner_loop(float *data, int len, int offset, int step, float level, int softclip)
 {
   int i;
-#if HAVE_NEON
+#if HAVE_NEON && !ARCH_AARCH64
   if (offset == 0 && step == 1 && !softclip && len >= 8)
   {
     __asm__(

Modified: trunk/libmpcodecs/ad_ffmpeg.c
==============================================================================
--- trunk/libmpcodecs/ad_ffmpeg.c	Fri May 24 13:42:53 2019	(r38140)
+++ trunk/libmpcodecs/ad_ffmpeg.c	Sun May 26 21:56:31 2019	(r38141)
@@ -223,7 +223,7 @@ static av_always_inline void copy_sample
 {
     size_t s, c, o = 0;
 
-#if HAVE_NEON_INLINE
+#if HAVE_NEON_INLINE && !ARCH_AARCH64
     if (nb_channels == 2 && bps == 4) {
         const unsigned char *src0 = src[0];
         const unsigned char *src1 = src[1];


More information about the MPlayer-cvslog mailing list