This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] more problems with newlib/libc/machine/m68k/memcpy.S


On Tue, Feb 09, 2010 at 05:10:38PM -0800, Aaron J. Grier wrote:
> if you're going to optimize for cpu32, see if you can optimize the copy
> loops into a single word instruction followed by a dbxx instruction.
> this avoids instruction fetches during the loop and increases bus
> throughput substantially.

I've done some measurements. Copying 1 meg on a 20MHz 68332 (cpu32) gives
those figures:

 196 msecs with the DBxx method you suggested
 215 msecs with unrolled loop (the original code)
 626 msecs with byte-wise (Lresidue) loop.

So, you're right. the DBxx method gives about 10% improvement.

While measuring this, I noticed one more problem: if the Lresidue path is
taken (because of misaligned access) only (COUNT modulo 0x10000) bytes are
copied.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]