csum_partial() and csum_partial_copy_generic() in badly optimized?

Tim Seufert tas at mindspring.com
Mon Nov 18 12:27:45 EST 2002

On Sunday, November 17, 2002, at 03:32  PM, Joakim Tjernlund wrote:

>> Not used.  CTR cannot be specified as the source or destination of
>> most
>> instructions.  In order to access its contents you have to use special
>> instructions that move between it and a normal general purpose
>> register.
> OK, so how about if I modify the crc32 loop:
> unsigned char * end = data +len;
> while(data < end) {
>         result = (result << 8 | *data++) ^ crctab[result >> 24];
> }
> will that be possible to optimze in with something similar as bdnz
> also?

Nope.  If the pointer was put into the CTR register, it would have to
be copied back out with an extra instruction in order to be
dereferenced.  Also, I'm fairly sure there is no way to compare CTR to
anything but zero, so loops really need to be of the form "while
(counter--)" to use it.

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

More information about the Linuxppc-dev mailing list