On Tue, Aug 28, 2012 at 8:42 AM, Marc Glisse <marc.gli...@inria.fr> wrote: > Thank you for your answers. My main concern was whether it was best to > implement __get_random_word in libstdc++, or __builtin_random in gcc. But it > looks like your solution of doing it in libstdc++ makes more sense (at least > for now).
There are enough subtle differences between the way different architectures implement this functionality that forcing a common builtin implementation is problematic at best. For instance, look at the repeat counter I use. That's specific to Intel's code. For an implementation like Via's the best choice to handle lack of entropy might be to (temporarily) reduce the quality of the number. Anyway, the biggest question for now is whether to keep the problematic code which uses mt19937 as a replacement.