Optimized arm string routines

Jeff Johnston jjohnstn@redhat.com
Thu Jan 22 00:12:00 GMT 2009


Patch applied with updated strcpy.c.

Did you ever manage to look at the problem from before Christmas re: 
thumb-2 and crt0.S init_hooks?  I was hoping you might come up with a 
solution that would work for all involved.

Thanks,

-- Jeff J.

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.
>
>
>   



More information about the Newlib mailing list