svn commit: r300965 - head/lib/libc/stdlib

Andrey Chernov ache at freebsd.org
Tue May 31 05:07:50 UTC 2016


On 31.05.2016 6:42, Bruce Evans wrote:
> 
> Er, I already said which types are better -- [u]int_fast32_t here.

[u]int_fast32_t have _at_least_ 32 bits. int32_t in the initial PRNG can
be changed since does not overflow and involve several calculations, but
uint_fast32_t is needed just for two operations:
*f += *r;
i = (*f >> 1) & 0x7fffffff;
We need to assign values from uint32_t to uint_fast32_t (since array
size can't be changed), do this single operation fast and store them
back into array of uint32_t. I doubt that much gain can comes from it
and even pessimization in some cases. Better let compiler do its job here.



More information about the svn-src-all mailing list