Re: [PATCH] c-family, middle-end: Add __builtin_c[lt]zg (arg, 0ULL) exception

2023-11-21 Thread Jakub Jelinek
On Tue, Nov 21, 2023 at 12:12:18AM +, Joseph Myers wrote: > On Mon, 20 Nov 2023, Jakub Jelinek wrote: > > > and be done with that. If there is an agreement we should do that > > for all 14 rather than just those 3 + the 2 ugly hacks (__builtin_c{l,t}zg > > with > > 0ULL second argument and _

Re: [PATCH] c-family, middle-end: Add __builtin_c[lt]zg (arg, 0ULL) exception

2023-11-20 Thread Martin Uecker
(corrected address) > On Mon, 20 Nov 2023, Jakub Jelinek wrote: > > > On Mon, Nov 20, 2023 at 08:37:55AM +, Richard Biener wrote: > > > > I'm not sure about that, it would be nice for them to be usable there, > > > > > > Btw, I think that {( .. )} should be made usable in sizeof () and >

Re: [PATCH] c-family, middle-end: Add __builtin_c[lt]zg (arg, 0ULL) exception

2023-11-20 Thread Joseph Myers
On Mon, 20 Nov 2023, Jakub Jelinek wrote: > and be done with that. If there is an agreement we should do that > for all 14 rather than just those 3 + the 2 ugly hacks (__builtin_c{l,t}zg > with > 0ULL second argument and __builtin_bit_complement), I can change the I tend to agree with the "ugly

Re: [PATCH] c-family, middle-end: Add __builtin_c[lt]zg (arg, 0ULL) exception

2023-11-20 Thread Richard Biener
On Mon, 20 Nov 2023, Jakub Jelinek wrote: > On Mon, Nov 20, 2023 at 08:37:55AM +, Richard Biener wrote: > > > I'm not sure about that, it would be nice for them to be usable there, > > > > Btw, I think that {( .. )} should be made usable in sizeof () and > > possibly even in at least C++ cons

Re: [PATCH] c-family, middle-end: Add __builtin_c[lt]zg (arg, 0ULL) exception

2023-11-20 Thread Jakub Jelinek
On Mon, Nov 20, 2023 at 08:37:55AM +, Richard Biener wrote: > > I'm not sure about that, it would be nice for them to be usable there, > > Btw, I think that {( .. )} should be made usable in sizeof () and > possibly even in at least C++ constant expressions (not sure about C). I believe the p

Re: [PATCH] c-family, middle-end: Add __builtin_c[lt]zg (arg, 0ULL) exception

2023-11-20 Thread Richard Biener
On Mon, 20 Nov 2023, Jakub Jelinek wrote: > On Mon, Nov 20, 2023 at 09:18:57AM +0100, Florian Weimer wrote: > > * Richard Biener: > > > > > Ugh. First of all I don't like that the exception is applied during > > > folding. As for the problem of multi evaluation can't consumers use > > > stmt ex

Re: [PATCH] c-family, middle-end: Add __builtin_c[lt]zg (arg, 0ULL) exception

2023-11-20 Thread Jakub Jelinek
On Mon, Nov 20, 2023 at 09:18:57AM +0100, Florian Weimer wrote: > * Richard Biener: > > > Ugh. First of all I don't like that the exception is applied during > > folding. As for the problem of multi evaluation can't consumers use > > stmt expressions for this, say > > > > {( auto __tem = value;

Re: [PATCH] c-family, middle-end: Add __builtin_c[lt]zg (arg, 0ULL) exception

2023-11-20 Thread Jakub Jelinek
On Mon, Nov 20, 2023 at 07:49:40AM +, Richard Biener wrote: > Of course the other obvious alternative would be to parse > stdc_leading_zeros and friends directly, and not go through macros > and builtins. The stdc_* names are not keywords and without including stdbit.h I'm not sure it is ok to

Re: [PATCH] c-family, middle-end: Add __builtin_c[lt]zg (arg, 0ULL) exception

2023-11-20 Thread Florian Weimer
* Richard Biener: > Ugh. First of all I don't like that the exception is applied during > folding. As for the problem of multi evaluation can't consumers use > stmt expressions for this, say > > {( auto __tem = value; __builtin_xyz (__tem, __typeof (__tem)); ... )} > > ? Thus use 'auto' to avoi

Re: [PATCH] c-family, middle-end: Add __builtin_c[lt]zg (arg, 0ULL) exception

2023-11-20 Thread Jakub Jelinek
On Mon, Nov 20, 2023 at 07:44:18AM +, Richard Biener wrote: > > In https://sourceware.org/pipermail/libc-alpha/2023-November/152819.html > > Florian Weimer raised concern that the type-generic stdbit.h macros > > currently being considered suffer from similar problem as old tgmath.h > > impleme

Re: [PATCH] c-family, middle-end: Add __builtin_c[lt]zg (arg, 0ULL) exception

2023-11-19 Thread Richard Biener
On Mon, 20 Nov 2023, Richard Biener wrote: > On Sat, 18 Nov 2023, Jakub Jelinek wrote: > > > Hi! > > > > In https://sourceware.org/pipermail/libc-alpha/2023-November/152819.html > > Florian Weimer raised concern that the type-generic stdbit.h macros > > currently being considered suffer from sim

Re: [PATCH] c-family, middle-end: Add __builtin_c[lt]zg (arg, 0ULL) exception

2023-11-19 Thread Richard Biener
On Sat, 18 Nov 2023, Jakub Jelinek wrote: > Hi! > > In https://sourceware.org/pipermail/libc-alpha/2023-November/152819.html > Florian Weimer raised concern that the type-generic stdbit.h macros > currently being considered suffer from similar problem as old tgmath.h > implementation, in particul

[PATCH] c-family, middle-end: Add __builtin_c[lt]zg (arg, 0ULL) exception

2023-11-18 Thread Jakub Jelinek
Hi! In https://sourceware.org/pipermail/libc-alpha/2023-November/152819.html Florian Weimer raised concern that the type-generic stdbit.h macros currently being considered suffer from similar problem as old tgmath.h implementation, in particular that the macros expand during preprocessing their ar