Merge branch 'master' of git://0pointer.de/pulseaudio into dbus-work
[platform/upstream/pulseaudio.git] / 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
28 typedef enum pa_cpu_x86_flag {
29     PA_CPU_X86_MMX       = (1 << 0),
30     PA_CPU_X86_MMXEXT    = (1 << 1),
31     PA_CPU_X86_SSE       = (1 << 2),
32     PA_CPU_X86_SSE2      = (1 << 3),
33     PA_CPU_X86_SSE3      = (1 << 4),
34     PA_CPU_X86_SSSE3     = (1 << 5),
35     PA_CPU_X86_SSE4_1    = (1 << 6),
36     PA_CPU_X86_SSE4_2    = (1 << 7),
37     PA_CPU_X86_3DNOW     = (1 << 8),
38     PA_CPU_X86_3DNOWEXT  = (1 << 9)
39 } pa_cpu_x86_flag_t;
40
41 void pa_cpu_init_x86 (void);
42
43
44 #if defined (__i386__)
45 typedef int32_t pa_reg_x86;
46 #define PA_REG_a "eax"
47 #define PA_REG_b "ebx"
48 #define PA_REG_c "ecx"
49 #define PA_REG_d "edx"
50 #define PA_REG_D "edi"
51 #define PA_REG_S "esi"
52 #elif defined (__amd64__)
53 typedef int64_t pa_reg_x86;
54 #define PA_REG_a "rax"
55 #define PA_REG_b "rbx"
56 #define PA_REG_c "rcx"
57 #define PA_REG_d "rdx"
58 #define PA_REG_D "rdi"
59 #define PA_REG_S "rsi"
60 #endif
61
62 /* some optimized functions */
63 void pa_volume_func_init_mmx(pa_cpu_x86_flag_t flags);
64 void pa_volume_func_init_sse(pa_cpu_x86_flag_t flags);
65
66 void pa_remap_func_init_mmx(pa_cpu_x86_flag_t flags);
67
68 #endif /* foocpux86hfoo */