1
0
mirror of https://github.com/google/cpu_features.git synced 2025-07-05 15:00:40 +02:00

Support disabling of extensions

Fixes #101
This commit is contained in:
Guillaume Chatelet
2020-01-17 16:53:37 +01:00
parent 24b8a1de17
commit eb59787849
5 changed files with 70 additions and 0 deletions

View File

@ -140,4 +140,22 @@
#define CPU_FEATURES_COMPILED_MIPS_MSA defined(__mips_msa)
#endif
////////////////////////////////////////////////////////////////////////////////
// Miscellaneous
////////////////////////////////////////////////////////////////////////////////
#ifndef thread_local
#if __STDC_VERSION__ >= 201112 && !defined __STDC_NO_THREADS__
#define thread_local _Thread_local
#elif defined _WIN32 && (defined _MSC_VER || defined __ICL || \
defined __DMC__ || defined __BORLANDC__)
#define thread_local __declspec(thread)
/* note that ICC (linux) and Clang are covered by __GNUC__ */
#elif defined __GNUC__ || defined __SUNPRO_C || defined __xlC__
#define thread_local __thread
#else
#error "Cannot define thread_local"
#endif
#endif
#endif // CPU_FEATURES_INCLUDE_CPU_FEATURES_MACROS_H_

View File

@ -201,6 +201,8 @@ const char* GetX86FeaturesEnumName(X86FeaturesEnum);
const char* GetX86MicroarchitectureName(X86Microarchitecture);
void RegisterX86InfoInterceptor(void (*)(X86Info*));
CPU_FEATURES_END_CPP_NAMESPACE
#if !defined(CPU_FEATURES_ARCH_X86)