aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/i386/string
Commit message (Collapse)AuthorAgeFilesLines
* Remove residual blank line at start of MakefileWarner Losh2024-07-151-1/+0
| | | | | | | This is a residual of the $FreeBSD$ removal. MFC After: 3 days (though I'll just run the command on the branches) Sponsored by: Netflix
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-1618-36/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* lib/libc/string: replace ffs/fls implementations with clang builtinsRobert Clausecker2023-07-032-57/+0
| | | | | | | | | | | | | | Most architectures we support (except for riscv64) have instructions to compute these functions very quickly. Replace old code with the ffs and clz builtin functions, allowing clang to generate good code for all architectures. As a consequence, toss out arm and i386 ffs() implementations. Sponsored by: FreeBSD Foundation Approved by: mhorne MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D40730
* remove obsolete i386 MD memchr implementationEd Maste2019-09-252-62/+0
| | | | | | | | | | | | | | | bde reports (in a reply to r351700 commit mail): This uses scasb, which was last optimal on the 8086, or perhaps the original i386. On freefall, it is several times slower than the naive translation of the naive C code. Reported by: bde Reviewed by: kib, markj Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D21785 Notes: svn path=/head/; revision=352689
* amd64: depessimize userspace memcpy/memmove/bcopyMateusz Guzik2018-09-171-3/+10
| | | | | | | | | | | | | The change resembles what was done in r334537 for kernel routines. While here take care of i386 variants. Note that primitives remain suboptimal. Reviewed by: kib (previous version) Approved by: re (gjb) Differential Revision: https://reviews.freebsd.org/D17167 Notes: svn path=/head/; revision=338713
* Correct MDSRCS use in <arch>/string/Makefile.inc.Brooks Davis2017-03-021-4/+21
| | | | | | | | | | | | | | | | - Remove .c files which duplicate entries in MISRCS. - Use the same, less merge conflict prone style in all cases. - Use MDSRCS for mips (.c and .S files both ended up in SRCS). - Remove pointless sparc64 Makefile.inc. - Remove uninformative foreign VCS ID entries. Reviewed by: emaste, imp, jhb MFC after: 1 week Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D9841 Notes: svn path=/head/; revision=314556
* Renumber copyright clause 4Warner Losh2017-02-281-1/+1
| | | | | | | | | | | | Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is too pedantic, so give up on that point. Submitted by: Jan Schaumann <jschauma@stevens.edu> Pull Request: https://github.com/freebsd/freebsd/pull/96 Notes: svn path=/head/; revision=314436
* Replace the WEAK_ALIAS() alias with the WEAK_REFERENCE() alias. Use it andAndreas Tobler2013-11-212-2/+2
| | | | | | | | | get rid of the __CONCAT and CNAME macros. Reviewed by: bde, kib Notes: svn path=/head/; revision=258451
* - Correct mispellings of the word occurrenceGabor Kovesdan2013-04-173-5/+5
| | | | | | | Submitted by: Christoph Mallon <christoph.mallon@gmx.de> (via private mail) Notes: svn path=/head/; revision=249582
* Change index() and rindex() to a weak alias.Ed Schouten2012-01-052-2/+2
| | | | | | | | | | | This allows people to still write statically linked applications that call strchr() or strrchr() and have a local variable or function called index. Discussed with: bde@ Notes: svn path=/head/; revision=229571
* Merge index() and strchr() together.Ed Schouten2012-01-035-137/+7
| | | | | | | | | | | | | | | | | | | | As I looked through the C library, I noticed the FreeBSD MIPS port has a hand-written version of index(). This is nice, if it weren't for the fact that most applications call strchr() instead. Also, on the other architectures index() and strchr() are identical, meaning we have two identical pieces of code in the C library and statically linked applications. Solve this by naming the actual file strchr.[cS] and let it use __strong_reference()/STRONG_ALIAS() to provide the index() routine. Do the same for rindex()/strrchr(). This seems to make the C libraries and static binaries slightly smaller, but this reduction in size seems negligible. Notes: svn path=/head/; revision=229368
* Remove duplicate .note.GNU-stack section declaration. bcopy alreadyKonstantin Belousov2011-02-042-4/+0
| | | | | | | | | made the neccessary provisions. Reported by: arundel Notes: svn path=/head/; revision=218303
* Add section .note.GNU-stack for assembly files used by 386 and amd64.Konstantin Belousov2011-01-0722-0/+44
| | | | Notes: svn path=/head/; revision=217106
* libc: Remove the i386 assembler version of strlen(3).Jilles Tjoelker2010-10-012-55/+1
| | | | | | | | | | | | | | | | On anything modern, the C version, which processes a word at a time, is much faster. The Intel optimization manual explicitly warns against using REP prefixes with SCAS or CMPS, which is exactly what the assembler version does. A simple test on a Phenom II showed the C version, compiled with -O2, to be about twice as fast determining the length of 100000 strings between 0 and 255 bytes long. MFC after: 2 weeks Notes: svn path=/head/; revision=213326
* Add missing END() macros, as per rev 184547 for amd64. The lack of thesePeter Wemm2008-11-0221-0/+29
| | | | | | | is mostly harmless, but it does upset some of valgrind's functionality. Notes: svn path=/head/; revision=184548
* Per Regents of the University of Calfornia letter, remove advertisingWarner Losh2007-01-091-4/+0
| | | | | | | | | clause. # If I've done so improperly on a file, please let me know. Notes: svn path=/head/; revision=165903
* Eliminate an unpredictable branch from bcmp().Alan Cox2005-04-211-5/+4
| | | | | | | Reviewed by: bde Notes: svn path=/head/; revision=145383
* MFp4: Pentium/Athlon-optimised implementation of wcschr().Tim J. Robbins2003-04-052-1/+78
| | | | Notes: svn path=/head/; revision=113103
* MFp4: Pentium/Athlon-optimised implementation of wcslen().Tim J. Robbins2003-03-142-1/+69
| | | | Notes: svn path=/head/; revision=112232
* MFp4: Reduce code size by 26 bytes by only aligning the jump targets thatTim J. Robbins2003-03-121-10/+1
| | | | | | | are at the top of loops. Notes: svn path=/head/; revision=112132
* MFp4: Pentium/Athlon-optimised implementation of wmemchr().Tim J. Robbins2003-03-122-1/+115
| | | | Notes: svn path=/head/; revision=112129
* MFp4: Pentium-optimised implementation of wcscmp(). Performs significantlyTim J. Robbins2003-03-102-1/+80
| | | | | | | better than the code generated by gcc in many cases. Notes: svn path=/head/; revision=112059
* Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,Jens Schweikhardt2003-01-011-1/+1
| | | | | | | especially in troff files. Notes: svn path=/head/; revision=108533
* Eliminate superfluous memory access in memcpy(3)/memmove(3).Maxim Sobolev2002-10-151-13/+8
| | | | | | | | Obtained from: NetBSD MFC after: 1 week Notes: svn path=/head/; revision=105149
* Fix style bugs I added in last commit.Mike Silbersack2002-06-271-4/+4
| | | | | | | Spotted by: bde Notes: svn path=/head/; revision=98910
* Modify bcopy (and memcpy/memmove) so that the length value is notMike Silbersack2002-06-271-2/+4
| | | | | | | | | | | re-read from the stack mid copy. This may help mitigate the recent Apache buffer overrun and future overruns of the sort. Reviewed by: jdp MFC after: 2 days Notes: svn path=/head/; revision=98899
* Fix typo in the BSD copyright: s/withough/without/Jens Schweikhardt2002-06-0211-11/+11
| | | | | | | | Spotted and suggested by: des MFC after: 3 weeks Notes: svn path=/head/; revision=97748
* Standardize on our SCM ID style.David E. O'Brien2002-03-2319-80/+25
| | | | Notes: svn path=/head/; revision=93000
* cosmetic: spell 'cashe' as 'cache'Bill Fumerola2002-03-103-3/+3
| | | | Notes: svn path=/head/; revision=91999
* De-orbit DEFS.h - the other arches do not use it, and it got replacedPeter Wemm2001-10-2416-16/+16
| | | | | | | | | with <machine/asm.h>. Reviewed by: bde Notes: svn path=/head/; revision=85437
* Removed duplicate VCS ID tags, as per style(9).Ruslan Ermilov2001-08-1316-32/+0
| | | | Notes: svn path=/head/; revision=81586
* $Id$ -> $FreeBSD$Peter Wemm1999-08-2817-33/+33
| | | | Notes: svn path=/head/; revision=50476
* Handle machine-dependent (m-d) (string) sources more automatically.Bruce Evans1997-10-161-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | The names of m-d variants are now added (manually) to MDSRCS instead of to SRCS, and the names of all machine-independent (m-i) variants that can reasonably be replaced by an m-d variant are now added (manually) to MISRCS instead of to SRCS, so that a simple substitution can be used to discard the unused m-i variants. MISRCS is potentially all m-i sources, but the substitution is too simple to be fast, so MISRCS should be kept reasonably small. libc/Makefile.inc: Do the substitution. libc/i386/string/Makefile.inc: Add to MDSRCS instead of to SRCS. Add the names of all sources in this directory, but no others. libc/string/Makefile.inc Add to MISRCS instead of to SRCS. Add the names of all sources in this directory. Don't use (broken) explicit rules for special cases. Notes: svn path=/head/; revision=30481
* kill the undeadPeter Wemm1997-07-131-53/+0
| | | | Notes: svn path=/head/; revision=27369
* This commit was generated by cvs2svn to compensate for changes in r27180,Bruce Evans1997-07-031-0/+53
|\ | | | | | | | | | | | | which included commits to RCS files with non-trunk default branches. Notes: svn path=/head/; revision=27181
| * Import Lite2's src/lib, except for non-i386 machine-dependent directories,Bruce Evans1997-07-031-0/+53
| | | | | | | | | | | | | | | | libc/db, libc/gen/crypt.* and libtelnet. All affected files except 3 unimportant ones have already left the vendor branch. Notes: svn path=/vendor/CSRG/dist/; revision=27180
| * Import CSRG 4.4BSD-Lite2 lib/libc onto vendor branchPeter Wemm1997-03-111-0/+53
| | | | Notes: svn path=/vendor/CSRG/dist/; revision=23658
* Use separate routines for memmove() and memcpy(). This lets me dropBruce Evans1997-04-201-0/+2
| | | | | | | | | | the (buggy) support for alternative entry points. ALTENTRY() was only used for memmove(). Optimizing for space was particularly silly because memcpy() is rarely used (gcc normally inlines it). Obtained from: NetBSD Notes: svn path=/head/; revision=25045
* Use separate routines for memmove() and memcpy(). This lets me dropBruce Evans1997-04-202-94/+4
| | | | | | | | | | | the (buggy) support for alternative entry points. ALTENTRY() was only used for memmove(). Optimizing for space was particularly silly because memcpy() is rarely used (gcc normally inlines it). Obtained from: NetBSD Notes: svn path=/head/; revision=25044
* Merged with the 1996/11/12 NetBSD version:Bruce Evans1997-04-201-10/+24
| | | | | | | | | | | | | | | | | | - use a slightly less bogus copyright. This file was never contributed to Berkeley. It still claims to be copright by the Regents. - use <machine/asm.h> instead of "DEFS.h". - use RCSID($Id$) instead of explicit assembly code and messy ifdefs. The rcsid won't be put into the object file until we make RCSID() non-null. NetBSD uses a LIBC_SCCS ifdef here. We used a LIBC_RCS instead, but I want RCSID() to be controlled directly by LIBC_RCS (actually by LIB_RCS). This is the only difference with the NetBSD version. - added ifdefs to support generation of memcpy() and memmove(). The other changes are "while I'm here" to get this. - improved style of the copy backwards case. Notes: svn path=/head/; revision=25043
* Revert $FreeBSD$ to $Id$Peter Wemm1997-02-2219-37/+37
| | | | Notes: svn path=/head/; revision=22993
* Make the long-awaited change from $Id$ to $FreeBSD$Jordan K. Hubbard1997-01-1419-37/+37
| | | | | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise. Notes: svn path=/head/; revision=21673
* This commit was generated by cvs2svn to compensate for changes in r13122,Peter Wemm1995-12-301-53/+0
| | | | | | | which included commits to RCS files with non-trunk default branches. Notes: svn path=/head/; revision=13123
* Be smarter about handling overlapped copies and only go backwards if itDavid Greenman1995-12-272-12/+16
| | | | | | | | | is really necessary. Going backwards on a P6 is much slower than forwards and it's a little slower on a P5. Also moved the count mask and 'std' down a few lines - it's a couple percent faster this way on a P5. Notes: svn path=/head/; revision=13064
* First round of changes to clean up the RCSID mess in libc:David Greenman1995-01-2319-37/+56
| | | | | | | | | | | 1) Changed LIB_SCCS and SYSLIB_SCCS to LIB_RCS and SYSLIB_RCS. 2) Changed sccsid[] variables to rcsid[] 3) Moved all RCSID strings into .text 4) Converted all SCCSID's to RCS $Id$'s 5) Added missing $Id$'s after copyright. Notes: svn path=/head/; revision=5790
* Added leaner and meaner swab() function by J.T. Conklin.David Greenman1995-01-222-1/+105
| | | | Notes: svn path=/head/; revision=5780
* Fix a spelling error and add a comment about possible improvements.Bruce Evans1994-12-271-3/+17
| | | | Notes: svn path=/head/; revision=5243
* Go back to Bruce's fix with a minor change that will allow a NULL stringDavid Greenman1994-11-251-4/+3
| | | | | | | | | pointer if len is 0. I should have looked at the revision history - I would have found that Bruce already fixed the bug with len=0 over a month ago. Whoever said that the bug was in 2.0 was wrong. Notes: svn path=/head/; revision=4811
* Fixed bugs related to returning NULL if length is zero.David Greenman1994-11-251-3/+4
| | | | Notes: svn path=/head/; revision=4809