csum_partial() and csum_partial_copy_generic() in badly optimized?

Gabriel Paubert paubert at iram.es
Tue Nov 19 16:35:12 EST 2002

Paul Mackerras wrote:
> Gabriel Paubert writes:
>>I don't know this code, whether it is correct or not depends on what you
>>pass in r4. If it is invalidate_dcache_range(start, start+len), the code
>>is correct since start+len is one byte beyond the buffer. If it is
>>invalidate_dcache_range(first, last), then it is buggy. The former
>>definition of parameters is more frequent in practice.
> That is correct, the `stop' parameter is the address of the first byte
> after the end of the range that you want invalidated.
>>This said, the first instruction can be removed:
>>  	rlwinm	r3,r3,0,~(L1_CACHE_LINE_SIZE-1)
> Huh?  I'm guessing you really mean to say:
> 	rlwinm	r3,r3,0,0,31-LG_L1_CACHE_LINE_SIZE

No, since a long time gas admits a special syntax of rlwinm and friends
with only four parameters: instead of 2 bit numbers giving the first and
last bit of the mask, you simply write the mask value. Very handy when
writing assembly code.


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

More information about the Linuxppc-dev mailing list