summaryrefslogtreecommitdiffstats
path: root/libc/arch-arm/generic/generic.mk
Commit message (Collapse)AuthorAgeFilesLines
* Clean up <stdlib.h> slightly.Elliott Hughes2015-01-261-1/+3
| | | | | | | Interestingly, this mostly involves cleaning up our implementation of various <string.h> functions. Change-Id: Ifaef49b5cb997134f7bc0cc31bdac844bdb9e089
* Move the generic arm memcmp.S into the generic directory.Elliott Hughes2014-12-151-0/+1
| | | | Change-Id: I48e4d14a0dcddbb246edbac6d0329619574ab44d
* Add stpcpy assembler version.Christopher Ferris2014-09-301-0/+1
| | | | | | | For generic, continue to use the C version of the code. Bug: 13746695 Change-Id: I77426a70b06131f2373bb51265bea1240bb3f101
* denver: optimize memmoveShu Zhang2014-05-201-0/+1
| | | | | | Optimize 32-bit denver memmove with reversal memcpy. Change-Id: Iaad0a9475248cdd7e4f50d58bea9db1b767abc88
* More OpenBSD cleanup (primarily string).Elliott Hughes2014-02-241-1/+1
| | | | | | This patch removes the string/ and wchar/ directories. Change-Id: Ia489904bc67047e4bc79acb1f3eec21aa3fe5f0d
* Reconfig libc's Android.mk to build for multilibYing Wang2014-02-121-8/+9
| | | | | | | | | | | | | | | 1. Moved arch-specific setup to their own files: - <arch>/<arch>.mk, arch-specific configs. Variables in those config end with the arch name. - removed the extra complexity introduced by function libc-add-cpu-variant-src, which seems to be not very useful these days. 2. Separated out the crt object files generation rules and set up the rules for both TARGET_ARCH and TARGET_2ND_ARCH. 3. Build all the libraries for both TARGET_ARCH and TARGET_2ND_ARCH, with the arch-specific LOCAL_ variables. Bug: 11654773 Change-Id: I9c2d85db0affa49199d182236d2210060a321421
* Create optimized __strcpy_chk/__strcat_chk.Christopher Ferris2013-08-151-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change pulls the memcpy code out into a new file so that the __strcpy_chk and __strcat_chk can use it with an include. The new versions of the two chk functions uses assembly versions of strlen and memcpy to implement this check. This allows near parity with the assembly versions of strcpy/strcat. It also means that as memcpy implementations get faster, so do the chk functions. Other included changes: - Change all of the assembly labels to local labels. The other labels confuse gdb and mess up backtracing. - Add .cfi_startproc and .cfi_endproc directives so that gdb is not confused when falling through from one function to another. - Change all functions to use cfi directives since they are more powerful. - Move the memcpy_chk fail code outside of the memcpy function definition so that backtraces work properly. - Preserve lr before the calls to __fortify_chk_fail so that the backtrace actually works. Testing: - Ran the bionic unit tests. Verified all error messages in logs are set correctly. - Ran libc_test, replacing strcpy with __strcpy_chk and replacing strcat with __strcat_chk. - Ran the debugger on nexus10, nexus4, and old nexus7. Verified that the backtrace is correct for all fortify check failures. Also verify that when falling through from __memcpy_chk to memcpy that the backtrace is still correct. Also verified the same for __memset_chk and bzero. Verified the two different paths in the cortex-a9 memset routine that save variables to the stack still show the backtrace properly. Bug: 9293744 (cherry-picked from 2be91915dcecc956d14ff281db0c7d216ca98af2) Change-Id: Ia407b74d3287d0b6af0139a90b6eb3bfaebf2155
* Fix strcpy.c that should have been strcpy.S. DO NOT MERGEChristopher Ferris2013-08-081-1/+1
| | | | | | | | Merge from internal master. (cherry-picked from 1ce665416307628f4bcaced86faa64bdf9c489c3) Change-Id: I376b831df42248baadde7202a30a68112f752ff7
* Optimize strcat/strcpy, small tweaks to strlen. DO NOT MERGEChristopher Ferris2013-08-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Create one version of strcat/strcpy/strlen for cortex-a15/krait and another version for cortex-a9. Tested with the libc_test strcat/strcpy/strlen tests. Including new tests that verify that the src for strcat/strcpy do not overread across page boundaries. NOTE: The handling of unaligned strcpy (same code in strcat) could probably be optimized further such that the src is read 64 bits at a time instead of the partial reads occurring now. strlen improves slightly since it was recently optimized. Performance improvements for strcpy and strcat (using an empty dest string): cortex-a9 - Small copies vary from about 5% to 20% as the size gets above 10 bytes. - Copies >= 1024, about a 60% improvement. - Unaligned copies, from about 40% improvement. cortex-a15 - Most small copies exhibit a 100% improvement, a few copies only improve by 20%. - Copies >= 1024, about 150% improvement. - Unaligned copies, about 100% improvement. krait - Most small copies vary widely, but on average 20% improvement, then the performance gets better, hitting about a 100% improvement when copies 64 bytes of data. - Copies >= 1024, about 100% improvement. - When coping MBs of data, about 50% improvement. - Unaligned copies, about 90% improvement. As strcat destination strings get larger in size: cortex-a9 - about 40% improvement for small dst strings (>= 32). - about 250% improvement for dst strings >= 1024. cortex-a15 - about 200% improvement for small dst strings (>=32). - about 250% improvement for dst strings >= 1024. krait - about 25% improvement for small dst strings (>=32). - about 100% improvement for dst strings >=1024. Merge from internal master. (cherry-picked from d119b7b6f48fe507088cfb98bcafa99b320fd884) Change-Id: I296463b251ef9fab004ee4dded2793feca5b547a
* Add new optimized strlen for arm.Christopher Ferris2013-07-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This optimized version is primarily targeted at cortex-a15. Tested on all nexus devices using the system/extras/libc_test strlen test. Tested alignments from 1 to 32 that are powers of 2. Tested that strlen does not cross page boundaries at all alignments. Speed improvements listed below: cortex-a15 - Sizes >= 32 bytes, ~75% improvement. - Sizes >= 1024 bytes, ~250% improvement. cortex-a9 - Sizes >= 32 bytes, ~75% improvement. - Sizes >= 1024 bytes, ~85% improvement. krait - Sizes >= 32 bytes, ~95% improvement. - Sizes >= 1024 bytes, ~160% improvement. Merge from internal master. (cherry-picked from 2fc071797743b88a9a47427d46baed7c7b24f4d2) Change-Id: I1ceceb4e745fd68e9d946f96d1d42e0cdaff6ccf
* Create arch specific versions of strcmp.Christopher Ferris2013-03-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This uses the new strcmp.a15.S code as the basis for new versions of strcmp.S. The cortex-a15 code is the performance optimized version of strcmp.a15.S taken with only the addition of a few pld instructions. The cortex-a9 code is the same as the cortex-a15 code except that the unaligned strcmp code was taken from the original strcmp.S. The krait code is the same as the cortex-a15 code except that one path in the unaligned strcmp code was taken from the original strcmp.S code (the 2 byte overlap case). The generic code is the original unmodified strmp.S from the bionic subdirectory. All three new versions underwent these test cases: Strings the same, all same size: - Both pointers double word aligned. - One pointer double word aligned, one pointer word aligned. - Both pointers word aligned. - One pointer double word aligned, one pointer 1 off a word alignment. - One pointer double word aligned, one pointer 2 off a word alignment. - One pointer double word aligned, one pointer 3 off a word alignment. - One pointer word aligned, one pointer 1 off a word alignment. - One pointer word aligned, one pointer 2 off a word alignment. - One pointer word aligned, one pointer 3 off a word alignment. For all cases where it made sense, the two pointers were also tested swapped. Different strings, all same size: - Single difference at double word boundary. - Single difference at word boudary. - Single difference at 1 off a word alignment. - Single difference at 2 off a word alignment. - Single difference at 3 off a word alignment. Different sized strings, strings the same until the end: - Shorter string ends on a double word boundary. - Shorter string ends on word boundary. - Shorter string ends at 1 off a word boundary. - Shorter string ends at 2 off a word boundary. - Shorter string ends at 3 off a word boundary. For all different cases, run them through the same pointer alignment cases when the strings are the same size. For all cases the two pointers were also tested swapped. Bug: 8005082 Merge from internal master. (cherry-picked from commit a9a5870d166f8060a8182cd61e5536b0becea74e) Change-Id: I4c2b98f8a50804fb98ab67f75e9d660f1315a144
* Break bionic implementations into arch versions.Christopher Ferris2013-03-121-0/+2
Move arch specific code for arm, mips, x86 into separate makefiles. In addition, add different arm cpu versions of memcpy/memset. Bug: 8005082 Merge from internal master (acdde8c1cf8e8beed98c052757d96695b820b50c). Change-Id: I04f3d0715104fab618e1abf7cf8f7eec9bec79df