diff options
Diffstat (limited to 'include/cpuinfo.h')
-rw-r--r-- | include/cpuinfo.h | 39 |
1 files changed, 24 insertions, 15 deletions
diff --git a/include/cpuinfo.h b/include/cpuinfo.h index 2a154c6..85ce174 100644 --- a/include/cpuinfo.h +++ b/include/cpuinfo.h @@ -46,14 +46,6 @@ #endif #endif -#if CPUINFO_ARCH_X86 && defined(_MSC_VER) - #define CPUINFO_ABI __cdecl -#elif CPUINFO_ARCH_X86 && defined(__GNUC__) - #define CPUINFO_ABI __attribute__((__cdecl__)) -#else - #define CPUINFO_ABI -#endif - /* Define other architecture-specific macros as 0 */ #ifndef CPUINFO_ARCH_X86 @@ -88,6 +80,14 @@ #define CPUINFO_ARCH_WASMSIMD 0 #endif +#if CPUINFO_ARCH_X86 && defined(_MSC_VER) + #define CPUINFO_ABI __cdecl +#elif CPUINFO_ARCH_X86 && defined(__GNUC__) + #define CPUINFO_ABI __attribute__((__cdecl__)) +#else + #define CPUINFO_ABI +#endif + #define CPUINFO_CACHE_UNIFIED 0x00000001 #define CPUINFO_CACHE_INCLUSIVE 0x00000002 #define CPUINFO_CACHE_COMPLEX_INDEXING 0x00000004 @@ -454,9 +454,9 @@ enum cpuinfo_uarch { /** Samsung Exynos M5 (Exynos 9830 big cores). */ cpuinfo_uarch_exynos_m5 = 0x00600104, - /** Deprecated synonym for Cortex-A76AE. */ + /* Deprecated synonym for Cortex-A76 */ cpuinfo_uarch_cortex_a76ae = 0x00300376, - /* Old names for Exynos. */ + /* Deprecated names for Exynos. */ cpuinfo_uarch_mongoose_m1 = 0x00600100, cpuinfo_uarch_mongoose_m2 = 0x00600101, cpuinfo_uarch_meerkat_m3 = 0x00600102, @@ -501,11 +501,11 @@ enum cpuinfo_uarch { /** Applied Micro X-Gene. */ cpuinfo_uarch_xgene = 0x00B00100, - /** Huawei hisilicon Kunpeng Series CPU. */ - cpuinfo_uarch_taishanv110 = 0x00C00100, - /* Hygon Dhyana (a modification of AMD Zen for Chinese market). */ cpuinfo_uarch_dhyana = 0x01000100, + + /** HiSilicon TaiShan v110 (Huawei Kunpeng 920 series processors). */ + cpuinfo_uarch_taishan_v110 = 0x00C00100, }; struct cpuinfo_processor { @@ -525,7 +525,7 @@ struct cpuinfo_processor { */ int linux_id; #endif -#if defined(_WIN32) +#if defined(_WIN32) || defined(__CYGWIN__) /** Windows-specific ID for the group containing the logical processor. */ uint16_t windows_group_id; /** @@ -1822,13 +1822,22 @@ const struct cpuinfo_core* CPUINFO_ABI cpuinfo_get_current_core(void); /** * Identify the microarchitecture index of the core that executes the current thread. - * If the system does not support such identification, the function return 0. + * If the system does not support such identification, the function returns 0. * * There is no guarantee that the thread will stay on the same type of core for any time. * Callers should treat the result as only a hint. */ uint32_t CPUINFO_ABI cpuinfo_get_current_uarch_index(void); +/** + * Identify the microarchitecture index of the core that executes the current thread. + * If the system does not support such identification, the function returns the user-specified default value. + * + * There is no guarantee that the thread will stay on the same type of core for any time. + * Callers should treat the result as only a hint. + */ +uint32_t CPUINFO_ABI cpuinfo_get_current_uarch_index_with_default(uint32_t default_uarch_index); + #ifdef __cplusplus } /* extern "C" */ #endif |