Branch: Tag:

2015-09-13

2015-09-13 17:49:24 by Martin Nilsson <nilsson@fastmail.com>

Some relative benchmarks to justify not removing the tables on non-intrinsic enabled platforms.

64:    2147483647,/* ~ 2^31 = 2147483648 */   };    - /* same thing as (int)floor(log((double)x) / log(2.0)) */ - /* Except a bit quicker :) (hopefully) */ + /* Same thing as (int)floor(log((double)x) / log(2.0)), except a bit +  quicker. Number of log2 per second:    -  +  log(x)/log(2.0) 50,000,000 +  log2(x) 75,000,000 +  Table lookup 3,000,000,000 +  Intrinsic 30,000,000,000,000,000 + */ +    PMOD_EXPORT int my_log2(size_t x)   {    if( x == 0 ) return 0;