cpu: Add force_generic_code flag to cpu_info struct

The remapper and channel mixing code have (faster) specialized and (slower)
generic code certain code path. The flag force_generic_code can be set to
force the generic code path which is useful for testing. Code duplication
(such as in mix-special-test) can be avoided, cleanup patches follow.

Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
This commit is contained in:
Peter Meerwald 2014-04-18 09:59:32 +02:00 committed by Peter Meerwald
parent 61c888dc93
commit f4ab8bd835
4 changed files with 31 additions and 0 deletions

View file

@ -23,6 +23,8 @@
void pa_cpu_init(pa_cpu_info *cpu_info) {
cpu_info->cpu_type = PA_CPU_UNDEFINED;
/* don't force generic code, used for testing only */
cpu_info->force_generic_code = false;
if (!getenv("PULSE_NO_SIMD")) {
if (pa_cpu_init_x86(&cpu_info->flags.x86))
cpu_info->cpu_type = PA_CPU_X86;
@ -30,4 +32,7 @@ void pa_cpu_init(pa_cpu_info *cpu_info) {
cpu_info->cpu_type = PA_CPU_ARM;
pa_cpu_init_orc(*cpu_info);
}
pa_remap_func_init(cpu_info);
pa_mix_func_init(cpu_info);
}