44# if defined (__i386__) || defined (__x86_64__)
46# define VLC_CPU_SSE2 0x00000080
47# define VLC_CPU_SSE3 0x00000100
48# define VLC_CPU_SSSE3 0x00000200
49# define VLC_CPU_SSE4_1 0x00000400
50# define VLC_CPU_AVX 0x00002000
51# define VLC_CPU_AVX2 0x00004000
56# define VLC_SSE __attribute__ ((__target__ ("sse")))
60# define vlc_CPU_SSE2() (1)
62# define vlc_CPU_SSE2() ((vlc_CPU() & VLC_CPU_SSE2) != 0)
66# define vlc_CPU_SSE3() (1)
68# define vlc_CPU_SSE3() ((vlc_CPU() & VLC_CPU_SSE3) != 0)
72# define vlc_CPU_SSSE3() (1)
74# define vlc_CPU_SSSE3() ((vlc_CPU() & VLC_CPU_SSSE3) != 0)
78# define vlc_CPU_SSE4_1() (1)
80# define vlc_CPU_SSE4_1() ((vlc_CPU() & VLC_CPU_SSE4_1) != 0)
84# define vlc_CPU_AVX() (1)
87# define vlc_CPU_AVX() ((vlc_CPU() & VLC_CPU_AVX) != 0)
88# define VLC_AVX __attribute__ ((__target__ ("avx")))
92# define vlc_CPU_AVX2() (1)
94# define vlc_CPU_AVX2() ((vlc_CPU() & VLC_CPU_AVX2) != 0)
97# elif defined (__ppc__) || defined (__ppc64__) || defined (__powerpc__)
99# define VLC_CPU_ALTIVEC 2
102# define vlc_CPU_ALTIVEC() (1)
105# define vlc_CPU_ALTIVEC() ((vlc_CPU() & VLC_CPU_ALTIVEC) != 0)
106# define VLC_ALTIVEC __attribute__ ((__target__ ("altivec")))
109# elif defined (__arm__)
110# if defined (__VFP_FP__) && !defined (__SOFTFP__)
115# define VLC_CPU_ARMv6 4
116# define VLC_CPU_ARM_NEON 2
118# if defined (__ARM_ARCH_7A__)
119# define VLC_CPU_ARM_ARCH 7
120# elif defined (__ARM_ARCH_6__) || defined (__ARM_ARCH_6T2__)
121# define VLC_CPU_ARM_ARCH 6
123# define VLC_CPU_ARM_ARCH 4
126# if (VLC_CPU_ARM_ARCH >= 6)
127# define vlc_CPU_ARMv6() (1)
129# define vlc_CPU_ARMv6() ((vlc_CPU() & VLC_CPU_ARMv6) != 0)
133# define vlc_CPU_ARM_NEON() (1)
135# define vlc_CPU_ARM_NEON() ((vlc_CPU() & VLC_CPU_ARM_NEON) != 0)
138# elif defined (__aarch64__)
140# define VLC_CPU_ARM_NEON 0x1
141# define VLC_CPU_ARM_SVE 0x2
144# define vlc_CPU_ARM_NEON() (1)
146# define vlc_CPU_ARM_NEON() ((vlc_CPU() & VLC_CPU_ARM_NEON) != 0)
149# ifdef __ARM_FEATURE_SVE
150# define vlc_CPU_ARM_SVE() (1)
152# define vlc_CPU_ARM_SVE() ((vlc_CPU() & VLC_CPU_ARM_SVE) != 0)
155# elif defined (__sparc__)
158# elif defined (__mips_hard_float)
161# elif defined (__riscv)
165# define VLC_CPU_RV_V 0x1
168# define vlc_CPU_RV_V() (1)
170# define vlc_CPU_RV_V() ((vlc_CPU() & VLC_CPU_RV_V) != 0)
210 void *restrict funcs)
221#define set_cpu_funcs(name, activate, priority) \
222 set_callback(VLC_CHECKED_TYPE(void (*)(void *), activate)) \
223 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:532
#define vlc_once_begin(once)
Definition: vlc_threads.h:659
#define VLC_STATIC_ONCE
Static initializer for one-time initialization.
Definition: vlc_threads.h:625
const char name[16]
Definition: httpd.c:1281
One-time initialization.
Definition: vlc_threads.h:618
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:205
static void vlc_CPU_functions_init_once(const char *name, void *restrict funcs)
Initialises DSP functions once.
Definition: vlc_cpu.h:210
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.