From cee82e70ccb7b2f054cd781b0a603ae244523e72 Mon Sep 17 00:00:00 2001 From: Stefan Liebler Date: Wed, 26 Aug 2015 10:26:22 +0200 Subject: S390: Optimize strncmp and wcsncmp. This patch provides optimized versions of strncmp and wcsncmp with the z13 vector instructions. ChangeLog: * sysdeps/s390/multiarch/strncmp-c.c: New File. * sysdeps/s390/multiarch/strncmp-vx.S: Likewise. * sysdeps/s390/multiarch/strncmp.c: Likewise. * sysdeps/s390/multiarch/wcsncmp-c.c: Likewise. * sysdeps/s390/multiarch/wcsncmp-vx.S: Likewise. * sysdeps/s390/multiarch/wcsncmp.c: Likewise. * sysdeps/s390/multiarch/Makefile (sysdep_routines): Add strncmp and wcsncmp functions. * sysdeps/s390/multiarch/ifunc-impl-list.c (__libc_ifunc_impl_list): Add ifunc test for strncmp, wcsncmp. * wcsmbs/wcsncmp.c (WCSNCMP): Define and use macro. * benchtests/bench-strncmp.c: Add wcsncmp support. * benchtests/bench-wcsncmp.c: New File. * benchtests/Makefile (wcsmbs-bench): Add wcsncmp. --- wcsmbs/wcsncmp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'wcsmbs') diff --git a/wcsmbs/wcsncmp.c b/wcsmbs/wcsncmp.c index e083ad8..4de2ca8 100644 --- a/wcsmbs/wcsncmp.c +++ b/wcsmbs/wcsncmp.c @@ -18,13 +18,16 @@ #include +#ifndef WCSNCMP +# define WCSNCMP wcsncmp +#endif /* Compare no more than N characters of S1 and S2, returning less than, equal to or greater than zero if S1 is lexicographically less than, equal to or greater than S2. */ int -wcsncmp (s1, s2, n) +WCSNCMP (s1, s2, n) const wchar_t *s1; const wchar_t *s2; size_t n; -- cgit v1.1