Commit edf6ff75 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

cpu: generic support for ARM SVE

This adds generic support for the AArch64 Scalable Vector Extension.
parent 2f43315f
......@@ -1506,6 +1506,29 @@ asm volatile("uhadd v0.8b, v0.8b, v1.8b":::"v0");
])
AM_CONDITIONAL([HAVE_ARM64], [test "${ac_cv_arm64}" = "yes"])
AC_ARG_ENABLE([sve],
AS_HELP_STRING([--disable-sve],
[disable ARM SVE optimizations (default auto)]),, [
AS_IF([test "${host_cpu}" = "aarch64"], [enable_sve="yes"] ,[enable_sve="no"])
])
AS_IF([test "${enable_sve}" != "no"], [
VLC_SAVE_FLAGS
CFLAGS="${CFLAGS} -march=armv8-a+sve"
AC_CACHE_CHECK([if $CCAS groks ARM SVE assembly], [ac_cv_arm_sve], [
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM(,[[
asm volatile("ptrue p0.s" ::: "p0");
]])
], [
ac_cv_arm_sve="yes"
], [
ac_cv_arm_sve="no"
])
])
VLC_RESTORE_FLAGS
])
AM_CONDITIONAL([HAVE_SVE], [test "${ac_cv_arm_sve}" = "yes"])
AC_ARG_ENABLE([altivec],
AS_HELP_STRING([--disable-altivec],
......
......@@ -170,9 +170,17 @@ VLC_API unsigned vlc_CPU(void);
# elif defined (__aarch64__)
# define HAVE_FPU 1
# define VLC_CPU_ARM_SVE 0x1
// NEON is mandatory for general purpose ARMv8-a CPUs
# define vlc_CPU_ARM64_NEON() (1)
# ifdef __ARM_FEATURE_SVE
# define vlc_CPU_ARM_SVE() (1)
# else
# define vlc_CPU_ARM_SVE() ((vlc_CPU() & VLC_CPU_ARM_SVE) != 0)
# endif
# elif defined (__sparc__)
# define HAVE_FPU 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment