From 17762f662582f72bbbc82b445e9113dbff01f46f Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Fri, 20 Jun 2014 12:55:16 -0500 Subject: PowerPC: optimized memmove for POWER7/PPC64 This patch adds an optimized memmove optimization for POWER7/powerpc64. Basically the idea is to use the memcpy for POWER7 on non-overlapped memory regions and a optimized backward memcpy for memory regions that overlap (similar to the idea of string/memmove.c). The backward memcpy algorithm used is similar the one use for memcpy for POWER7, with adjustments done for alignment. The difference is memory is always aligned to 16 bytes before using VSX/altivec instructions. --- sysdeps/powerpc/powerpc64/multiarch/bcopy-ppc64.c | 25 +++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 sysdeps/powerpc/powerpc64/multiarch/bcopy-ppc64.c (limited to 'sysdeps/powerpc/powerpc64/multiarch/bcopy-ppc64.c') diff --git a/sysdeps/powerpc/powerpc64/multiarch/bcopy-ppc64.c b/sysdeps/powerpc/powerpc64/multiarch/bcopy-ppc64.c new file mode 100644 index 0000000000..f8d5aa5acd --- /dev/null +++ b/sysdeps/powerpc/powerpc64/multiarch/bcopy-ppc64.c @@ -0,0 +1,25 @@ +/* PowerPC64 default bcopy. + 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 + . */ + +#include + +extern __typeof (bcopy) __bcopy_ppc attribute_hidden; + +#define bcopy __bcopy_ppc + +#include -- cgit 1.4.1