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

2016-05-31 Thread Andrey Chernov
On 31.05.2016 8:53, Bruce Evans wrote: > On Tue, 31 May 2016, Andrey Chernov wrote: > >> 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

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

2016-05-30 Thread Bruce Evans
On Tue, 31 May 2016, Andrey Chernov wrote: 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,

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

2016-05-30 Thread Andrey Chernov
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

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

2016-05-30 Thread Bruce Evans
On Mon, 30 May 2016, Andrey Chernov wrote: On 30.05.2016 6:09, Bruce Evans wrote: ... The correct fix is s/u_long/uint_fast32_t in most places and s/u_long/uint_least32_t/ in some places and then fix any missing "&"'s. The "fast" and "least" types always exist, unlike the fixed-width types,

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

2016-05-30 Thread Andrey Chernov
On 30.05.2016 6:09, Bruce Evans wrote: > On Sun, 29 May 2016, Conrad Meyer wrote: > >> Does clang actually generate different code with this change? > > It should, on exotic arches. > >> On Sun, May 29, 2016 at 9:39 AM, Andrey A. Chernov >> wrote: >>> Log: >>> Micro

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

2016-05-29 Thread Bruce Evans
On Sun, 29 May 2016, Conrad Meyer wrote: Does clang actually generate different code with this change? It should, on exotic arches. On Sun, May 29, 2016 at 9:39 AM, Andrey A. Chernov wrote: Log: Micro optimize: C standard guarantees that right shift for unsigned value

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

2016-05-29 Thread Andrey Chernov
On 29.05.2016 22:39, Conrad Meyer wrote: > Does clang actually generate different code with this change? Yes, without -O it generates andl$2147483647, ... With -O nothing is changed. In general, it can be not clang and I see no point to left junk code in any case. > > On Sun, May 29, 2016

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

2016-05-29 Thread Conrad Meyer
Does clang actually generate different code with this change? On Sun, May 29, 2016 at 9:39 AM, Andrey A. Chernov wrote: > Author: ache > Date: Sun May 29 16:39:28 2016 > New Revision: 300965 > URL: https://svnweb.freebsd.org/changeset/base/300965 > > Log: > Micro optimize: C