]>
git.proxmox.com Git - mirror_qemu.git/blob - include/qemu/cpuid.h
1 /* cpuid.h: Macros to identify the properties of an x86 host.
3 * This work is licensed under the terms of the GNU GPL, version 2 or later.
4 * See the COPYING file in the top-level directory.
10 #ifndef CONFIG_CPUID_H
11 # error "<cpuid.h> is unusable with this compiler"
16 /* Cover the uses that we have within qemu. */
17 /* ??? Irritating that we have the same information in target/i386/. */
21 #define bit_CMOV (1 << 15)
24 #define bit_SSE2 (1 << 26)
29 #define bit_PCLMUL (1 << 1)
32 #define bit_SSE4_1 (1 << 19)
35 #define bit_MOVBE (1 << 22)
38 #define bit_OSXSAVE (1 << 27)
41 #define bit_AVX (1 << 28)
46 #define bit_BMI (1 << 3)
49 #define bit_AVX2 (1 << 5)
52 #define bit_BMI2 (1 << 8)
55 #define bit_AVX512F (1 << 16)
58 #define bit_AVX512DQ (1 << 17)
61 #define bit_AVX512BW (1 << 30)
64 #define bit_AVX512VL (1u << 31)
68 #ifndef bit_AVX512VBMI2
69 #define bit_AVX512VBMI2 (1 << 6)
72 /* Leaf 0x80000001, %ecx */
74 #define bit_LZCNT (1 << 5)
78 * Signatures for different CPU implementations as returned from Leaf 0.
81 #ifndef signature_INTEL_ecx
82 /* "Genu" "ineI" "ntel" */
83 #define signature_INTEL_ebx 0x756e6547
84 #define signature_INTEL_edx 0x49656e69
85 #define signature_INTEL_ecx 0x6c65746e
88 #ifndef signature_AMD_ecx
89 /* "Auth" "enti" "cAMD" */
90 #define signature_AMD_ebx 0x68747541
91 #define signature_AMD_edx 0x69746e65
92 #define signature_AMD_ecx 0x444d4163
95 static inline unsigned xgetbv_low(unsigned c
)
98 asm("xgetbv" : "=a"(a
), "=d"(d
) : "c"(c
));
102 #endif /* QEMU_CPUID_H */