build-sys: meson: check HAVE_MMX and HAVE_SSE before calling initializers

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/575>
This commit is contained in:
Igor V. Kovalenko 2021-06-05 12:37:24 +03:00
parent 2a5497bac5
commit e0d9231bf4
3 changed files with 14 additions and 6 deletions

View file

@ -114,16 +114,20 @@ bool pa_cpu_init_x86(pa_cpu_x86_flag_t *flags) {
pa_cpu_get_x86_flags(flags);
/* activate various optimisations */
#ifdef HAVE_MMX
if (*flags & PA_CPU_X86_MMX) {
pa_volume_func_init_mmx(*flags);
pa_remap_func_init_mmx(*flags);
}
#endif
#ifdef HAVE_SSE
if (*flags & (PA_CPU_X86_SSE | PA_CPU_X86_SSE2)) {
pa_volume_func_init_sse(*flags);
pa_remap_func_init_sse(*flags);
pa_convert_func_init_sse(*flags);
}
#endif
return true;
#else /* defined (__i386__) || defined (__amd64__) */