From 249dcdb71b79e4c488a46c9027e0014c0bc27044 Mon Sep 17 00:00:00 2001 From: Rajalakshmi Srinivasaraghavan Date: Thu, 13 Apr 2017 11:29:20 +0530 Subject: powerpc: Optimized strncat for POWER8 With new optimized strnlen for POWER8 [1], this patch adds strncat for power8 to make use of optimized strlen and strnlen. This is faster than POWER7 current implementation for larger strings. Tested on powerpc64 and powerpc64le. [1] https://sourceware.org/ml/libc-alpha/2017-03/msg00491.html * sysdeps/powerpc/powerpc64/multiarch/Makefile (sysdep_routines): Add strncat-power8. * sysdeps/powerpc/powerpc64/multiarch/strncat.c (strncat): Add __strncat_power8 to ifunc list. * sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c (strncat): Add __strncat_power8 to list of strncat functions. * sysdeps/powerpc/powerpc64/multiarch/strncat-power8.c: New file. --- .../powerpc/powerpc64/multiarch/strncat-power8.c | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 sysdeps/powerpc/powerpc64/multiarch/strncat-power8.c (limited to 'sysdeps/powerpc/powerpc64/multiarch/strncat-power8.c') diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncat-power8.c b/sysdeps/powerpc/powerpc64/multiarch/strncat-power8.c new file mode 100644 index 0000000000..1ec1259b95 --- /dev/null +++ b/sysdeps/powerpc/powerpc64/multiarch/strncat-power8.c @@ -0,0 +1,31 @@ +/* Copyright (C) 2017 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 + +#define STRNCAT __strncat_power8 + +extern __typeof (strncat) __strncat_power8 attribute_hidden; +extern __typeof (strlen) __strlen_power8 attribute_hidden; +extern __typeof (strnlen) __strnlen_power8 attribute_hidden; +extern __typeof (memcpy) __memcpy_power7 attribute_hidden; + +#define strlen __strlen_power8 +#define __strnlen __strnlen_power8 +#define memcpy __memcpy_power7 + +#include -- cgit v1.2.3