]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc32: optimise a few instructions in csum_partial()
authorChristophe Leroy <christophe.leroy@c-s.fr>
Tue, 22 Sep 2015 14:34:29 +0000 (16:34 +0200)
committerScott Wood <oss@buserror.net>
Sat, 5 Mar 2016 05:00:52 +0000 (23:00 -0600)
commitf95bb98f99ed04c000b5874a3387c3d83063d405
tree4048b7caa929035dca94bf2feefe41876f1a58c3
parentb359f2980496407026998291b9c1446ccecbdca2
powerpc32: optimise a few instructions in csum_partial()

r5 does contain the value to be updated, so lets use r5 all way long
for that. It makes the code more readable.

To avoid confusion, it is better to use adde instead of addc

The first addition is useless. Its only purpose is to clear carry.
As r4 is a signed int that is always positive, this can be done by
using srawi instead of srwi

Let's also remove the comment about bdnz having no overhead as it
is not correct on all powerpc, at least on MPC8xx

In the last part, in our situation, the remaining quantity of bytes
to be proceeded is between 0 and 3. Therefore, we can base that part
on the value of bit 31 and bit 30 of r4 instead of anding r4 with 3
then proceding on comparisons and substractions.

Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Scott Wood <oss@buserror.net>
arch/powerpc/lib/checksum_32.S