Optimized arm string routines
Richard Earnshaw
rearnsha@arm.com
Tue Jan 20 11:48:00 GMT 2009
On Tue, 2009-01-20 at 10:21 +0000, Richard Earnshaw wrote:
> 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.
>
>
Whops, the strcpy routine had a bug in it, which I managed to introduce
late yesterday during final tweaking :-(
Please use this version rather than the one in the original patch
R.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: strcpy.c
Type: text/x-csrc
Size: 4847 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/newlib/attachments/20090120/8e37400f/attachment.bin>
More information about the Newlib
mailing list