xref: /third_party/pulseaudio/src/pulsecore/cpu.c (revision 53a5a1b3)
1/***
2  This file is part of PulseAudio.
3
4  Copyright 2014 Peter Meerwald <pmeerw@pmeerw.net>
5
6  PulseAudio is free software; you can redistribute it and/or modify
7  it under the terms of the GNU Lesser General Public License as published
8  by the Free Software Foundation; either version 2.1 of the License,
9  or (at your option) any later version.
10
11  PulseAudio is distributed in the hope that it will be useful, but
12  WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  General Public License for more details.
15***/
16
17#ifdef HAVE_CONFIG_H
18#include <config.h>
19#endif
20
21#include "cpu.h"
22#include "cpu-orc.h"
23
24void pa_cpu_init(pa_cpu_info *cpu_info) {
25    cpu_info->cpu_type = PA_CPU_UNDEFINED;
26    /* don't force generic code, used for testing only */
27    cpu_info->force_generic_code = false;
28    if (!getenv("PULSE_NO_SIMD")) {
29        if (pa_cpu_init_x86(&cpu_info->flags.x86))
30            cpu_info->cpu_type = PA_CPU_X86;
31        else if (pa_cpu_init_arm(&cpu_info->flags.arm))
32            cpu_info->cpu_type = PA_CPU_ARM;
33        pa_cpu_init_orc(*cpu_info);
34    }
35
36    pa_remap_func_init(cpu_info);
37    pa_mix_func_init(cpu_info);
38}
39