avx512: CPU detection and platform hints

This commit is contained in:
Matthew Barr
2016-10-04 11:18:10 +11:00
parent 8a56d16d57
commit 91db20d8eb
12 changed files with 164 additions and 27 deletions

View File

@@ -363,7 +363,8 @@ static const unsigned validModes[] = {
// Mode bits for switching off various architecture features
static const unsigned long long featureMask[] = {
~0ULL, /* native */
~HS_CPU_FEATURES_AVX2, /* no avx2 */
~(HS_CPU_FEATURES_AVX2 | HS_CPU_FEATURES_AVX512), /* no avx2 */
~HS_CPU_FEATURES_AVX512, /* no avx512 */
};
INSTANTIATE_TEST_CASE_P(Single,

View File

@@ -52,6 +52,10 @@ TEST(DB, flagsToPlatform) {
p.cpu_features |= HS_CPU_FEATURES_AVX2;
#endif
#if defined(HAVE_AVX512)
p.cpu_features |= HS_CPU_FEATURES_AVX512;
#endif
platform_t pp = target_to_platform(target_t(p));
ASSERT_EQ(pp, hs_current_platform);
}