5 Author: Pekka Riikonen <priikone@silcnet.org>
7 Copyright (C) 2008 Pekka Riikonen
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; version 2 of the License.
13 This program 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 General Public License for more details.
23 /****d* silcutil/SilcCPUIdFeatures
27 * typedef enum { ... } SilcCPUIdFeatures;
31 * CPU features. Indicates which instruction sets the CPU supports.
35 SILC_CPUID_UNKNOWN = 0x00000000, /* 386 only */
36 SILC_CPUID_386 = 0x00000002, /* 386 */
37 SILC_CPUID_MMX = 0x00000004, /* MMX */
38 SILC_CPUID_CMOV = 0x00000008, /* CMOV, FCOMI */
39 SILC_CPUID_SSE = 0x00000010, /* SSE */
40 SILC_CPUID_SSE2 = 0x00000020, /* SSE2 */
41 SILC_CPUID_SSE3 = 0x00000040, /* SSE3 */
42 SILC_CPUID_SSSE3 = 0x00000080, /* SSSE3 */
43 SILC_CPUID_SSE41 = 0x00000100, /* SSE4.1 */
44 SILC_CPUID_SSE42 = 0x00000200, /* SSE4.2 */
45 SILC_CPUID_SSE4A = 0x00000400, /* SSE4a */
46 SILC_CPUID_SSE5 = 0x00000800, /* SSE5 */
47 SILC_CPUID_AVX = 0x00001000, /* AVX */
48 SILC_CPUID_AES = 0x00002000, /* AES */
52 /****f* silcutil/silc_cpuid_features
56 * SilcCPUIdFeatures silc_cpuid_features(void);
60 * Returns the CPU instruction set features. The ID can be used to
61 * determine what features the CPU supports. The returned value is a
62 * bitmask of supported features.
66 * This function should not be called at a code path where speed is
67 * critical. It is recommended to call this once and later use the
68 * returned value to determine features.
70 * This function works only on x86 or x86-64 CPUs.
73 SilcCPUIdFeatures silc_cpuid_features(void);
75 #endif /* SILCCPUID_H */