Non-gcc compilers

Sander Vesik sander at haldjas.folklore.ee
Tue Nov 18 09:27:10 PST 2003


Alexander Leidinger <Alexander at xxxxxxxxxxxxx> wrote:
> On Sun, 16 Nov 2003 14:40:02 -0800 (PST)
> Matthew Dillon <dillon at xxxxxxxxxxxxxxxxxxxx> wrote:
> 
> (CCing Marius Strobl, as he contributed parts of the patchset)
> 
>> :Please check if you have the patch with the in_cksum.c diff (using the 
>> :asm version doesn't work with icc, ATM I don't know if this is a bug in 
>> :the asm or in icc).
>> 
>>     Yes, I've got that, though I am horrified!  Horrified by the in_cksum
>>     code, that is, not the patch :-).  Holy cow!
> 
> The first time I looked at it I was a little bit irritated too. I've
> first seen the short asm version in in_cksum.h and then was pointed to
> the huge C version. As I just wanted to get it working, I've just copied
> the bits from sys/alpha/alpha/in_cksum.c and tested the resulting
> kernel.

The checksum is ones complement of the ones complement sum of the words. 
where word is 16 bits and you need to handle carry on your own.

The alpha version is definately not a "just do it and don't get carried 
away with bit-twiddling" version.

> 
> Bye,
> Alexander.
> 

-- 
	Sander

+++ Out of cheese error +++





More information about the Kernel mailing list