From c532e1f4547eb695e47bea5098a113d30e106a37 Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Mon, 9 Sep 2013 12:19:18 -0400 Subject: [PATCH] client: misc bug fixes for CPU feature detection. --- client/hostinfo_win.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/client/hostinfo_win.cpp b/client/hostinfo_win.cpp index fc534a33a3..7a320fd3f7 100644 --- a/client/hostinfo_win.cpp +++ b/client/hostinfo_win.cpp @@ -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 "); }