Tomasz Kaminski [Monday, 23 February 2026 08:13:08 CET]: > On Fri, Feb 20, 2026 at 11:30 AM Matthias Kretz <[email protected]> > wrote: > > How could/should I test this change? I have a test that compiles > > I think we are good with tests that only check if the result is correct, > i.e. elements have correct values.
That's part of the simd::cat tests. Do you think I should add tests that test this function directly? […] > > + template <int _N0, int _N1, int _N2, int... _Ns, __vec_builtin _TV0, > > __vec_builtin _TV1, > > + __vec_builtin _TV2, __vec_builtin... _TVs> > > + requires (__has_single_bit(unsigned(_N0))) && (_N0 >= (_N1 + _N2)) > > + [[__gnu__::__always_inline__]] > > + constexpr __vec_builtin_type<__vec_value_type<_TV0>, > > + __bit_ceil(unsigned(_N0 + _N1 + (_N2 + > > ... + > > _Ns)))> > > + __vec_concat_sized(const _TV0& __a, const _TV1& __b, const _TV2& __c, > > const _TVs&... __rest) > > I do not think that this should be a separate overload and another if > constexpr branch > In the default implementation. That's what I initially did. It was horrible because I need to extract the first element and the remaining pack from __rest... to do so. I could make the function take 3 arguments + pack, but then I'd need an overload for the 2-arg case, which would the duplicate the implementation. What I could do is call a 3-arg + pack function/lambda from the constexpr-if branch, but personally I find the overload simpler (and hopefully cheaper to compile). - Matthias -- ────────────────────────────────────────────────────────────────────────── Dr. Matthias Kretz https://mattkretz.github.io GSI Helmholtz Center for Heavy Ion Research https://gsi.de std::simd ──────────────────────────────────────────────────────────────────────────
signature.asc
Description: This is a digitally signed message part.
