On 12/30/22 23:33, Alejandro Colomar wrote:
Hi Yann,
On 12/30/22 21:33, Alejandro Colomar wrote:
On 12/30/22 21:18, Yann Droneaud wrote:
What's wrong with the following ?
[...]
unsigned long max = upper_bound - 1;
unsigned long mask = ULONG_MAX >> __builtin_clzl(max);
I ha
Hi Yann,
On 12/30/22 21:33, Alejandro Colomar wrote:
On 12/30/22 21:18, Yann Droneaud wrote:
What's wrong with the following ?
[...]
unsigned long max = upper_bound - 1;
unsigned long mask = ULONG_MAX >> __builtin_clzl(max);
I hate coding these magic operations out of a funct
On 12/30/22 22:01, Alejandro Colomar wrote:
On 12/30/22 21:56, Joseph Myers wrote:
On Fri, 30 Dec 2022, Alejandro Colomar via Gcc wrote:
For the C standard, shifts have wrap around semantics for unsigned types:
Only if the shift count is nonnegative and strictly less than the width of
the ty
On 12/30/22 21:56, Joseph Myers wrote:
On Fri, 30 Dec 2022, Alejandro Colomar via Gcc wrote:
For the C standard, shifts have wrap around semantics for unsigned types:
Only if the shift count is nonnegative and strictly less than the width of
the type. This is about shifting by an amount equa
On Fri, 30 Dec 2022, Alejandro Colomar via Gcc wrote:
> For the C standard, shifts have wrap around semantics for unsigned types:
Only if the shift count is nonnegative and strictly less than the width of
the type. This is about shifting by an amount equal to the width of the
type, which has u
Hi Yann,
On 12/30/22 21:18, Yann Droneaud wrote:
30 décembre 2022 à 20:55 "Alejandro Colomar via Libc-alpha"
a écrit:
I'm implementing a small part of equivalent code for shadow. I need
stdc_bit_ceilul() for a random number generator limited to a range (you've seen
some of this in the glibc
Hi Joseph,
On 12/30/22 21:38, Joseph Myers wrote:
On Fri, 30 Dec 2022, Alejandro Colomar via Gcc wrote:
I was wondering if there was any reason to make that UB in the standard, when
unsigned wrapping has always been well-defined, and this is a case that is
likely to be implemented with some op
On Fri, 30 Dec 2022, Alejandro Colomar via Gcc wrote:
> I was wondering if there was any reason to make that UB in the standard, when
> unsigned wrapping has always been well-defined, and this is a case that is
> likely to be implemented with some operation that wraps around, right? I
It's likel
Hi Yann,
On 12/30/22 21:18, Yann Droneaud wrote:
Hi,
30 décembre 2022 à 20:55 "Alejandro Colomar via Libc-alpha"
a écrit:
I'm implementing a small part of equivalent code for shadow. I need
stdc_bit_ceilul() for a random number generator limited to a range (you've seen
some of this in the
Hi,
30 décembre 2022 à 20:55 "Alejandro Colomar via Libc-alpha"
a écrit:
>
> I'm implementing a small part of equivalent code for shadow. I
> need
> stdc_bit_ceilul() for a random number generator limited to a range (you've
> seen
> some of this in the glibc mailing list.
>
> $ grepc -tfd
Hi Joseph,
I'm implementing a small part of equivalent code for shadow. I need
stdc_bit_ceilul() for a random number generator limited to a range (you've seen
some of this in the glibc mailing list.
$ grepc -tfd shadow_random_uniform
./libmisc/random.c:76:
unsigned long
shadow_random_unifo
11 matches
Mail list logo