lkml.org 
[lkml]   [1996]   [Nov]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: IP Checksumming
Date

> csum += data[i];
> carry = (csum < data[i]);

This is the only way to do it on the Alpha, as there is no
processor status word in which to store a carry flag.

> does not need branches or other pipeline killers at all on most CPUs.
> In fact on MIPS this even makes really nice code which takes four
> cycles per 4 bytes on 32 bit CPUs or four cycles per 8 bytes on R4000
> (64 bit) CPUs, R5000/R10000 should be able to do this in 2 cycles.

Or look at the csum_ipv6_magic routine I wrote for 2.1.11 wherein
all the carry bits for the 40 byte headers are merged in 3 (ev5)
cycles.


r~

\
 
 \ /
  Last update: 2005-03-22 13:38    [W:0.061 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site