44# if defined (__aarch64__)
46# define VLC_CPU_ARM_NEON 0x1
47# define VLC_CPU_ARM_SVE 0x2
50# define vlc_CPU_ARM_NEON() (1)
52# define vlc_CPU_ARM_NEON() ((vlc_CPU() & VLC_CPU_ARM_NEON) != 0)
55# ifdef __ARM_FEATURE_SVE
56# define vlc_CPU_ARM_SVE() (1)
58# define vlc_CPU_ARM_SVE() ((vlc_CPU() & VLC_CPU_ARM_SVE) != 0)
61# elif defined (__arm__)
62# if defined (__VFP_FP__) && !defined (__SOFTFP__)
67# define VLC_CPU_ARMv6 4
68# define VLC_CPU_ARM_NEON 2
70# if defined (__ARM_ARCH_7A__)
71# define VLC_CPU_ARM_ARCH 7
72# elif defined (__ARM_ARCH_6__) || defined (__ARM_ARCH_6T2__)
73# define VLC_CPU_ARM_ARCH 6
75# define VLC_CPU_ARM_ARCH 4
78# if (VLC_CPU_ARM_ARCH >= 6)
79# define vlc_CPU_ARMv6() (1)
81# define vlc_CPU_ARMv6() ((vlc_CPU() & VLC_CPU_ARMv6) != 0)
85# define vlc_CPU_ARM_NEON() (1)
87# define vlc_CPU_ARM_NEON() ((vlc_CPU() & VLC_CPU_ARM_NEON) != 0)
90# elif defined (__loongarch__)
93# elif defined (__mips)
94# if defined (__mips_hard_float)
100# elif defined (__ppc__) || defined (__ppc64__) || defined (__powerpc__)
102# define VLC_CPU_ALTIVEC 2
105# define vlc_CPU_ALTIVEC() (1)
108# define vlc_CPU_ALTIVEC() ((vlc_CPU() & VLC_CPU_ALTIVEC) != 0)
109# define VLC_ALTIVEC __attribute__ ((__target__ ("altivec")))
112# elif defined (__riscv)
118# define VLC_CPU_RV_V 0x1
119# define VLC_CPU_RV_B 0x2
122# define vlc_CPU_RV_V() (1)
124# define vlc_CPU_RV_V() ((vlc_CPU() & VLC_CPU_RV_V) != 0)
127# if (defined (__riscv_b) || (defined (__riscv_zba) && defined (__riscv_zbb) \
128 && defined (__riscv_zbs)))
129# define vlc_CPU_RV_B() (1)
131# define vlc_CPU_RV_B() ((vlc_CPU() & VLC_CPU_RV_B) != 0)
134# elif defined (__sparc__)
137# elif defined (__x86_64__) || defined (__i386__)
139# define VLC_CPU_SSE2 0x00000080
140# define VLC_CPU_SSE3 0x00000100
141# define VLC_CPU_SSSE3 0x00000200
142# define VLC_CPU_SSE4_1 0x00000400
143# define VLC_CPU_AVX 0x00002000
144# define VLC_CPU_AVX2 0x00004000
146# if defined (__SSE__)
149# define VLC_SSE __attribute__ ((__target__ ("sse")))
153# define vlc_CPU_SSE2() (1)
155# define vlc_CPU_SSE2() ((vlc_CPU() & VLC_CPU_SSE2) != 0)
159# define vlc_CPU_SSE3() (1)
161# define vlc_CPU_SSE3() ((vlc_CPU() & VLC_CPU_SSE3) != 0)
165# define vlc_CPU_SSSE3() (1)
167# define vlc_CPU_SSSE3() ((vlc_CPU() & VLC_CPU_SSSE3) != 0)
171# define vlc_CPU_SSE4_1() (1)
173# define vlc_CPU_SSE4_1() ((vlc_CPU() & VLC_CPU_SSE4_1) != 0)
177# define vlc_CPU_AVX() (1)
180# define vlc_CPU_AVX() ((vlc_CPU() & VLC_CPU_AVX) != 0)
181# define VLC_AVX __attribute__ ((__target__ ("avx")))
185# define vlc_CPU_AVX2() (1)
187# define vlc_CPU_AVX2() ((vlc_CPU() & VLC_CPU_AVX2) != 0)
227 void *restrict funcs)
238#define set_cpu_funcs(name, activate, priority) \
239 set_callback(VLC_CHECKED_TYPE(void (*)(void *), activate)) \
240 set_capability(name, priority)
#define VLC_API
Definition fourcc_gen.c:31
void vlc_once_complete(vlc_once_t *restrict once)
Completes a one-time initialization.
Definition threads.c:508
#define vlc_once_begin(once)
Definition vlc_threads.h:565
#define VLC_STATIC_ONCE
Static initializer for one-time initialization.
Definition vlc_threads.h:531
const char name[16]
Definition httpd.c:1298
One-time initialization.
Definition vlc_threads.h:524
This file is a collection of common definitions and types.
void vlc_CPU_functions_init(const char *name, void *restrict funcs)
Initialises DSP functions.
Definition cpu.c:207
static void vlc_CPU_functions_init_once(const char *name, void *restrict funcs)
Initialises DSP functions once.
Definition vlc_cpu.h:227
unsigned vlc_CPU(void)
Retrieves CPU capability flags.
Definition cpu.c:147
unsigned vlc_CPU_raw(void)
Computes CPU capability flags.
Definition cpu.c:55
Thread primitive declarations.