62# if defined (__aarch64__)
64# define VLC_CPU_ARM_NEON 0x1
65# define VLC_CPU_ARM_SVE 0x2
67# define vlc_CPU_ARM_NEON() ((vlc_CPU() & VLC_CPU_ARM_NEON) != 0)
68# define vlc_CPU_ARM_SVE() ((vlc_CPU() & VLC_CPU_ARM_SVE) != 0)
70# elif defined (__arm__)
71# if defined (__VFP_FP__) && !defined (__SOFTFP__)
76# define VLC_CPU_ARMv6 4
77# define VLC_CPU_ARM_NEON 2
79# if defined (__ARM_ARCH_7A__)
80# define VLC_CPU_ARM_ARCH 7
81# elif defined (__ARM_ARCH_6__) || defined (__ARM_ARCH_6T2__)
82# define VLC_CPU_ARM_ARCH 6
84# define VLC_CPU_ARM_ARCH 4
87# define vlc_CPU_ARMv6() ((vlc_CPU() & VLC_CPU_ARMv6) != 0)
88# define vlc_CPU_ARM_NEON() ((vlc_CPU() & VLC_CPU_ARM_NEON) != 0)
91# elif defined (__loongarch__)
94# elif defined (__mips)
95# if defined (__mips_hard_float)
101# elif defined (__ppc__) || defined (__ppc64__) || defined (__powerpc__)
103# define VLC_CPU_ALTIVEC 2
105# 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
121# define vlc_CPU_RV_V() ((vlc_CPU() & VLC_CPU_RV_V) != 0)
122# define vlc_CPU_RV_B() ((vlc_CPU() & VLC_CPU_RV_B) != 0)
124# elif defined (__sparc__)
127# elif defined (__x86_64__) || defined (__i386__)
129# define VLC_CPU_SSE2 0x00000080
130# define VLC_CPU_SSE3 0x00000100
131# define VLC_CPU_SSSE3 0x00000200
132# define VLC_CPU_SSE4_1 0x00000400
133# define VLC_CPU_AVX 0x00002000
134# define VLC_CPU_AVX2 0x00004000
136# if defined (__SSE__)
139# define VLC_SSE __attribute__ ((__target__ ("sse")))
142# define vlc_CPU_SSE2() ((vlc_CPU() & VLC_CPU_SSE2) != 0)
143# define vlc_CPU_SSE3() ((vlc_CPU() & VLC_CPU_SSE3) != 0)
144# define vlc_CPU_SSSE3() ((vlc_CPU() & VLC_CPU_SSSE3) != 0)
145# define vlc_CPU_SSE4_1() ((vlc_CPU() & VLC_CPU_SSE4_1) != 0)
147# define vlc_CPU_AVX() ((vlc_CPU() & VLC_CPU_AVX) != 0)
151# define VLC_AVX __attribute__ ((__target__ ("avx")))
154# define vlc_CPU_AVX2() ((vlc_CPU() & VLC_CPU_AVX2) != 0)
193 void *restrict funcs)
204#define set_cpu_funcs(name, activate, priority) \
205 set_callback(VLC_CHECKED_TYPE(void (*)(void *), activate)) \
206 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:213
static void vlc_CPU_functions_init_once(const char *name, void *restrict funcs)
Initialises DSP functions once.
Definition vlc_cpu.h:193
unsigned vlc_CPU(void)
Retrieves CPU capability flags.
Definition cpu.c:149
unsigned vlc_CPU_raw(void)
Computes CPU capability flags.
Definition cpu.c:55
void vlc_CPU_set(unsigned mask)
Masks CPU capability flags.
Definition cpu.c:161
Thread primitive declarations.