about summary refs log tree commit diff
path: root/sysdeps/x86_64/multiarch/Makefile
diff options
context:
space:
mode:
authorLing Ma <ling.ml@alibaba-inc.com>2014-06-19 13:00:56 -0700
committerH.J. Lu <hjl.tools@gmail.com>2014-06-19 15:14:08 -0700
commit5c74e47cd628a6fcd2e4eba021301e275f8a95a3 (patch)
treeb85959ae1a65bc526d683807213027115886d96d /sysdeps/x86_64/multiarch/Makefile
parent4d43ef1e7434d7d419afbcd754931cb0c794763c (diff)
downloadglibc-5c74e47cd628a6fcd2e4eba021301e275f8a95a3.tar.gz
glibc-5c74e47cd628a6fcd2e4eba021301e275f8a95a3.tar.xz
glibc-5c74e47cd628a6fcd2e4eba021301e275f8a95a3.zip
Add x86_64 memset optimized for AVX2
In this patch we take advantage of HSW memory bandwidth, manage to
reduce miss branch prediction by avoiding using branch instructions and
force destination to be aligned with avx & avx2 instruction.

The CPU2006 403.gcc benchmark indicates this patch improves performance
from 26% to 59%.

	* sysdeps/x86_64/multiarch/Makefile: Add memset-avx2.
	* sysdeps/x86_64/multiarch/memset-avx2.S: New file.
	* sysdeps/x86_64/multiarch/memset.S: Likewise.
	* sysdeps/x86_64/multiarch/memset_chk.S: Likewise.
	* sysdeps/x86_64/multiarch/rtld-memset.S: Likewise.
Diffstat (limited to 'sysdeps/x86_64/multiarch/Makefile')
-rw-r--r--sysdeps/x86_64/multiarch/Makefile4
1 files changed, 3 insertions, 1 deletions
diff --git a/sysdeps/x86_64/multiarch/Makefile b/sysdeps/x86_64/multiarch/Makefile
index 57a3c13e8a..42df96f636 100644
--- a/sysdeps/x86_64/multiarch/Makefile
+++ b/sysdeps/x86_64/multiarch/Makefile
@@ -17,7 +17,9 @@ sysdep_routines += strncat-c stpncpy-c strncpy-c strcmp-ssse3 \
 		   strcpy-sse2-unaligned strncpy-sse2-unaligned \
 		   stpcpy-sse2-unaligned stpncpy-sse2-unaligned \
 		   strcat-sse2-unaligned strncat-sse2-unaligned \
-		   strchr-sse2-no-bsf memcmp-ssse3 strstr-sse2-unaligned
+		   strchr-sse2-no-bsf memcmp-ssse3 strstr-sse2-unaligned \
+		   memset-avx2
+
 ifeq (yes,$(config-cflags-sse4))
 sysdep_routines += strcspn-c strpbrk-c strspn-c varshift
 CFLAGS-varshift.c += -msse4