lkml.org 
[lkml]   [2008]   [Jun]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    SubjectRe: [PATCH 19/60] microblaze_v4: checksum support
    Date
    > +static inline unsigned int
    > +csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, unsigned
    > short len,
    > + unsigned short proto, unsigned int sum)
    > +{
    > + __asm__("add %0, %4, %1\n\t"
    > + "addc %0, %4, %2\n\t"
    > + "addc %0, %4, %3\n\t"
    > + "addc %0, %4, r0\n\t"
    > + : "=d" (sum)
    > + : "d" (saddr), "d" (daddr), "d" (len + proto),
    > + "0"(sum));

    "sum" should use an earlyclobber, i.e. "=&d"(sum) , since some
    inputs are used after %0 is first written to.

    Also, you can use "+" instead of "=" to say the argument is both
    input and output, and get rid of %4, if you like.


    Segher



    \
     
     \ /
      Last update: 2008-06-29 00:35    [W:4.396 / U:0.348 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site