Commit | Line | Data |
---|---|---|
72b9787e JB |
1 | /***************************************************************************** |
2 | * Copyright (C) 2013 x265 project | |
3 | * | |
4 | * Authors: Loren Merritt <lorenm@u.washington.edu> | |
5 | * Steve Borho <steve@borho.org> | |
6 | * | |
7 | * This program is free software; you can redistribute it and/or modify | |
8 | * it under the terms of the GNU General Public License as published by | |
9 | * the Free Software Foundation; either version 2 of the License, or | |
10 | * (at your option) any later version. | |
11 | * | |
12 | * This program is distributed in the hope that it will be useful, | |
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | * GNU General Public License for more details. | |
16 | * | |
17 | * You should have received a copy of the GNU General Public License | |
18 | * along with this program; if not, write to the Free Software | |
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111, USA. | |
20 | * | |
21 | * This program is also available under a commercial proprietary license. | |
22 | * For more information, contact us at license @ x265.com. | |
23 | *****************************************************************************/ | |
24 | ||
25 | #ifndef X265_CPU_H | |
26 | #define X265_CPU_H | |
27 | ||
28 | #include "common.h" | |
29 | ||
30 | // from cpu-a.asm, if ASM primitives are compiled, else primitives.cpp | |
31 | extern "C" void x265_cpu_emms(void); | |
32 | extern "C" void x265_safe_intel_cpu_indicator_init(void); | |
33 | ||
34 | #if _MSC_VER && _WIN64 | |
35 | #define x265_emms() x265_cpu_emms() | |
36 | #elif _MSC_VER | |
37 | #include <mmintrin.h> | |
38 | #define x265_emms() _mm_empty() | |
39 | #elif __GNUC__ | |
40 | // Cannot use _mm_empty() directly without compiling all the source with | |
41 | // a fixed CPU arch, which we would like to avoid at the moment | |
42 | #define x265_emms() x265_cpu_emms() | |
43 | #else | |
44 | #define x265_emms() x265_cpu_emms() | |
45 | #endif | |
46 | ||
47 | namespace x265 { | |
48 | uint32_t cpu_detect(void); | |
49 | ||
50 | struct cpu_name_t | |
51 | { | |
52 | char name[16]; | |
53 | uint32_t flags; | |
54 | }; | |
55 | ||
56 | extern const cpu_name_t cpu_names[]; | |
57 | } | |
58 | ||
59 | #endif // ifndef X265_CPU_H |