From 05f3633da4f9df870d04dd77336e793746e57ed4 Mon Sep 17 00:00:00 2001 From: Ling Ma Date: Mon, 14 Jul 2014 00:02:52 -0400 Subject: Improve 64bit memcpy performance for Haswell CPU with AVX instruction 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 instruction. The CPU2006 403.gcc benchmark indicates this patch improves performance from 2% to 10%. --- sysdeps/x86_64/multiarch/memmove_chk.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sysdeps/x86_64/multiarch/memmove_chk.c') diff --git a/sysdeps/x86_64/multiarch/memmove_chk.c b/sysdeps/x86_64/multiarch/memmove_chk.c index cb1acb6598..44344f2820 100644 --- a/sysdeps/x86_64/multiarch/memmove_chk.c +++ b/sysdeps/x86_64/multiarch/memmove_chk.c @@ -25,11 +25,13 @@ extern __typeof (__memmove_chk) __memmove_chk_sse2 attribute_hidden; extern __typeof (__memmove_chk) __memmove_chk_ssse3 attribute_hidden; extern __typeof (__memmove_chk) __memmove_chk_ssse3_back attribute_hidden; +extern __typeof (__memmove_chk) __memmove_chk_avx_unaligned attribute_hidden; #include "debug/memmove_chk.c" libc_ifunc (__memmove_chk, - HAS_SSSE3 + HAS_AVX ? __memmove_chk_avx_unaligned : + (HAS_SSSE3 ? (HAS_FAST_COPY_BACKWARD ? __memmove_chk_ssse3_back : __memmove_chk_ssse3) - : __memmove_chk_sse2); + : __memmove_chk_sse2)); -- cgit 1.4.1