summaryrefslogtreecommitdiffstats
path: root/libc/string
Commit message (Collapse)AuthorAgeFilesLines
* string: remove unused variableBernhard Reutner-Fischer2011-05-031-3/+1
| | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* str[n]casecmp.c: fix hidden usagePeter S. Mazinger2011-03-102-2/+2
| | | | | | Provide visible str[n]casecmp[_l], wcs[n]casecmp[_l]. Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
* remove unused hidden functionsPeter S. Mazinger2011-03-094-10/+7
| | | | Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
* frv/memset.S: add missing libc_hidden_defPeter S. Mazinger2011-03-091-0/+1
| | | | Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
* memmem.c, string.h: remove unused hidden memmemPeter S. Mazinger2011-03-092-2/+0
| | | | | | It is used only by gen_collate, not included into libc. Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
* _collate.c: remove duplicated libc_hidden_proto() for strcoll*/wcscoll*Peter S. Mazinger2011-03-091-1/+0
| | | | Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
* wchar.h, _collate.c, strlcpy.c: use a common prototype of __wcslcpyPeter S. Mazinger2011-03-092-18/+5
| | | | Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
* ctype.c, _collate.c, str[n]casecmp.c, strlcpy.c: remove unused hidden functionsPeter S. Mazinger2011-03-094-5/+12
| | | | Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
* guard *_chk() related stuff with UCLIBC_HAS_FORTIFYPeter S. Mazinger2011-03-092-7/+3
| | | | | | | | | | | | Guard x86_64 memset_chk/memcpy_chk be guarded by UCLIBC_HAS_FORTIFY. Compile ssp.c if one of SSP/FORTIFY is defined. Guard __chk_fail() with UCLIBC_HAS_FORTIFY and move its prototype to libc-internal.h. Disable _FORTIFY_SOURCE if UCLIBC_HAS_FORTIFY is not set. The config option itself is omitted on purpose, headers need to be reviewed and generic *_chk() functions need to be first provided. Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
* simplify ffs* codePeter S. Mazinger2011-03-062-16/+9
| | | | | | Remove __libc_ffs*, unneeded Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
* Implement ffsl and ffsll.Bernd Schmidt2011-03-052-6/+50
| | | | | | | | | This imports and adapts ffsll.c from glibc. The same mechanism as in glibc is used to choose between ffs and ffsll to implement ffsl. The single user in libc is changed to use the hidden version __libc_ffs. Signed-off-by: Bernd Schmidt <bernds@codesourcery.com> Acked-by: Bernhard Reutner-Fischer <aldot@uclibc.org>
* strcpy: remove unneeded includes from the generic versionPeter S. Mazinger2011-03-031-3/+0
| | | | Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
* sh: fix memcpy saving/restoring FR12-FR15 registersGiuseppe Cavallaro2010-12-141-3/+15
| | | | | | | | | | | | This patch fixes a bug in the memcpy that doesn't save/restore the FR12-FR15 registers (callee save registers in ST40 ABI) while copying many cache lines with FPU in single paired precision mode and by using all FPU registers (DR and XD). Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> Reviewed-by: Carmelo Amoroso <carmelo.amoroso@st.com> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* microblaze: optimized memcpy/memmoveSteven J. Magnani2010-11-103-0/+687
| | | | | | | Port optimized memcpy/memmove from the kernel. Signed-off-by: Steven J. Magnani <steve@digidescorp.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* sh: update the memcpy adding a new loop with aggressive prefetchingSalvatore Cro2010-09-151-21/+107
| | | | | | | | | | | | | | | | After exploring different prefetch distance-degree combinations in this new update of the memcpy function, a new loop has been added for moving many cache lines with an aggressive prefetching schema. Prefetch has been removed when move few cache line aligned blocks. As final result, this memcpy gives us the same performances for small sizes (we already had!) and better numbers for big copies. In case of SH4-300 CPU Series, benchmarks show a gain of ~20% for sizes from 4KiB to 256KiB. In case of the SH4-200, there is a gain of ~40% for sizes bigger than 32KiB. Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* sh: move data without fetching cache block within the memsetSalvatore Cro2010-09-151-28/+34
| | | | | | | | | | | | | | | | | | | | | | | With this patch the movca.l instruction is used within the memset. The current memset implementation only uses the FPU and there is an real gain for all the sizes. Adding the movca.l instruction numbers always are better than the generic code. There is a big gain for size greater than 64 KiB but number are worst for 4-32KiB sizes compared with the implementation without movca.l. Time Memory Bandwidth (Mbytes) ------------------------------------------------- Generic SH4 SH4 (FPU) (FPU+movca.l) ------------------------------------------------- 512 1143 1998 1596 1 KiB 1273 2567 1915 2 KiB 1350 2993 2128 4-32KiB 1391 3262 2252 64KiB-16MiB 170 186 *830* Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* use uniform form of C99 keywordsBernhard Reutner-Fischer2010-06-241-10/+10
| | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* sh4: Fixes for SH-4 without an FPUCarmelo Amoroso2010-06-143-3/+7
| | | | | | | | This patch disables SH-4 optimizations that rely on the FPU when building for variants that don't have an FPU, such as SH-4AL. Signed-off-by: Andrew Stubbs <ams@codesourcery.com> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* strverscmp: I forgot to export itDenys Vlasenko2010-06-041-0/+1
| | | | | | | | | | | Result was: strverscmp.o: 000000ec T __GI_strverscmp i.e. no plain "strverscmp"! Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* Merge commit 'origin/master' into nptlAustin Foxley2010-04-021-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | Conflicts: Makefile.in extra/Configs/Config.in libc/sysdeps/linux/common/bits/kernel-features.h libc/sysdeps/linux/common/poll.c libc/sysdeps/linux/common/sysdep.h libc/sysdeps/linux/sh/sysdep.h Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
| * prettify make cleanBernhard Reutner-Fischer2010-03-251-2/+2
| | | | | | | | Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
| * libc_sh: Update memcpy to use the ENTRY macroCarmelo Amoroso2010-02-101-8/+3
| | | | | | | | | | | | Use the ENTRY macro now available through the sysdep.h header Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* | Merge commit 'origin/master' into nptlAustin Foxley2009-12-194-1/+7
|\| | | | | | | | | | | | | | | Conflicts: libc/signal/sigpause.c libc/string/x86_64/memset.S Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
| * x86_64: fix multiple definition of chk functionsAustin Foxley2009-12-194-1/+7
| | | | | | | | | | | | also enable __chk_fail and only try to call it when SSP is on Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
| * build: Get rids of PIC macro using compiler flag __PIC__ insteadCarmelo Amoroso2009-12-162-3/+3
| | | | | | | | | | | | | | Based on Peter Mazinger's comments on a recent commit, I decided to get rids of all occurrences of PIC changing them to __PIC__ Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
| * sh: fix endianess and optimise the SH4 memcpyGiuseppe Cavallaro2009-12-141-2/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes the big-endian code and adds a new optimization only for little endian mode. This optimization is based on prefetching and 64bit data transfer via FPU. Tests shows that ---------------------------------------- Memory bandwidth | Gain | sh4-300 | sh4-200 ---------------------------------------- 512 bytes to 16KiB | ~20% | ~25% from 32KiB to 16MiB | ~190% | ~5% ---------------------------------------- Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* | build: Get rids of PIC macro using compiler flag __PIC__ insteadCarmelo Amoroso2009-12-162-3/+3
| | | | | | | | | | | | | | Based on Peter Mazinger's comments on a recent commit, I decided to get rids of all occurrences of PIC changing them to __PIC__ Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* | sh: Add new optimisation to the SH4 memcpyAustin Foxley2009-11-228-11/+553
|/ | | | | | | | | | | | | | | | | | | This optimization is based on prefetching and 64bit data transfer via FPU (only for the little endianess) Tests shows that: ---------------------------------------- Memory bandwidth | Gain | sh4-300 | sh4-200 ---------------------------------------- 512 bytes to 16KiB | ~20% | ~25% from 32KiB to 16MiB | ~190% | ~5% ---------------------------------------- Signed-off-by: Austin Foxley <austinf@cetoncorp.com> Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* drop __BCC__ cruft from string codeMike Frysinger2009-10-1014-131/+11
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* remove a few more empty #if/#endif pairsDenys Vlasenko2009-09-192-7/+2
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* convert // comments to /**/; remove empty #if/#endif pairs. no code changesDenys Vlasenko2009-09-189-16/+6
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* trim Experimentally off and uncommented hiddenBernhard Reutner-Fischer2009-09-1863-128/+0
| | | | | | | | sed -i -e '/Experimentally off - /d' $(grep -rl "Experimentally off - " *) sed -i -e '/^\/\*[[:space:]]*libc_hidden_proto(/d' $(grep -rl "libc_hidden_proto" *) should be a nop Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* strsignal.c: whitespace fixes, no code changes (verified with objdump)Denys Vlasenko2009-09-091-21/+17
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* support building out-of-treeBernhard Reutner-Fischer2009-08-171-0/+2
| | | | | | Handle O= Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* libc/string/i386/string.h: fix -O0 build failureDenys Vlasenko2009-07-211-0/+22
| | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* relocate i386 string.h to i386-specific dirMike Frysinger2009-07-201-0/+316
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* sh: Fix up optimized SH-4 memcpy on big endian.Giuseppe Cavallaro2009-07-141-12/+12
| | | | | | | | | | Signed-off-by: Hideo Saito <saito@densan.co.jp> Signed-off-by: Paul Mundt <lethal@linux-sh.org> Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> See Linux Kernel commit: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e08b954c9a140f2062649faec72514eb505f18c3 Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
* Correct ARM memcpy comments.Joseph Myers2009-07-011-1/+2
| | | | | | | | The comments on register usage in ARM memcpy had dest and src the wrong way round; this patch (originally from Mark Shinwell) corrects this and adds a note on the return value. Signed-off-by: Joseph Myers <joseph@codesourcery.com>
* Fix Thumb-2 memcpy.Joseph Myers2009-06-301-1/+1
| | | | | | | | | When an IT block was changed from having two instructions to having one, the IT instruction at the start of the block was not updated, causing memcpy to fail to assemble for Thumb-2; this patch makes the obvious fix. Signed-off-by: Joseph Myers <joseph@codesourcery.com>
* libc/string/i386/memset.c: memset 1 byte at a time is a bit grossDenis Vlasenko2009-04-231-9/+56
|
* - fix link failures coming from recently added, misplaced strverscmp.Bernhard Reutner-Fischer2009-02-131-0/+0
|
* forgot to add libc/string/generic/strverscmp.cDenis Vlasenko2009-02-081-0/+117
|
* *: remove __UCLIBC_CURLOCALE_DATA, __UCLIBC_CURLOCALE_DATA.xDenis Vlasenko2009-01-211-1/+1
| | | | | | | | | | | | | | | | | | | is always equivalent to __UCLIBC_CURLOCALE->x. remove typedef __uclibc_locale_t, it used only in a few places, it is lees confusing to use struct __uclibc_locale_struct everywhere. xlocale.h: hide __global_locale back under _LIBC, bug 53 is wrong in claiming it should be exported. Also hide under _LIBC: extern __locale_t __curlocale_var; extern __locale_t __curlocale(void); extern __locale_t __curlocale_set(__locale_t newloc); # define __UCLIBC_CURLOCALE # define __XL_NPP(N) # define __LOCALE_PARAM # define __LOCALE_ARG # define __LOCALE_PTR
* - expand SUSv3_LEGACYBernhard Reutner-Fischer2008-12-291-1/+1
| | | | - SUSv4_LEGACY part #1 (non-networking)
* libc/string/i386/rawmemchr.c: i386 version, adapted from strlen()Denis Vlasenko2008-12-202-9/+33
| | | | | | | | | libc/string/i386/strlen.c: small optimization, same code size) text data bss dec hex filename - 240449 1759 11960 254168 3e0d8 lib/libuClibc-0.9.30-svn.so + 240339 1759 11960 254058 3e06a lib/libuClibc-0.9.30-svn.so
* string/i386/strncpy.c: fixlet for testing codeDenis Vlasenko2008-12-202-1/+48
| | | | | | | | | string/i386/strchrnul.c: new function, adapted from strchr.c text data bss dec hex filename - 240604 1759 11960 254323 3e173 lib/libuClibc-0.9.30-svn.so + 240449 1759 11960 254168 3e0d8 lib/libuClibc-0.9.30-svn.so
* string/i386/strncpy: faster i386 version (same code size), testing codeDenis Vlasenko2008-12-206-28/+47
| | | | | string/i386/*: formatiing and commentary tidying up
* strchr: a bit faster version for i386 (same code size)Denis Vlasenko2008-12-191-15/+17
|
* memmove: smaller one for i386, with added testing, and withDenis Vlasenko2008-12-191-20/+32
| | | | | | | | | added check for src == dest. run tested. text data bss dec hex filename - 39 0 0 39 27 libc/string/i386/memmove.os + 37 0 0 37 25 libc/string/i386/memmove.os
* strncat: shorter version for i386, add small embedded testDenis Vlasenko2008-12-194-55/+106
| | | | | | | | | | | | memchr: add small embedded test strnlen: make small embedded test easier to use strncmp: reformat assembly to make it readable, no code changes (verified with objdump) text data bss dec hex filename - 46 0 0 46 2e libc/string/i386/strncat.os + 39 0 0 39 27 libc/string/i386/strncat.os