freebsd-skq/lib/libc/string
delphij ae5ae700da Two optimizations to MI strlen(3) inspired by David S. Miller's
blog posting [1].

 - Use word-sized test for unaligned pointer before working
   the hard way.

   Memory page boundary is always integral multiple of a word
   alignment boundary.  Therefore, if we can access memory
   referenced by pointer p, then (p & ~word mask) must be also
   accessible.

 - Better utilization of multi-issue processor's ability of
   concurrency.

   The previous implementation utilized a formular that must be
   executed sequentially.  However, the ~, & and - operations can
   actually be caculated at the same time when the operand were
   different and unrelated.

   The original Hacker's Delight formular also offered consistent
   performance regardless whether the input would contain
   characters with their highest-bit set, as it catches real
   nul characters only.

These two optimizations has shown further improvements over the
previous implementation on microbenchmarks on i386 and amd64 CPU
including Pentium 4, Core Duo 2 and i7.

[1] http://vger.kernel.org/~davem/cgi-bin/blog.cgi/2010/03/08#strlen_1

MFC after:	1 month
2010-03-12 21:14:56 +00:00
..
bcmp.3
bcmp.c
bcopy.3
bcopy.c
bstring.3
bzero.3
bzero.c
ffs.3 Document that ffsll(3) and flsll(3) functions first appeared in 2009-01-13 13:19:42 +00:00
ffs.c
ffsl.c Fix style. 2008-11-03 10:14:47 +00:00
ffsll.c Add the ffsll and flsll functions. These are ffs and fls operating 2008-11-03 10:22:19 +00:00
fls.c
flsl.c
flsll.c Add the ffsll and flsll functions. These are ffs and fls operating 2008-11-03 10:22:19 +00:00
index.3
index.c
Makefile.inc Add wcpcpy(3) and wcpncpy(3). 2009-03-04 06:01:27 +00:00
memccpy.3 Mark up "unsigned char". 2010-02-04 11:23:28 +00:00
memccpy.c - ANSIfy function definitions 2009-02-03 17:58:20 +00:00
memchr.3 Mark up "unsigned char". 2010-02-04 11:23:28 +00:00
memchr.c Make sure the comparison is done with an unsigned char. 2009-02-07 19:34:44 +00:00
memcmp.3 Mark up "unsigned char". 2010-02-04 11:23:28 +00:00
memcmp.c - ANSIfy function definitions 2009-02-03 17:58:20 +00:00
memcpy.3 Add wide character variants of string manipulations routines to 'SEE ALSO'. 2009-04-07 13:42:53 +00:00
memcpy.c
memmem.3
memmem.c - ANSIfy function definitions 2009-02-03 17:58:20 +00:00
memmove.3 Add wide character variants of string manipulations routines to 'SEE ALSO'. 2009-04-07 13:42:53 +00:00
memmove.c
memrchr.c Add memrchr(3). 2008-04-10 00:12:44 +00:00
memset.3 Mark up "unsigned char". 2010-02-04 11:23:28 +00:00
memset.c
rindex.c
stpcpy.c Add restrict qualifiers. 2009-02-28 06:05:37 +00:00
stpncpy.c - Add getdelim(), getline(), stpncpy(), strnlen(), wcsnlen(), 2009-02-28 06:00:58 +00:00
strcasecmp.3 Add wide character variants of string manipulations routines to 'SEE ALSO'. 2009-04-07 13:42:53 +00:00
strcasecmp.c - ANSIfy function definitions 2009-02-03 17:58:20 +00:00
strcasestr.c - ANSIfy function definitions 2009-02-03 17:58:20 +00:00
strcat.3 Add an .Nm for strncat. 2009-12-01 07:28:56 +00:00
strcat.c
strchr.3 Add wide character variants of string manipulations routines to 'SEE ALSO'. 2009-04-07 13:42:53 +00:00
strchr.c
strcmp.3 Add a missing word to a sentence in the return values section. 2009-12-04 09:20:20 +00:00
strcmp.c - ANSIfy function definitions 2009-02-03 17:58:20 +00:00
strcoll.3
strcoll.c - ANSIfy function definitions 2009-02-03 17:58:20 +00:00
strcpy.3 Add wide character variants of string manipulations routines to 'SEE ALSO'. 2009-04-07 13:42:53 +00:00
strcpy.c
strcspn.3 Per Regents of the University of Calfornia letter, remove advertising 2007-01-09 00:28:16 +00:00
strcspn.c
strdup.3 Add wide character variants of string manipulations routines to 'SEE ALSO'. 2009-04-07 13:42:53 +00:00
strdup.c - ANSIfy function definitions 2009-02-03 17:58:20 +00:00
strerror.3
strerror.c
string.3
strlcat.c Add restrict qualifiers to the parameters to strlcpy() and strlcat(). 2009-02-28 05:15:02 +00:00
strlcpy.3 Add wide character variants of string manipulations routines to 'SEE ALSO'. 2009-04-07 13:42:53 +00:00
strlcpy.c Add restrict qualifiers to the parameters to strlcpy() and strlcat(). 2009-02-28 05:15:02 +00:00
strlen.3 Add wide character variants of string manipulations routines to 'SEE ALSO'. 2009-04-07 13:42:53 +00:00
strlen.c Two optimizations to MI strlen(3) inspired by David S. Miller's 2010-03-12 21:14:56 +00:00
strmode.3 There is no way for strmode(3) to append '+' if the file has ACL, 2009-04-14 11:39:56 +00:00
strmode.c There is no way for strmode(3) to append '+' if the file has ACL, 2009-04-14 11:39:56 +00:00
strncat.c
strncmp.c - ANSIfy function definitions 2009-02-03 17:58:20 +00:00
strncpy.c - ANSIfy function definitions 2009-02-03 17:58:20 +00:00
strndup.c Implement strndup(3) using strnlen(3). 2010-02-02 19:02:08 +00:00
strnlen.c - Add getdelim(), getline(), stpncpy(), strnlen(), wcsnlen(), 2009-02-28 06:00:58 +00:00
strnstr.c - ANSIfy function definitions 2009-02-03 17:58:20 +00:00
strpbrk.3 Add wide character variants of string manipulations routines to 'SEE ALSO'. 2009-04-07 13:42:53 +00:00
strpbrk.c - ANSIfy function definitions 2009-02-03 17:58:20 +00:00
strrchr.c
strsep.3 Add an easier example. 2008-12-05 15:50:59 +00:00
strsep.c - ANSIfy function definitions 2009-02-03 17:58:20 +00:00
strsignal.c Make strsignal(3) thread-safe. 2010-01-24 10:35:26 +00:00
strspn.3 Add wide character variants of string manipulations routines to 'SEE ALSO'. 2009-04-07 13:42:53 +00:00
strspn.c
strstr.3 Add wide character variants of string manipulations routines to 'SEE ALSO'. 2009-04-07 13:42:53 +00:00
strstr.c - ANSIfy function definitions 2009-02-03 17:58:20 +00:00
strtok.3 Remove license clause 3 to agree with the now-standard BSD license. 2007-12-12 18:33:06 +00:00
strtok.c Remove license clause 3 to agree with the now-standard BSD license. 2007-12-12 18:33:06 +00:00
strxfrm.3
strxfrm.c Further simplify the code. 2008-10-19 09:10:44 +00:00
swab.3
swab.c
Symbol.map Add wcpcpy(3) and wcpncpy(3). 2009-03-04 06:01:27 +00:00
wcpcpy.c Add wcpcpy(3) and wcpncpy(3). 2009-03-04 06:01:27 +00:00
wcpncpy.c Add wcpcpy(3) and wcpncpy(3). 2009-03-04 06:01:27 +00:00
wcscasecmp.c - Add getdelim(), getline(), stpncpy(), strnlen(), wcsnlen(), 2009-02-28 06:00:58 +00:00
wcscat.c - ANSIfy function definitions 2009-02-03 17:58:20 +00:00
wcschr.c
wcscmp.c - ANSIfy function definitions 2009-02-03 17:58:20 +00:00
wcscoll.3
wcscoll.c
wcscpy.c - ANSIfy function definitions 2009-02-03 17:58:20 +00:00
wcscspn.c - ANSIfy function definitions 2009-02-03 17:58:20 +00:00
wcsdup.c
wcslcat.c - ANSIfy function definitions 2009-02-03 17:58:20 +00:00
wcslcpy.c - ANSIfy function definitions 2009-02-03 17:58:20 +00:00
wcslen.c - ANSIfy function definitions 2009-02-03 17:58:20 +00:00
wcsncasecmp.c - Add getdelim(), getline(), stpncpy(), strnlen(), wcsnlen(), 2009-02-28 06:00:58 +00:00
wcsncat.c - ANSIfy function definitions 2009-02-03 17:58:20 +00:00
wcsncmp.c - ANSIfy function definitions 2009-02-03 17:58:20 +00:00
wcsncpy.c
wcsnlen.c - Add getdelim(), getline(), stpncpy(), strnlen(), wcsnlen(), 2009-02-28 06:00:58 +00:00
wcspbrk.c - ANSIfy function definitions 2009-02-03 17:58:20 +00:00
wcsrchr.c
wcsspn.c - ANSIfy function definitions 2009-02-03 17:58:20 +00:00
wcsstr.c - ANSIfy function definitions 2009-02-03 17:58:20 +00:00
wcstok.3
wcstok.c Remove license clause 3 to agree with the now-standard BSD license. 2007-12-12 18:33:06 +00:00
wcswidth.3
wcswidth.c
wcsxfrm.3
wcsxfrm.c
wmemchr.3 Add wcpcpy(3) and wcpncpy(3). 2009-03-04 06:01:27 +00:00
wmemchr.c - ANSIfy function definitions 2009-02-03 17:58:20 +00:00
wmemcmp.c - ANSIfy function definitions 2009-02-03 17:58:20 +00:00
wmemcpy.c - ANSIfy function definitions 2009-02-03 17:58:20 +00:00
wmemmove.c - ANSIfy function definitions 2009-02-03 17:58:20 +00:00
wmemset.c Fix the functions to match prototypes. The K&R definitions differ 2009-02-03 20:25:36 +00:00