glibc/sysdeps
Wilco Dijkstra d3496c9f4f Improve generic strcspn performance
Improve strcspn performance using a much faster algorithm.  It is kept simple
so it works well on most targets.  It is generally at least 10 times faster
than the existing implementation on bench-strcspn on a few AArch64
implementations, and for some tests 100 times as fast (repeatedly calling
strchr on a small string is extremely slow...).

In fact the string/bits/string2.h inlines make no longer sense, as GCC
already uses strlen if reject is an empty string, strchrnul is 5 times as
fast as __strcspn_c1, while __strcspn_c2 and __strcspn_c3 are slower than
the strcspn main loop for large strings (though reject length 2-4 could be
special cased in the future to gain even more performance).

Tested on x86_64, i686, and aarch64.

	* string/Version (libc): Add GLIBC_2.24.
	* string/strcspn.c (strcspn): Rewrite function.
	* string/bits/string2.h (strcspn): Use __builtin_strcspn.
	(__strcspn_c1): Remove inline function.
	(__strcspn_c2): Likewise.
	(__strcspn_c3): Likewise.
	* string/string-inline.c
	[SHLIB_COMPAT(libc, GLIBC_2_1_1, GLIBC_2_24)] (__strcspn_c1): Add
	compatibility symbol.
	[SHLIB_COMPAT(libc, GLIBC_2_1_1, GLIBC_2_24)] (__strcspn_c2):
	Likewise.
	[SHLIB_COMPAT(libc, GLIBC_2_1_1, GLIBC_2_24)] (__strcspn_c3):
	Likewise.
	* sysdeps/i386/string-inlines.c: Include generic string-inlines.c.
2016-04-01 10:44:40 -03:00
..
aarch64
alpha
arm Fix building glibc master with NDEBUG and --with-cpu. 2016-03-15 23:23:24 -04:00
generic hurd: Do not hide rtld symbols which need to be preempted 2016-03-20 19:51:42 +01:00
gnu
hppa
i386 Improve generic strcspn performance 2016-04-01 10:44:40 -03:00
ia64
ieee754 Increase internal precision of ldbl-128ibm decimal printf [BZ #19853] 2016-03-31 12:14:33 -05:00
init_array
m68k
mach hurd: Add c++-types expected result 2016-03-20 22:16:34 +01:00
microblaze
mips
nacl
nios2
nptl
posix Fix flag test in waitid compatibility layer 2016-03-13 21:44:09 +01:00
powerpc powerpc: Rearrange cfi_offset calls 2016-03-11 11:31:58 -03:00
pthread
s390 S390: Use ahi instead of aghi in 32bit _dl_runtime_resolve. 2016-04-01 10:42:54 +02:00
sh
sparc
tile
unix [microblaze] Remove __ASSUME_FUTIMESAT. 2016-03-29 22:13:36 +00:00
wordsize-32
wordsize-64
x86 Initial Enhanced REP MOVSB/STOSB (ERMS) support 2016-03-28 19:23:31 -07:00
x86_64 Add x86-64 memset with unaligned store and rep stosb 2016-03-31 10:06:07 -07:00