[committed] Re: [PATCH] libstdc++: Add missing constexpr to simd

2023-05-23 Thread Matthias Kretz via Gcc-patches
I pushed the attached patch. I kept the operator names... too late, there were already operator names in the stdx::simd implemenation anyway. ;) - Matthias On Monday, 22 May 2023 22:51:49 CEST Jonathan Wakely wrote: > On Mon, 22 May 2023 at 21:27, Matthias Kretz wrote: > > On Monday, 22 May 20

Re: [PATCH] libstdc++: Add missing constexpr to simd

2023-05-22 Thread Marc Glisse via Gcc-patches
On Mon, 22 May 2023, Jonathan Wakely via Libstdc++ wrote: * subscripting vector builtins is not allowed in constant expressions Is that just because nobody made it work (yet)? Yes. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101651 and others. * if the implementation would otherwise call

Re: [PATCH] libstdc++: Add missing constexpr to simd

2023-05-22 Thread Jonathan Wakely via Gcc-patches
On Mon, 22 May 2023 at 21:27, Matthias Kretz wrote: > On Monday, 22 May 2023 18:25:15 CEST Jonathan Wakely wrote: > > I note that using if (not __builtin_constant_evaluated()) will fail if > > compiled with -fno-operator-names, which is why we don't use 'not', > 'and', > > etc. elsewhere in libst

Re: [PATCH] libstdc++: Add missing constexpr to simd

2023-05-22 Thread Matthias Kretz via Gcc-patches
On Monday, 22 May 2023 18:25:15 CEST Jonathan Wakely wrote: > I note that using if (not __builtin_constant_evaluated()) will fail if > compiled with -fno-operator-names, which is why we don't use 'not', 'and', > etc. elsewhere in libstdc++. I don't know if (or why) anybody uses that > option though

Re: [PATCH] libstdc++: Add missing constexpr to simd

2023-05-22 Thread Jonathan Wakely via Gcc-patches
On Mon, 22 May 2023 at 16:36, Matthias Kretz via Libstdc++ < libstd...@gcc.gnu.org> wrote: > OK for trunk and backporting? > > regtested on x86_64-linux and aarch64-linux > > The constexpr API is only available with -std=gnu++XX (and proposed for > C++26). The proposal is to have the complete simd

[PATCH] libstdc++: Add missing constexpr to simd

2023-05-22 Thread Matthias Kretz via Gcc-patches
OK for trunk and backporting? regtested on x86_64-linux and aarch64-linux The constexpr API is only available with -std=gnu++XX (and proposed for C++26). The proposal is to have the complete simd API usable in constant expressions. This patch resolves several issues with using simd in constant e