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

linux/cpu: run-time detect AdvSIMD on AArch64

This only assumes NEON is available on AArch64 if it is actually
enabled in the compiler settings (or rather, not explicitly disabled).
Otherwise, perform regular run-time detection.
parent 8a2d6cd0
......@@ -170,10 +170,14 @@ VLC_API unsigned vlc_CPU(void);
# elif defined (__aarch64__)
# define HAVE_FPU 1
# define VLC_CPU_ARM_SVE 0x1
# define VLC_CPU_ARM_NEON 0x1
# define VLC_CPU_ARM_SVE 0x2
// NEON is mandatory for general purpose ARMv8-a CPUs
# define vlc_CPU_ARM64_NEON() (1)
# ifdef __ARM_NEON
# define vlc_CPU_ARM_NEON() (1)
# else
# define vlc_CPU_ARM_NEON() ((vlc_CPU() & VLC_CPU_ARM_NEON) != 0)
# endif
# ifdef __ARM_FEATURE_SVE
# define vlc_CPU_ARM_SVE() (1)
......
......@@ -576,7 +576,7 @@ notsupp:
else
#endif
#if defined(CAN_COMPILE_ARM64)
if( vlc_CPU_ARM64_NEON() )
if( vlc_CPU_ARM_NEON() )
p_sys->pf_merge = pixel_size == 1 ? merge8_arm64_neon : merge16_arm64_neon;
else
#endif
......
......@@ -67,13 +67,13 @@ static void vlc_CPU_init (void)
while ((cap = strsep (&p, " ")) != NULL)
{
#if defined (__arm__)
#if defined (__arm__) || defined (__aarch64__)
if (!strcmp (cap, "neon"))
core_caps |= VLC_CPU_ARM_NEON;
#elif defined (__aarch64__)
# if defined (__aarch64__)
if (!strcmp (cap, "sve"))
core_caps |= VLC_CPU_ARM_SVE;
# endif
#elif defined (__i386__) || defined (__x86_64__)
if (!strcmp (cap, "mmx"))
......
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