mesa: move _mesa_exec_malloc/free() prototypes to their own header
[mesa.git] / src / mesa / x86 / common_x86_features.h
1
2 /*
3 * Mesa 3-D graphics library
4 *
5 * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 * and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23 * OTHER DEALINGS IN THE SOFTWARE.
24 */
25
26 /*
27 * x86 CPUID feature information. The raw data is returned by
28 * _mesa_identify_x86_cpu_features() and interpreted with the cpu_has_*
29 * helper macros.
30 *
31 * Gareth Hughes
32 */
33
34 #ifndef __COMMON_X86_FEATURES_H__
35 #define __COMMON_X86_FEATURES_H__
36
37 #define X86_FEATURE_FPU (1<<0)
38 #define X86_FEATURE_CMOV (1<<1)
39 #define X86_FEATURE_MMXEXT (1<<2)
40 #define X86_FEATURE_MMX (1<<3)
41 #define X86_FEATURE_FXSR (1<<4)
42 #define X86_FEATURE_XMM (1<<5)
43 #define X86_FEATURE_XMM2 (1<<6)
44 #define X86_FEATURE_3DNOWEXT (1<<7)
45 #define X86_FEATURE_3DNOW (1<<8)
46 #define X86_FEATURE_SSE4_1 (1<<9)
47
48 /* standard X86 CPU features */
49 #define X86_CPU_FPU (1<<0)
50 #define X86_CPU_CMOV (1<<15)
51 #define X86_CPU_MMX (1<<23)
52 #define X86_CPU_XMM (1<<25)
53 #define X86_CPU_XMM2 (1<<26)
54 /* ECX. */
55 #define X86_CPU_SSE4_1 (1<<19)
56
57 /* extended X86 CPU features */
58 #define X86_CPUEXT_MMX_EXT (1<<22)
59 #define X86_CPUEXT_3DNOW_EXT (1<<30)
60 #define X86_CPUEXT_3DNOW (1<<31)
61
62 #ifdef __MMX__
63 #define cpu_has_mmx 1
64 #else
65 #define cpu_has_mmx (_mesa_x86_cpu_features & X86_FEATURE_MMX)
66 #endif
67
68 #define cpu_has_mmxext (_mesa_x86_cpu_features & X86_FEATURE_MMXEXT)
69
70 #ifdef __SSE__
71 #define cpu_has_xmm 1
72 #else
73 #define cpu_has_xmm (_mesa_x86_cpu_features & X86_FEATURE_XMM)
74 #endif
75
76 #ifdef __SSE2__
77 #define cpu_has_xmm2 1
78 #else
79 #define cpu_has_xmm2 (_mesa_x86_cpu_features & X86_FEATURE_XMM2)
80 #endif
81
82 #ifdef __3dNOW__
83 #define cpu_has_3dnow 1
84 #else
85 #define cpu_has_3dnow (_mesa_x86_cpu_features & X86_FEATURE_3DNOW)
86 #endif
87
88 #define cpu_has_3dnowext (_mesa_x86_cpu_features & X86_FEATURE_3DNOWEXT)
89
90 #ifdef __SSE4_1__
91 #define cpu_has_sse4_1 1
92 #else
93 #define cpu_has_sse4_1 (_mesa_x86_cpu_features & X86_FEATURE_SSE4_1)
94 #endif
95
96 #endif
97