client: misc bug fixes for CPU feature detection.

This commit is contained in:
Rom Walton 2013-09-09 12:19:18 -04:00
parent 74e12f6bcc
commit c532e1f454
1 changed files with 9 additions and 7 deletions

View File

@ -1166,17 +1166,19 @@ int get_processor_features(char* vendor, char* features, int features_size) {
FEATURE_TEST(std_supported, (std_ecx & (1 << 28)), "avx ");
}
if (is_avx_supported() && struc_ext_supported) {
FEATURE_TEST(struc_ext_supported, (struc_ebx & (1 << 5)), "avx2 ");
}
if (struc_ext_supported) {
// Structured Ext. Feature Flags
// used by newer Intel and newer AMD CPUs
FEATURE_TEST(struc_ext_supported, (struc_ebx & (1 << 0)), "fsgsbase");
FEATURE_TEST(struc_ext_supported, (struc_ebx & (1 << 3)), "bmi1");
FEATURE_TEST(struc_ext_supported, (struc_ebx & (1 << 4)), "hle");
FEATURE_TEST(struc_ext_supported, (struc_ebx & (1 << 5)), "avx2");
FEATURE_TEST(struc_ext_supported, (struc_ebx & (1 << 7)), "smep");
FEATURE_TEST(struc_ext_supported, (struc_ebx & (1 << 8)), "bmi2");
FEATURE_TEST(struc_ext_supported, (struc_ebx & (1 << 0)), "fsgsbase ");
FEATURE_TEST(struc_ext_supported, (struc_ebx & (1 << 3)), "bmi1 ");
FEATURE_TEST(struc_ext_supported, (struc_ebx & (1 << 4)), "hle ");
FEATURE_TEST(struc_ext_supported, (struc_ebx & (1 << 7)), "smep ");
FEATURE_TEST(struc_ext_supported, (struc_ebx & (1 << 8)), "bmi2 ");
}