Messages in this thread Patch in this message | | | Date | Sun, 16 May 1999 01:51:54 -0400 | From | "Alex K." <> | Subject | PATCH: checksum optimization on semi-686's |
| |
OK, here's my patch that should optimize checksumming on my Cyrix 6x86MX. I ran the code in a test program, and it gave me 50% more speed for the actual summation. Someone told me, tho, that this patch won't benefit newer 686's. See my earlier posting on the topic. The patch was made from a 2.2.8 kernel, but I don't think checksum.S has changed since then anyways.
diff -urB oldlinux/arch/i386/lib/checksum.S linux/arch/i386/lib/checksum.S --- oldlinux/arch/i386/lib/checksum.S Sun May 16 01:41:03 1999 +++ linux/arch/i386/lib/checksum.S Fri May 14 16:50:53 1999 @@ -154,38 +154,41 @@ jmp 80f 40: + pushl %ebx addl -128(%esi), %eax - adcl -124(%esi), %eax + adcl -124(%esi), %ebx adcl -120(%esi), %eax - adcl -116(%esi), %eax + adcl -116(%esi), %ebx adcl -112(%esi), %eax - adcl -108(%esi), %eax + adcl -108(%esi), %ebx adcl -104(%esi), %eax - adcl -100(%esi), %eax + adcl -100(%esi), %ebx adcl -96(%esi), %eax - adcl -92(%esi), %eax + adcl -92(%esi), %ebx adcl -88(%esi), %eax - adcl -84(%esi), %eax + adcl -84(%esi), %ebx adcl -80(%esi), %eax - adcl -76(%esi), %eax + adcl -76(%esi), %ebx adcl -72(%esi), %eax - adcl -68(%esi), %eax + adcl -68(%esi), %ebx adcl -64(%esi), %eax - adcl -60(%esi), %eax + adcl -60(%esi), %ebx adcl -56(%esi), %eax - adcl -52(%esi), %eax + adcl -52(%esi), %ebx adcl -48(%esi), %eax - adcl -44(%esi), %eax + adcl -44(%esi), %ebx adcl -40(%esi), %eax - adcl -36(%esi), %eax + adcl -36(%esi), %ebx adcl -32(%esi), %eax - adcl -28(%esi), %eax + adcl -28(%esi), %ebx adcl -24(%esi), %eax - adcl -20(%esi), %eax + adcl -20(%esi), %ebx adcl -16(%esi), %eax - adcl -12(%esi), %eax + adcl -12(%esi), %ebx adcl -8(%esi), %eax - adcl -4(%esi), %eax + adcl -4(%esi), %ebx + adcl %ebx,%eax + popl %ebx 45: lea 128(%esi), %esi adcl $0, %eax | |