Messages in this thread | | | Date | Tue, 8 Sep 1998 02:30:55 +0200 | From | ralf@uni-kobl ... | Subject | Re: 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
| |