public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
* memcpy development
@ 2004-08-21  0:23 David S. Miller
  0 siblings, 0 replies; only message in thread
From: David S. Miller @ 2004-08-21  0:23 UTC (permalink / raw)
  To: linux-arch

[-- Attachment #1: Type: text/plain, Size: 1602 bytes --]


Every arch developer has probably written one of these things
at least 4 times, but I figured I'd donate my copy instead of
losing it to the sands of time. :-)

It shouldn't be too hard to hack up to use on other platforms.
The easiest thing to get working is the verifier, for each
of memcpy-*.c simply replace U{1,3}memcpy.S with your platforms
memcpy implementations you want to test, add those *.S files
and mention them properly in the Makefile.  Then just go
"make verify", the tests are:

memcpy-{1,2,bi}.c	From the gcc testsuite with some mods of
			my own.  In particular, memcpy-2.c was
			changed to verify every single case of modulo
			64 byte alignment of source and destination.
			This actually matters on sparc64 as each
			64 % 8 alignment uses a different code path
			in the UltraSparc-I/II/IIi/IIe memcpy routine.

memcpy-mmap.c		My own little hack to make sure the routine
			does not do loads past the end of the source
			buffer.  This is the hardest to debug when
			you put it into the kernel since such an error
			can result in a complete system hang.

The timings are done by test.c, it is testing the in-cache case
of course.  test2.c is my incredibly crude attempt to try and
get some kind of cache-miss testing.

test.c takes 0, 1 or 2 arguments.

- if 0 arguments, both src and dst are 64-byte aligned
- if 1 argument, it is a byte offset to give to the src buffer
- if 2 arguments the first is src offset, the second is dst offset

So you can test the performance of various weird alignments by
saying things like "./test 0 1 >out01; ./test 1 0 >out10;" etc.

Enjoy.

[-- Attachment #2: memcpy_devel.tar.gz --]
[-- Type: application/octet-stream, Size: 7169 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-08-21  0:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-21  0:23 memcpy development David S. Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox