Thread: _bsf

  1. #1
    The C-er
    Join Date
    Mar 2004
    Posts
    192

    _bsf

    Hello all.

    I've recently decided to ditch LCC-win32 due to it being full of bugs.
    So, I've downloaded the Bloodshed/minGW system as recommended by some of you guys, and I must say it looks rather good.

    Now the trouble I have is that my Game of Life code makes extensive use of the intel bsf instruction, which is provided in the _bsf wrapper in intrinsics.h in LCC. This is pretty vital for performance reasons.

    So, how can I acheive this in minGW? Might I find a library somewhere with this function? If not , does anyone know how to embed inline assembler using Bloodshed.

    Any help would by gratefully received.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,656
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    The C-er
    Join Date
    Mar 2004
    Posts
    192
    You're a star Salem, thanks for the quick reply. I didn't realize that MinGW was the same as GCC.

  4. #4
    ---
    Join Date
    May 2004
    Posts
    1,379
    mingw is the windows port of gcc

  5. #5
    The C-er
    Join Date
    Mar 2004
    Posts
    192
    Now I know where to find documentation, I see that I can use __builtin_ffs (just in case anyone else is interested).

Popular pages Recent additions subscribe to a feed