Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

fxcpuid.h
1 /********************************************************************************
2 * *
3 * C P U I D S u p p o r t *
4 * *
5 *********************************************************************************
6 * Copyright (C) 1998,2017 by Jeroen van der Zijp. All Rights Reserved. *
7 *********************************************************************************
8 * This library is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU Lesser General Public License as published by *
10 * the Free Software Foundation; either version 3 of the License, or *
11 * (at your option) any later version. *
12 * *
13 * This library is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public License *
19 * along with this program. If not, see <http://www.gnu.org/licenses/> *
20 ********************************************************************************/
21 #ifndef FXCPUID_H
22 #define FXCPUID_H
23 
24 
25 namespace FX {
26 
27 
28 // Runtime CPU features check (x86/x86-64 only)
29 enum {
30  CPU_HAS_SSE = 0x0000001,
31  CPU_HAS_SSE2 = 0x0000002,
32  CPU_HAS_SSE3 = 0x0000004,
33  CPU_HAS_SSSE3 = 0x0000008,
34  CPU_HAS_SSE41 = 0x0000010,
35  CPU_HAS_SSE42 = 0x0000020,
36  CPU_HAS_AVX = 0x0000040,
37  CPU_HAS_AVX2 = 0x0000080,
38  CPU_HAS_FMA = 0x0000100,
39  CPU_HAS_AES = 0x0000200,
40  CPU_HAS_POPCNT = 0x0000400,
41  CPU_HAS_CX8 = 0x0000800,
42  CPU_HAS_CX16 = 0x0001000,
43  CPU_HAS_F16 = 0x0002000,
44  CPU_HAS_BMI1 = 0x0004000,
45  CPU_HAS_BMI2 = 0x0008000,
46  CPU_HAS_SSE4A = 0x0010000,
47  CPU_HAS_ABM = 0x0020000,
48  CPU_HAS_XOP = 0x0040000,
49  CPU_HAS_FMA4 = 0x0080000,
50  CPU_HAS_TBM = 0x0100000,
51  CPU_HAS_RAND = 0x0200000
52  };
53 
54 
62 extern FXAPI FXuint fxCPUCaps(FXuint level=0);
63 
72 extern FXAPI FXbool fxCPUGetCaps(FXuint level,FXuint features[]);
73 
83 extern FXAPI FXbool fxCPUGetXCaps(FXuint level,FXuint count,FXuint features[]);
84 
89 extern FXAPI FXuint fxCPUFeatures();
90 
96 extern FXAPI FXbool fxCPUName(FXchar name[]);
97 
98 }
99 
100 #endif

Copyright © 1997-2016 Jeroen van der Zijp