2 Replies Latest reply on Jun 22, 2011 12:24 PM by spectral

    Extract bits from int

    spectral

      Hi,

      I'm working on a radix-sort algorithm and I need to extract some bits from int values.

      My sort is working fine when I sort on 4,12,20,24,28,32 bits but not on 8 and 16 bits !!!!

      I don't understand the reason, maybe a problem with the way I extract the bits !

      I use the following :

       

      #define EXTRACT_BIT(VALUE,BIT) ((((uint)VALUE)>>BIT)&0x1)

      #define EXTRACT_4BITS(VALUE,BIT) ((((uint)VALUE)>>BIT)&0x0F)



      Do you have an advice ?