[PATCH] cell spu accelerated string functions

jschopp jschopp@austin.ibm.com
Fri Oct 27 04:25:00 GMT 2006


<snip>
 > Also the curly
> brace style
> is not optional by the Cell C/C++ Language extension document so you can 
> use that style
> always for literals.

Refreshed patch below.

This patch is ready to check in to cvs.  It is string code written explicitly to take 
advantage of the spu being a vectorized processor.  All functions generate assembly on the 
spu that is smaller and faster than the generic code, except memcpy and memmove which 
generate slightly larger code that is faster.  As a bonus, the code should be fairly 
trivial to port to other vectorized processors such as PowerPCs with altivec.

We've been running with this code on our internal builds for the cell SDK 2.0 for several 
cycles now and seem to have squashed all the bugs we could find through our extensive testing.

2006-10-26    <jschopp@austin.ibm.com>

     * libc/machine/spu/memcpy.c: Override generic function with vectorized
     version optimized for the cell spu.
     * libc/machine/spu/memmove.c: Ditto.
     * libc/machine/spu/memset.c: Ditto.
     * libc/machine/spu/strcat.c: Ditto.
     * libc/machine/spu/strchr.c: Ditto.
     * libc/machine/spu/strcmp.c: Ditto.
     * libc/machine/spu/strcpy.c: Ditto.
     * libc/machine/spu/strcspn.c: Ditto.
     * libc/machine/spu/strlen.c: Ditto.
     * libc/machine/spu/strncat.c: Ditto.
     * libc/machine/spu/strncmp.c: Ditto.
     * libc/machine/spu/strncpy.c: Ditto.
     * libc/machine/spu/strpbrk.c: Ditto.
     * libc/machine/spu/strrchr.c: Ditto.
     * libc/machine/spu/strspn.c: Ditto.
     * libc/machine/spu/strxfrm.c: Ditto.
     * libc/machine/spu/vec_literal.h: Add abstraction of vector literals, removing 
altivec style initializers.
     * libc/machine/spu/Makefile.am: Add new files to list so they build
     * libc/machine/spu/Makefile.in: Regenerate from new Makefile.am
-------------- next part --------------
A non-text attachment was scrubbed...
Name: faststring.patch
Type: text/x-patch
Size: 77012 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/newlib/attachments/20061027/88c78647/attachment.bin>


More information about the Newlib mailing list