[PING][PATCH, ARM] memcpy for cortex-a15

Greta Yorsh Greta.Yorsh@arm.com
Mon Sep 26 15:27:00 GMT 2011


-----Original Message-----
From: newlib-owner@sourceware.org [mailto:newlib-owner@sourceware.org] On
Behalf Of Greta Yorsh
Sent: 19 September 2011 16:19
To: newlib@sourceware.org
Subject: [PATCH, ARM] memcpy for cortex-a15

This is a patch to add memcpy tuned for Cortex-A15.

The strategy for large block sizes is LDRD and STRD with offset addressing,
where the main loop copies 64 bytes in every iteration, (i.e., 8 calls to
LDRD and STRD pairs), interleaving load and stores (i.e., the pairs of LDRD
and STRD of the same data are consecutive instructions), and the writeback
of an updated address is a separate instruction, which allows us to write
back the accumulated update once per iteration. 

This strategy is implemented in memcpy.S. In some configurations, a plain
version of memcpy (included from memcpy-stub.c) is used instead of the
optimized one. 

* Correctness: checked memcpy using a test harness for block sizes ranging
between 1 to 128, and source and destination buffers alignment ranging in {
0,1,2,3,4,8,12 } bytes each.
* Performance: benchmarking on Cortex-A15 FPGA indicates that this strategy
is better for A15 than the strategy used by glibc and even slightly better
than using NEON. Benchmarking on Cortex-A9 bare metal and Linux shows that
the proposed strategy is reasonable: not as fast as the version of memcpy
from glibc (which is the best open source strategy for A9), but comparable
with csl and bionic. 
* Integration with GCC: no regression for arm-none-eabi --with-cpu
cortex-a15 and cortex-a9.

-- Greta


2011-09-15  Greta Yorsh  <Greta.Yorsh@arm.com>

	* libc/machine/arm/memcpy.S: New file.
	* libc/machine/arm/memcpy-stub.c: New file.
	* libc/machine/arm/Makefile.am (lib_a_SOURCES): Add memcpy-stub.c,
	* libc/machine/arm/Makefile.in (lib_a_SOURCES): Regenerate.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: a15-memcpy.patch
Type: application/octet-stream
Size: 22154 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/newlib/attachments/20110926/cb5b6638/attachment.obj>

More information about the Newlib mailing list