benchmark/fourier/parallel/pi/xeonphi/openmp/fourier-parallel-pi-xeonphi-openmp.c
uint32_t ilog2(uint32_t x){  
  static const int lookup_table[32] = {
     0,  1, 28,  2, 29, 14, 24, 3, 30, 22, 20, 15, 25, 17,  4, 8, 
    31, 27, 13, 23, 21, 19, 16, 7, 26, 12, 18,  6, 11,  5, 10, 9 };

  return lookup_table[(uint32_t)(x*0x077CB531U) >> 27];
}
// This function computes the log2 of the given uint32_t number.
//
// From: graphics.stanford.edu/~seander/bithacks.html#IntegerLogDeBruijn
//
//   x:                      value to compute.
//
//   returns:                log2(x)
// 
This function computes the log2 of the given uint32_t number.

value to compute.


This function computes the log2 of the given uint32_t number . value to compute .
uint32_t ilog2(uint32_t x){  
  static const int lookup_table[32] = {
     0,  1, 28,  2, 29, 14, 24, 3, 30, 22, 20, 15, 25, 17,  4, 8, 
    31, 27, 13, 23, 21, 19, 16, 7, 26, 12, 18,  6, 11,  5, 10, 9 };
  return lookup_table[(uint32_t)(x*0x077CB531U) >> 27];
}
uint32_t ilog2 ( uint32_t x ) { static const int lookup_table [ 32 ] = { 0 , 1 , 28 , 2 , 29 , 14 , 24 , 3 , 30 , 22 , 20 , 15 , 25 , 17 , 4 , 8 , 31 , 27 , 13 , 23 , 21 , 19 , 16 , 7 , 26 , 12 , 18 , 6 , 11 , 5 , 10 , 9 } ; return lookup_table [ ( uint32_t ) ( x * 0x077CB531U ) >> 27 ] ; }
This function computes the log2 of the given uint32_t number.
This function computes the log2 of the given uint32_t number .