about summary refs log tree commit diff
path: root/sysdeps/x86_64/multiarch/mempcpy-avx-unaligned.S
diff options
context:
space:
mode:
authorLing Ma <ling.ml@alibaba-inc.com>2014-07-14 00:02:52 -0400
committerH.J. Lu <hjl.tools@gmail.com>2014-07-30 08:02:35 -0700
commit05f3633da4f9df870d04dd77336e793746e57ed4 (patch)
treebd980df4702ffd9ebfa9cb4dac8823a659f0c430 /sysdeps/x86_64/multiarch/mempcpy-avx-unaligned.S
parenta53fbd8e6cd2f69bdfa3431d616a5f332aea6664 (diff)
downloadglibc-05f3633da4f9df870d04dd77336e793746e57ed4.tar.gz
glibc-05f3633da4f9df870d04dd77336e793746e57ed4.tar.xz
glibc-05f3633da4f9df870d04dd77336e793746e57ed4.zip
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%.
Diffstat (limited to 'sysdeps/x86_64/multiarch/mempcpy-avx-unaligned.S')
-rw-r--r--sysdeps/x86_64/multiarch/mempcpy-avx-unaligned.S22
1 files changed, 22 insertions, 0 deletions
diff --git a/sysdeps/x86_64/multiarch/mempcpy-avx-unaligned.S b/sysdeps/x86_64/multiarch/mempcpy-avx-unaligned.S
new file mode 100644
index 0000000000..438bda386d
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/mempcpy-avx-unaligned.S
@@ -0,0 +1,22 @@
+/* mempcpy with AVX
+   Copyright (C) 2014 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#define USE_AS_MEMPCPY
+#define MEMCPY		__mempcpy_avx_unaligned
+#define MEMCPY_CHK	__mempcpy_chk_avx_unaligned
+#include "memcpy-avx-unaligned.S"