Thread (13 messages) 13 messages, 7 authors, 2009-06-19

Re: [PATCH] powerpc: tiny memcpy_(to|from)io optimisation

From: Albrecht Dreß <hidden>
Date: 2009-05-31 10:11:43

Hi Jocke:

Am 29.05.09 08:31 schrieb(en) Joakim Tjernlund:
quoted
No (and I wasn't aware of the PPC pre-inc vs. post-inc stuff) - I  
just

I think this is true for most RISC based CPU's. It is a pity as
post ops are a lot more common. The do {} while(--chunks) is also
better. Basically the "while(--chunks)" is free(but only if you don't  
use
chunks inside the loop).
Just a side note:  I looked at the assembly output of gcc 4.3.3 coming  
with Ubuntu Jaunty/PowerPC for

<snip case="1">
   n >>= 2;
   do {
     *++dst = *++src;
   } while (--n);
<snip>

and

<snip case="2">
   n >>= 2;
   while (n--)
     *dst++ = *src++;
</snip>

Using the gcc options "-O2 -mcpu=603e -mtune=603e" (same effect with  
"-O3" instead of "-O2") the loop core is *exactly* the same in both  
cases.

With gcc 4.2.2 (coming with ELDK 4.2) the loop core in case 2 is indeed  
one statement longer, though...

Best, Albrecht.

Attachments

  • (unnamed) [application/pgp-signature] 189 bytes
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help