lkml.org 
[lkml]   [2002]   [Apr]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH] gcc-3.1 ffs problem, kernel 2.4.18
    On Tue, Apr 02, 2002 at 01:48:48PM +0200, Michal Moskal wrote:
    > Could you please check if it compiles for you?

    Ah, I see the bug. I was looking at ffz (which is correct),
    not ffs (which isn't).

    > __asm__("bsfl %1,%0\n\t"
    > "jnz 1f\n\t"
    > "movl $-1,%0\n"
    > "1:" : "=r" (r) : "g" (x));

    The problem is ^^^

    That sez any of register, memory, or immediate is ok.
    It should be "r" instead, just like in ffz.

    That said, we should probably be using __builtin_ffs
    instead. The compiler knows how to do bsfl plus the
    adjustment. Plus, it knows how to evaluate it at
    compile-time for constants.


    r~
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-03-22 13:25    [W:0.024 / U:0.044 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site