]> code.delx.au - pulseaudio/blob - src/pulsecore/cpu-x86.h
0045ef6d963a22595d18e320c6947bc1c9ac38b5
[pulseaudio] / src / pulsecore / cpu-x86.h
1 #ifndef foocpux86hfoo
2 #define foocpux86hfoo
3
4 /***
5 This file is part of PulseAudio.
6
7 Copyright 2004-2006 Lennart Poettering
8 Copyright 2009 Wim Taymans <wim.taymans@collabora.co.uk>
9
10 PulseAudio is free software; you can redistribute it and/or modify
11 it under the terms of the GNU Lesser General Public License as published
12 by the Free Software Foundation; either version 2.1 of the License,
13 or (at your option) any later version.
14
15 PulseAudio is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 General Public License for more details.
19
20 You should have received a copy of the GNU Lesser General Public License
21 along with PulseAudio; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
23 USA.
24 ***/
25
26 #include <stdint.h>
27 #include <pulsecore/macro.h>
28
29 typedef enum pa_cpu_x86_flag {
30 PA_CPU_X86_MMX = (1 << 0),
31 PA_CPU_X86_MMXEXT = (1 << 1),
32 PA_CPU_X86_SSE = (1 << 2),
33 PA_CPU_X86_SSE2 = (1 << 3),
34 PA_CPU_X86_SSE3 = (1 << 4),
35 PA_CPU_X86_SSSE3 = (1 << 5),
36 PA_CPU_X86_SSE4_1 = (1 << 6),
37 PA_CPU_X86_SSE4_2 = (1 << 7),
38 PA_CPU_X86_3DNOW = (1 << 8),
39 PA_CPU_X86_3DNOWEXT = (1 << 9),
40 PA_CPU_X86_CMOV = (1 << 10)
41 } pa_cpu_x86_flag_t;
42
43 pa_bool_t pa_cpu_init_x86 (pa_cpu_x86_flag_t *flags);
44
45 #if defined (__i386__)
46 typedef int32_t pa_reg_x86;
47 #define PA_REG_a "eax"
48 #define PA_REG_b "ebx"
49 #define PA_REG_c "ecx"
50 #define PA_REG_d "edx"
51 #define PA_REG_D "edi"
52 #define PA_REG_S "esi"
53 #elif defined (__amd64__)
54 typedef int64_t pa_reg_x86;
55 #define PA_REG_a "rax"
56 #define PA_REG_b "rbx"
57 #define PA_REG_c "rcx"
58 #define PA_REG_d "rdx"
59 #define PA_REG_D "rdi"
60 #define PA_REG_S "rsi"
61 #endif
62
63 /* some optimized functions */
64 void pa_volume_func_init_mmx(pa_cpu_x86_flag_t flags);
65 void pa_volume_func_init_sse(pa_cpu_x86_flag_t flags);
66
67 void pa_remap_func_init_mmx(pa_cpu_x86_flag_t flags);
68 void pa_remap_func_init_sse(pa_cpu_x86_flag_t flags);
69
70 void pa_convert_func_init_sse (pa_cpu_x86_flag_t flags);
71
72 #endif /* foocpux86hfoo */