arm build

This commit is contained in:
veejay
2023-09-08 01:05:49 +02:00
parent 6816b8e0eb
commit 26c0d494c7
5 changed files with 50 additions and 11 deletions

View File

@@ -1,7 +1,7 @@
dnl Process this file with autoconf to produce a configure script. dnl Process this file with autoconf to produce a configure script.
dnl AC_INIT dnl AC_INIT
AC_INIT([veejaycore],[1.5.65],[http://www.veejayhq.net]) AC_INIT([veejaycore],[1.5.65],[http://www.veejayhq.net])
AC_PREREQ([2.71]) AC_PREREQ([2.69])
AC_CONFIG_SRCDIR([veejaycore/core.c]) AC_CONFIG_SRCDIR([veejaycore/core.c])
VEEJAYCORE_MAJOR_VERSION=1 VEEJAYCORE_MAJOR_VERSION=1
@@ -395,7 +395,7 @@ then
fi fi
]) ])
if test $ac_cv_flag_neon = yes ; then if test $ac_cv_flag_asimd = yes ; then
AC_DEFINE(HAVE_ARM_ASIMD, 1,[Compiling in ASIMD support]) AC_DEFINE(HAVE_ARM_ASIMD, 1,[Compiling in ASIMD support])
fi fi
@@ -721,7 +721,9 @@ AM_CONDITIONAL(HAVE_SSE, test x$have_asm_sse = xtrue)
AM_CONDITIONAL(HAVE_SSE2, test x$have_asm_sse2 = xtrue) AM_CONDITIONAL(HAVE_SSE2, test x$have_asm_sse2 = xtrue)
AM_CONDITIONAL(HAVE_DL_DLOPEN, test x$have_dl_dlopen = xtrue) AM_CONDITIONAL(HAVE_DL_DLOPEN, test x$have_dl_dlopen = xtrue)
AM_CONDITIONAL(HAVE_ARM, test x$have_arm = xtrue ) AM_CONDITIONAL(HAVE_ARM, test x$have_arm = xtrue )
AM_CONDITIONAL(HAVE_ARMV7A, test x$have_armv7a = xtrue ) AM_CONDITIONAL(HAVE_ARM_NEON, test x$ac_cv_flag_neon = xtrue )
AM_CONDITIONAL(HAVE_ARM_ASIMD, test x$ac_cv_flag_asimd = xtrue )
AM_CONDITIONAL(HAVE_ARM7A, test x$have_armv7a = xtrue )
dnl ********************************************************************* dnl *********************************************************************
dnl Check for what warnings we want gcc to use and adjust the CFLAGS dnl Check for what warnings we want gcc to use and adjust the CFLAGS

View File

@@ -140,10 +140,13 @@
#include <libyuv/mmx_macros.h> #include <libyuv/mmx_macros.h>
#include <veejaycore/veejaycore.h> #include <veejaycore/veejaycore.h>
#include <libavutil/cpu.h> #include <libavutil/cpu.h>
#ifdef HAVE_ARM7A #ifdef HAVE_ARM
#include <arm_neon.h>
#endif
#ifdef HAVE_ARM_NEON
#include <fastarm/new_arm.h> #include <fastarm/new_arm.h>
#endif #endif
#ifdef HAVE_ASIMD #ifdef HAVE_ARM_ASIMD
#include <arm_neon.h> #include <arm_neon.h>
#endif #endif

View File

@@ -4,7 +4,7 @@ SUBDIRS = libhash liblzo
SUBDIRS += mjpegtools SUBDIRS += mjpegtools
if HAVE_ARMV7A if HAVE_ARMV7
SUBDIRS += fastarm SUBDIRS += fastarm
endif endif

View File

@@ -40,7 +40,7 @@ libveejaycore_la_LIBADD = \
$(top_builddir)/thirdparty/mjpegtools/libmjpegutils.la \ $(top_builddir)/thirdparty/mjpegtools/libmjpegutils.la \
$(top_builddir)/libvevo/libvevo.la $(top_builddir)/libvevo/libvevo.la
if HAVE_ARM if HAVE_ARM_NEON
libveejaycore_la_LIBADD+=$(top_builddir)/thirdparty/fastarm/libfastarm.la libveejaycore_la_LIBADD+=$(top_builddir)/thirdparty/fastarm/libfastarm.la
endif endif

View File

@@ -387,7 +387,7 @@ else
fi fi
dnl ARM architecture detect NEON and set CFLAGS dnl ARM architecture detect NEON and set CFLAGS
if test x$have_arm = xtrue if test x$have_armv7a = xtrue
then then
AC_CACHE_CHECK(for NEON on processor(s), ac_cv_flag_neon, [ AC_CACHE_CHECK(for NEON on processor(s), ac_cv_flag_neon, [
if grep "^Features.* neon" /proc/cpuinfo > /dev/null; then if grep "^Features.* neon" /proc/cpuinfo > /dev/null; then
@@ -396,13 +396,11 @@ then
ac_cv_flag_neon=no ac_cv_flag_neon=no
fi fi
]) ])
AC_MSG_RESULT($ac_cv_flag_neon)
if test $ac_cv_flag_neon = yes ; then if test $ac_cv_flag_neon = yes ; then
AC_DEFINE(HAVE_ARM_NEON,1,[Compiling in NEON support]) AC_DEFINE(HAVE_ARM_NEON,1,[Compiling in NEON support])
USER_CFLAGS="-mfpu=neon -ftree-vectorize -mvectorize-with-neon-quad $USER_CFLAGS" USER_CFLAGS="-mfpu=neon -ftree-vectorize -mvectorize-with-neon-quad $USER_CFLAGS"
FASTARM_CFLAGS="$ARCHFLAGS -Wa,-march=armv7-a -mthumb -Wa,-mthumb -Wa,-mimplicit-it=always -mthumb-interwork -DCONFIG_THUMB" FASTARM_CFLAGS="$ARCHFLAGS -march=armv7-a -mthumb -mimplicit-it=always -mthumb-interwork -DCONFIG_THUMB"
else else
USER_CFLAGS="-march=native -ftree-vectorize $USER_CFLAGS" USER_CFLAGS="-march=native -ftree-vectorize $USER_CFLAGS"
FASTARM_CFLAGS="$ARCHFLAGS" FASTARM_CFLAGS="$ARCHFLAGS"
@@ -422,6 +420,33 @@ then
AC_SUBST(FASTARM_CFLAGS) AC_SUBST(FASTARM_CFLAGS)
fi fi
if test x$have_arm = xtrue
then
AC_CACHE_CHECK(for ASIMD on processor(s), ac_cv_flag_asimd, [
if grep "^Features.* asimd" /proc/cpuinfo > /dev/null; then
ac_cv_flag_asimd=yes
else
ac_cv_flag_asimd=no
fi
])
if test $ac_cv_flag_asimd = yes ; then
AC_DEFINE(HAVE_ARM_ASIMD, 1,[Compiling in ASIMD support])
fi
if test "x$enable_debug" != "xyes" ; then
USER_CFLAGS="$USER_CFLAGS -O3 -fno-stack-protector"
else
USER_CFLAGS="$USER_CFLAGS -g -Wall"
fi
OP_CFLAGS="$USER_CFLAGS"
SUBSAMPLE_CFLAGS="$USER_CFLAGS"
VJE_CFLAGS="$USER_CFLAGS"
CFLAGS="$USER_CFLAGS -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES"
AC_SUBST(FASTARM_CFLAGS)
fi
dnl This flag is used for PROGRAMS not SHARED LIBRARIES. PIC code is required dnl This flag is used for PROGRAMS not SHARED LIBRARIES. PIC code is required
dnl for shared libraries but is slower than non-pic code. Compute bound dnl for shared libraries but is slower than non-pic code. Compute bound
dnl programs such as yuvdenoise and y4mspatialfilter can use this flag by dnl programs such as yuvdenoise and y4mspatialfilter can use this flag by
@@ -1022,6 +1047,11 @@ AM_CONDITIONAL(HAVE_DL_DLOPEN, test x$have_dl_dlopen = xtrue)
AM_CONDITIONAL(HAVE_JPEG,test x$have_jpeg = xtrue) AM_CONDITIONAL(HAVE_JPEG,test x$have_jpeg = xtrue)
AM_CONDITIONAL(HAVE_LIBLO,test x$have_liblo = xtrue) AM_CONDITIONAL(HAVE_LIBLO,test x$have_liblo = xtrue)
AM_CONDITIONAL(HAVE_FREETYPE2, test x$have_freetype2 = xtrue) AM_CONDITIONAL(HAVE_FREETYPE2, test x$have_freetype2 = xtrue)
AM_CONDITIONAL(HAVE_ARM, test x$have_arm = xtrue )
AM_CONDITIONAL(HAVE_ARM_NEON, test x$ac_cv_flag_neon = xtrue )
AM_CONDITIONAL(HAVE_ARM_ASIMD, test x$ac_cv_flag_asimd = xtrue )
AM_CONDITIONAL(HAVE_ARM7A, test x$have_armv7a = xtrue )
dnl ********************************************************************* dnl *********************************************************************
dnl Check for what warnings we want gcc to use and adjust the CFLAGS dnl Check for what warnings we want gcc to use and adjust the CFLAGS
dnl as needed. This only works for GCC. dnl as needed. This only works for GCC.
@@ -1162,6 +1192,10 @@ fi
if test "$have_arm" = "true" ; then if test "$have_arm" = "true" ; then
AC_MSG_NOTICE([ arm]) AC_MSG_NOTICE([ arm])
AC_MSG_NOTICE([ ASIMD enabled : ${ac_cv_flag_asimd}])
fi
if test "$have_armv7a" = "true"; then
AC_MSG_NOTICE([ arm7a])
AC_MSG_NOTICE([ NEON enabled : ${ac_cv_flag_neon}]) AC_MSG_NOTICE([ NEON enabled : ${ac_cv_flag_neon}])
fi fi