lkml.org 
[lkml]   [1998]   [Sep]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: IPv4 kernel messages
On Mon, Sep 07, 1998 at 05:10:49PM +0200, Andrea Arcangeli wrote:

> >perform verifications. Note there is an ugly piece of MIPS inline asm
> >in here which you'll need to remove too as the last thing I used this
> >for was the Cobalt kernels :-) Note it also performs performance
>
> The asm looks wrong.
>
> >/* XXX */
> >static __inline__ unsigned short int csum_fold(unsigned int sum)
> >{
> > __asm__("
> > .set noat
> > sll $1,%0,16
> > addu %0,$1
> > sltu $1,%0,$1
> ^^^^^^^^^^^^^^^^
>
> With my MIPS emulator sltu do soemthing like "<" C operator, $1 return
> only 0 or 1 and so the asm seems far from what csum_fold should do (I
> emulated the asm in C and does not work).

sltu is a ``Set on Less Than Unsigned'' operation, the way how to compute
a carry on MIPS. Above code is correct. I would have noticed such a bug
since '95 or so when I wrote that function :-)

Ralf

-
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/faq.html

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