diff options
author | Andrew Senkevich <andrew.senkevich@intel.com> | 2015-12-19 02:47:28 +0300 |
---|---|---|
committer | Andrew Senkevich <andrew.senkevich@intel.com> | 2015-12-19 02:47:28 +0300 |
commit | 83d776f979342f923b5c3d2a5b43afab841c6086 (patch) | |
tree | 180682939f88351b00817f2092e24817ddbdf07f /sysdeps/x86 | |
parent | 794950ed1d29853158d783d57f72260f5665afe5 (diff) | |
download | glibc-83d776f979342f923b5c3d2a5b43afab841c6086.tar.gz glibc-83d776f979342f923b5c3d2a5b43afab841c6086.tar.xz glibc-83d776f979342f923b5c3d2a5b43afab841c6086.zip |
Added memset optimized with AVX512 for KNL hardware.
It shows improvement up to 28% over AVX2 memset (performance results attached at <https://sourceware.org/ml/libc-alpha/2015-12/msg00052.html>). * sysdeps/x86_64/multiarch/memset-avx512-no-vzeroupper.S: New file. * sysdeps/x86_64/multiarch/Makefile (sysdep_routines): Added new file. * sysdeps/x86_64/multiarch/ifunc-impl-list.c: Added new tests. * sysdeps/x86_64/multiarch/memset.S: Added new IFUNC branch. * sysdeps/x86_64/multiarch/memset_chk.S: Likewise. * sysdeps/x86/cpu-features.h (bit_Prefer_No_VZEROUPPER, index_Prefer_No_VZEROUPPER): New. * sysdeps/x86/cpu-features.c (init_cpu_features): Set the Prefer_No_VZEROUPPER for Knights Landing.
Diffstat (limited to 'sysdeps/x86')
-rw-r--r-- | sysdeps/x86/cpu-features.c | 2 | ||||
-rw-r--r-- | sysdeps/x86/cpu-features.h | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/sysdeps/x86/cpu-features.c b/sysdeps/x86/cpu-features.c index aff894cc1e..35051d705e 100644 --- a/sysdeps/x86/cpu-features.c +++ b/sysdeps/x86/cpu-features.c @@ -80,6 +80,8 @@ init_cpu_features (struct cpu_features *cpu_features) case 0x57: /* Knights Landing. Enable Silvermont optimizations. */ + cpu_features->feature[index_Prefer_No_VZEROUPPER] + |= bit_Prefer_No_VZEROUPPER; case 0x37: case 0x4a: diff --git a/sysdeps/x86/cpu-features.h b/sysdeps/x86/cpu-features.h index 93bee69eaf..5e09a2ab05 100644 --- a/sysdeps/x86/cpu-features.h +++ b/sysdeps/x86/cpu-features.h @@ -34,6 +34,7 @@ #define bit_I586 (1 << 14) #define bit_I686 (1 << 15) #define bit_Prefer_MAP_32BIT_EXEC (1 << 16) +#define bit_Prefer_No_VZEROUPPER (1 << 17) /* CPUID Feature flags. */ @@ -99,6 +100,8 @@ # define index_I586 FEATURE_INDEX_1*FEATURE_SIZE # define index_I686 FEATURE_INDEX_1*FEATURE_SIZE # define index_Prefer_MAP_32BIT_EXEC FEATURE_INDEX_1*FEATURE_SIZE +# define index_Prefer_No_VZEROUPPER FEATURE_INDEX_1*FEATURE_SIZE + # if defined (_LIBC) && !IS_IN (nonlib) # ifdef __x86_64__ @@ -251,6 +254,7 @@ extern const struct cpu_features *__get_cpu_features (void) # define index_I586 FEATURE_INDEX_1 # define index_I686 FEATURE_INDEX_1 # define index_Prefer_MAP_32BIT_EXEC FEATURE_INDEX_1 +# define index_Prefer_No_VZEROUPPER FEATURE_INDEX_1 #endif /* !__ASSEMBLER__ */ |