lkml.org 
[lkml]   [2002]   [Sep]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: TCP Segmentation Offloading (TSO)
On Thu, 5 Sep 2002, Hirokazu Takahashi wrote:

> > And again, I think you'll find the rotate faster on at least some x86 cores.
>
> Yeah, I replaced "bswap %eax" with "roll $8,%eax" which would be more
> familier to us.

That's up to you. Since the bswap or roll are only in the conditional,
hopefully infrequently used paths of an odd buffer address, I don't
believe that selecting one or the other has any measurable impact.

> +25:
> + testl $1, %esi
> + jz 30f
> + # buf is odd
> + dec %ecx
> + jl 90f
> + roll $8, %eax
> + movzbl (%esi), %ebx
> + shll $8, %ebx
> + addl %ebx, %eax
> + adcl $0, %eax
> + inc %esi
> + testl $2, %esi
> + jz 10b

Now that is grossly inefficient ;-) since you can save one instruction by
moving roll after adcl (hand edited partial patch hunk, won't apply):

+25:
+ testl $1, %esi
+ jz 30f
+ # buf is odd
+ dec %ecx
+ jl 90f
+ movzbl (%esi), %ebx
+ addl %ebx, %eax
+ adcl $0, %eax
+ inc %esi
+ roll $8, %eax
+ testl $2, %esi
+ jz 10b

Gabriel.

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

\
 
 \ /
  Last update: 2005-03-22 13:28    [W:0.076 / U:0.336 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site