Kernel checksum routime (>=5)x86 optimization

Montressor (kolex@erols.com)
Fri, 14 May 1999 17:12:22 -0400


Hi,
I had some free time, so I was looking at some of the assembly code in
the 2.2.8 kernel, and had an idea at a particular point which I suspect
can increase checksum performance twofold. Someone give me their opinion,
ok, cuz
I'm new here and I don't have many skills yet.
In the arch/i386/lib/checksum.S file, line 156:

40:
addl -128(%esi), %eax
adcl -124(%esi), %eax
adcl -120(%esi), %eax
adcl -116(%esi), %eax
adcl -112(%esi), %eax
adcl -108(%esi), %eax
adcl -104(%esi), %eax
adcl -100(%esi), %eax
adcl -96(%esi), %eax
adcl -92(%esi), %eax
adcl -88(%esi), %eax
adcl -84(%esi), %eax
adcl -80(%esi), %eax
adcl -76(%esi), %eax

this is, as I understand, a vastly unrolled loop to perfrom the
checksum. Note that on a dual pipeline machine, the second pipeline does
not get used at all in this routine. However, what happens if you change
it to:

40:
?pushl %ebx?
addl -128(%esi), %eax
adcl -124(%esi), %ebx
adcl -120(%esi), %eax
adcl -116(%esi), %ebx
adcl -112(%esi), %eax
adcl -108(%esi), %ebx
......
adcl %ebx,%eax
?popl %ebx?
Would it be possible to then combine the contents of eax and ebx, thus
allowing the processor to use both pipelines?
Thanks.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/