summaryrefslogtreecommitdiff
path: root/libc/string
AgeCommit message (Collapse)Author
2011-03-09_collate.c: remove duplicated libc_hidden_proto() for strcoll*/wcscoll*Peter S. Mazinger
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
2011-03-09wchar.h, _collate.c, strlcpy.c: use a common prototype of __wcslcpyPeter S. Mazinger
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
2011-03-09ctype.c, _collate.c, str[n]casecmp.c, strlcpy.c: remove unused hidden functionsPeter S. Mazinger
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
2011-03-09guard *_chk() related stuff with UCLIBC_HAS_FORTIFYPeter S. Mazinger
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>
2011-03-06simplify ffs* codePeter S. Mazinger
Remove __libc_ffs*, unneeded Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
2011-03-05Implement ffsl and ffsll.Bernd Schmidt
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>
2011-03-03strcpy: remove unneeded includes from the generic versionPeter S. Mazinger
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
2010-12-14sh: fix memcpy saving/restoring FR12-FR15 registersGiuseppe Cavallaro
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>
2010-11-10microblaze: optimized memcpy/memmoveSteven J. Magnani
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>
2010-09-15sh: update the memcpy adding a new loop with aggressive prefetchingSalvatore Cro
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>
2010-09-15sh: move data without fetching cache block within the memsetSalvatore Cro
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>
2010-06-24use uniform form of C99 keywordsBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2010-06-14sh4: Fixes for SH-4 without an FPUCarmelo Amoroso
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>
2010-06-04strverscmp: I forgot to export itDenys Vlasenko
Result was: strverscmp.o: 000000ec T __GI_strverscmp i.e. no plain "strverscmp"! Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2010-04-02Merge commit 'origin/master' into nptlAustin Foxley
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>
2010-03-25prettify make cleanBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2010-02-10libc_sh: Update memcpy to use the ENTRY macroCarmelo Amoroso
Use the ENTRY macro now available through the sysdep.h header Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2009-12-19Merge commit 'origin/master' into nptlAustin Foxley
Conflicts: libc/signal/sigpause.c libc/string/x86_64/memset.S Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2009-12-19x86_64: fix multiple definition of chk functionsAustin Foxley
also enable __chk_fail and only try to call it when SSP is on Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2009-12-16build: Get rids of PIC macro using compiler flag __PIC__ insteadCarmelo Amoroso
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>
2009-12-16build: Get rids of PIC macro using compiler flag __PIC__ insteadCarmelo Amoroso
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>
2009-12-14sh: fix endianess and optimise the SH4 memcpyGiuseppe Cavallaro
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>
2009-11-22sh: Add new optimisation to the SH4 memcpyAustin Foxley
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>
2009-10-10drop __BCC__ cruft from string codeMike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-09-19remove a few more empty #if/#endif pairsDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-09-18convert // comments to /**/; remove empty #if/#endif pairs. no code changesDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-09-18trim Experimentally off and uncommented hiddenBernhard Reutner-Fischer
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>
2009-09-09strsignal.c: whitespace fixes, no code changes (verified with objdump)Denys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-08-17support building out-of-treeBernhard Reutner-Fischer
Handle O= Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2009-07-21libc/string/i386/string.h: fix -O0 build failureDenys Vlasenko
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2009-07-20relocate i386 string.h to i386-specific dirMike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-07-14sh: Fix up optimized SH-4 memcpy on big endian.Giuseppe Cavallaro
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>
2009-07-01Correct ARM memcpy comments.Joseph Myers
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>
2009-06-30Fix Thumb-2 memcpy.Joseph Myers
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>
2009-04-23libc/string/i386/memset.c: memset 1 byte at a time is a bit grossDenis Vlasenko
2009-02-13- fix link failures coming from recently added, misplaced strverscmp.Bernhard Reutner-Fischer
2009-02-08forgot to add libc/string/generic/strverscmp.cDenis Vlasenko
2009-01-21*: remove __UCLIBC_CURLOCALE_DATA, __UCLIBC_CURLOCALE_DATA.xDenis Vlasenko
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
2008-12-29- expand SUSv3_LEGACYBernhard Reutner-Fischer
- SUSv4_LEGACY part #1 (non-networking)
2008-12-20libc/string/i386/rawmemchr.c: i386 version, adapted from strlen()Denis Vlasenko
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
2008-12-20string/i386/strncpy.c: fixlet for testing codeDenis Vlasenko
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
2008-12-20string/i386/strncpy: faster i386 version (same code size), testing codeDenis Vlasenko
string/i386/*: formatiing and commentary tidying up
2008-12-19strchr: a bit faster version for i386 (same code size)Denis Vlasenko
2008-12-19memmove: smaller one for i386, with added testing, and withDenis Vlasenko
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
2008-12-19strncat: shorter version for i386, add small embedded testDenis Vlasenko
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
2008-12-19string/i386: smaller, and hopefully easier to read, strnlen().Denis Vlasenko
text data bss dec hex filename - 25 0 0 25 19 libc/string/i386/strnlen.os + 24 0 0 24 18 libc/string/i386/strnlen.os
2008-12-17fix for build failures resulting from "string ops for i386" changeDenis Vlasenko
2008-12-17since gcc -Os hates us and does not inline string ops,Denis Vlasenko
implement inline versions of some of them. Enable only those which result roughly in the same code size as using out-or-line versions. None of this affects users, installed headers won't have any trace of it.
2008-12-17memchr: smaller i386 versionDenis Vlasenko
strrchr: smaller i386 version text data bss dec hex filename - 33 0 0 33 21 libc/string/i386/memchr.o + 28 0 0 28 1c libc/string/i386/memchr.o - 31 0 0 31 1f libc/string/i386/strrchr.o + 26 0 0 26 1a libc/string/i386/strrchr.o
2008-12-13Remove the rest of "bounded pointers" scaffolding. gcc website says"Denis Vlasenko
"Bounds Checking Projects... This project has been abandoned" for four years at least.