mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-10 13:29:58 -05:00
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:
parent
2a5497bac5
commit
e0d9231bf4
3 changed files with 14 additions and 6 deletions
|
|
@ -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__) */
|
||||
|
|
|
|||
|
|
@ -358,7 +358,7 @@ START_TEST (rearrange_special_test) {
|
|||
}
|
||||
END_TEST
|
||||
|
||||
#if defined (__i386__) || defined (__amd64__)
|
||||
#if (defined (__i386__) || defined (__amd64__)) && defined (HAVE_MMX)
|
||||
START_TEST (remap_mmx_test) {
|
||||
pa_cpu_x86_flag_t flags = 0;
|
||||
pa_init_remap_func_t init_func, orig_init_func;
|
||||
|
|
@ -382,7 +382,9 @@ START_TEST (remap_mmx_test) {
|
|||
remap_init_test_channels(init_func, orig_init_func, PA_SAMPLE_S16NE, 1, 2, false);
|
||||
}
|
||||
END_TEST
|
||||
#endif /* (defined (__i386__) || defined (__amd64__)) && defined (HAVE_MMX) */
|
||||
|
||||
#if (defined (__i386__) || defined (__amd64__)) && defined (HAVE_SSE)
|
||||
START_TEST (remap_sse2_test) {
|
||||
pa_cpu_x86_flag_t flags = 0;
|
||||
pa_init_remap_func_t init_func, orig_init_func;
|
||||
|
|
@ -406,7 +408,7 @@ START_TEST (remap_sse2_test) {
|
|||
remap_init_test_channels(init_func, orig_init_func, PA_SAMPLE_S16NE, 1, 2, false);
|
||||
}
|
||||
END_TEST
|
||||
#endif /* defined (__i386__) || defined (__amd64__) */
|
||||
#endif /* (defined (__i386__) || defined (__amd64__)) && defined (HAVE_SSE) */
|
||||
|
||||
#if defined (__arm__) && defined (__linux__) && defined (HAVE_NEON)
|
||||
START_TEST (remap_neon_test) {
|
||||
|
|
@ -513,8 +515,10 @@ int main(int argc, char *argv[]) {
|
|||
|
||||
tc = tcase_create("remap");
|
||||
tcase_add_test(tc, remap_special_test);
|
||||
#if defined (__i386__) || defined (__amd64__)
|
||||
#if (defined (__i386__) || defined (__amd64__)) && defined (HAVE_MMX)
|
||||
tcase_add_test(tc, remap_mmx_test);
|
||||
#endif
|
||||
#if (defined (__i386__) || defined (__amd64__)) && defined (HAVE_SSE)
|
||||
tcase_add_test(tc, remap_sse2_test);
|
||||
#endif
|
||||
#if defined (__arm__) && defined (__linux__) && defined (HAVE_NEON)
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ static void run_conv_test_s16_to_float(
|
|||
}
|
||||
#endif /* defined (__arm__) && defined (__linux__) && defined (HAVE_NEON) */
|
||||
|
||||
#if defined (__i386__) || defined (__amd64__)
|
||||
#if (defined (__i386__) || defined (__amd64__)) && defined (HAVE_SSE)
|
||||
START_TEST (sconv_sse2_test) {
|
||||
pa_cpu_x86_flag_t flags = 0;
|
||||
pa_convert_func_t orig_func, sse2_func;
|
||||
|
|
@ -188,7 +188,7 @@ START_TEST (sconv_sse_test) {
|
|||
run_conv_test_float_to_s16(sse_func, orig_func, 7, true, true);
|
||||
}
|
||||
END_TEST
|
||||
#endif /* defined (__i386__) || defined (__amd64__) */
|
||||
#endif /* (defined (__i386__) || defined (__amd64__)) && defined (HAVE_SSE) */
|
||||
|
||||
#if defined (__arm__) && defined (__linux__) && defined (HAVE_NEON)
|
||||
START_TEST (sconv_neon_test) {
|
||||
|
|
@ -244,7 +244,7 @@ int main(int argc, char *argv[]) {
|
|||
s = suite_create("CPU");
|
||||
|
||||
tc = tcase_create("sconv");
|
||||
#if defined (__i386__) || defined (__amd64__)
|
||||
#if (defined (__i386__) || defined (__amd64__)) && defined (HAVE_SSE)
|
||||
tcase_add_test(tc, sconv_sse2_test);
|
||||
tcase_add_test(tc, sconv_sse_test);
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue