diff options
author | raji <raji@oc4354787705.ibm.com> | 2016-06-14 14:51:16 +0530 |
---|---|---|
committer | raji <raji@oc4354787705.ibm.com> | 2016-06-14 14:51:16 +0530 |
commit | c8376f3e07602aaef9cb843bb73cb5f2b860634a (patch) | |
tree | 9ba0710f8398c1299412ddefbf9a01c23c6a43ea /sysdeps/powerpc/powerpc64/multiarch/strncase.c | |
parent | a2ae1696f7c6cf269b3a734bce4d9d3620745854 (diff) | |
download | glibc-c8376f3e07602aaef9cb843bb73cb5f2b860634a.tar.gz glibc-c8376f3e07602aaef9cb843bb73cb5f2b860634a.tar.xz glibc-c8376f3e07602aaef9cb843bb73cb5f2b860634a.zip |
powerpc: strcasecmp/strncasecmp optmization for power8
This implementation utilizes vectors to improve performance compared to current byte by byte implementation for POWER7. The performance improvement is upto 4x. This patch is tested on powerpc64 and powerpc64le.
Diffstat (limited to 'sysdeps/powerpc/powerpc64/multiarch/strncase.c')
-rw-r--r-- | sysdeps/powerpc/powerpc64/multiarch/strncase.c | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strncase.c b/sysdeps/powerpc/powerpc64/multiarch/strncase.c index 2729fcea83..0bfb25c381 100644 --- a/sysdeps/powerpc/powerpc64/multiarch/strncase.c +++ b/sysdeps/powerpc/powerpc64/multiarch/strncase.c @@ -16,26 +16,21 @@ License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ -#if IS_IN (libc) -# include <string.h> -# define strncasecmp __strncasecmp_ppc -extern __typeof (__strncasecmp) __strncasecmp_ppc attribute_hidden; -extern __typeof (__strncasecmp) __strncasecmp_power7 attribute_hidden; -#endif +#include <string.h> +#include <shlib-compat.h> +#include "init-arch.h" -#include <string/strncase.c> -#undef strncasecmp +extern __typeof (__strncasecmp) __libc_strncasecmp; -#if IS_IN (libc) -# include <shlib-compat.h> -# include "init-arch.h" +extern __typeof (__strncasecmp) __strncasecmp_ppc attribute_hidden; +extern __typeof (__strncasecmp) __strncasecmp_power7 attribute_hidden; +extern __typeof (__strncasecmp) __strncasecmp_power8 attribute_hidden; -/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle - ifunc symbol properly. */ -extern __typeof (__strncasecmp) __libc_strncasecmp; libc_ifunc (__libc_strncasecmp, + (hwcap2 & PPC_FEATURE2_ARCH_2_07) + ? __strncasecmp_power8: (hwcap & PPC_FEATURE_HAS_VSX) ? __strncasecmp_power7 : __strncasecmp_ppc); + weak_alias (__libc_strncasecmp, strncasecmp) -#endif |