_bsf

This is a discussion on _bsf within the C Programming forums, part of the General Programming Boards category; Hello all. I've recently decided to ditch LCC-win32 due to it being full of bugs. So, I've downloaded the Bloodshed/minGW ...

  1. #1
    Jez
    Jez is offline
    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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,558
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Jez
    Jez is offline
    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
    Jez
    Jez is offline
    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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21