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

Re: [PATCH 2/2] libstdc++: use new built-in trait __add_const

2023-03-21 Thread Marc Glisse via Gcc-patches
On Tue, 21 Mar 2023, Ken Matsui via Libstdc++ wrote: /// add_const +#if __has_builtin(__add_const) + template +struct add_const +{ using type = __add_const(_Tp); }; +#else template struct add_const { using type = _Tp const; }; +#endif Is that really better? You asked

Re: [PATCH] Optimize VEC_PERM_EXPR with same permutation index and operation [PR98167]

2022-11-16 Thread Marc Glisse via Gcc-patches
On Fri, 4 Nov 2022, Hongyu Wang via Gcc-patches wrote: This is a follow-up patch for PR98167 The sequence c1 = VEC_PERM_EXPR (a, a, mask) c2 = VEC_PERM_EXPR (b, b, mask) c3 = c1 op c2 can be optimized to c = a op b c3 = VEC_PERM_EXPR (c, c, mask) for all integer vector

Re: [PATCH] Optimize (X<

2022-09-14 Thread Marc Glisse via Gcc-patches
On Tue, 13 Sep 2022, Roger Sayle wrote: This patch tweaks the match.pd transformation previously added to fold (X< In https://gcc.gnu.org/onlinedocs/gcc/Integers-implementation.html , I read: "Bitwise operators act on the representation of the value including both the sign and value bits,

Re: [PATCH] libstdc++: Implement std::unreachable() for C++23 (P0627R6)

2022-03-31 Thread Marc Glisse via Gcc-patches
On Thu, 31 Mar 2022, Jonathan Wakely wrote: On Thu, 31 Mar 2022 at 17:03, Marc Glisse via Libstdc++ wrote: On Thu, 31 Mar 2022, Matthias Kretz via Gcc-patches wrote: I like it. But I'd like it even more if we could have #elif defined _UBSAN __ubsan_invoke_ub("reached

Re: [PATCH] libstdc++: Implement std::unreachable() for C++23 (P0627R6)

2022-03-31 Thread Marc Glisse via Gcc-patches
On Thu, 31 Mar 2022, Matthias Kretz via Gcc-patches wrote: I like it. But I'd like it even more if we could have #elif defined _UBSAN __ubsan_invoke_ub("reached std::unreachable()"); But to my knowledge UBSAN has no hooks for the library like this (yet). -fsanitize=undefined already

Re: [PATCH] PR tree-optimization/101895: Fold VEC_PERM to help recognize FMA.

2022-03-12 Thread Marc Glisse via Gcc-patches
On Fri, 11 Mar 2022, Roger Sayle wrote: +(match vec_same_elem_p + CONSTRUCTOR@0 + (if (uniform_vector_p (TREE_CODE (@0) == SSA_NAME +? gimple_assign_rhs1 (SSA_NAME_DEF_STMT (@0)) : @0 Ah, I didn't remember we needed that, we don't seem to be very consistent about