Optimized arm string routines

Richard Earnshaw Richard.Earnshaw@arm.com
Tue Jan 20 10:23:00 GMT 2009


I've recently written the following hand-optimized versions of the
string functions strlen, strcpy and strcmp for ARM (including support
for thumb1 and thumb2).  These are attached for inclusion in newlib.

They should perform significantly better than the C coded versions since
they invariably use fewer call-saved registers (a major overhead on
short strings).  They also handle more cases than the C versions before
falling back to simple byte loops.

The thumb1 variants are all optimized for space.  The inner loops become
very complex with the restricted instruction set and it's unlikely to
give any significant performance benefit. 

R.

<date>  Richard Earnshaw  <rearnsha@arm.com>

	* libc/machine/arm/arm_asm.h: New file.
	* libc/machine/arm/strlen.c: New file.
	* libc/machine/arm/strcpy.c: New file.
	* libc/machine/arm/strcmp.c: New file.
	* libc/machine/arm/Makefile.am: Add new string routines.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: strings.patch
Type: text/x-patch
Size: 27381 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/newlib/attachments/20090120/8c74f7b3/attachment.bin>


More information about the Newlib mailing list