KFR_SINTRIN vec<T, N> select(const mask<T, N>& m, const vec<T, N>& x, const vec<T, N>& y) { return y ^ ((x ^ y) & m.asvec()); }
KFR_SINTRIN vec<T, N> select(const mask<T, N>& a, const vec<T, N>& b, const vec<T, N>& c) { return slice<0, N>(select(expand_simd(a.asvec()).asmask(), expand_simd(b), expand_simd(c))); }
KFR_SINTRIN vec<T, N> select(const mask<T, N>& a, const vec<T, N>& b, const vec<T, N>& c) { return concat(select(low(a.asvec()).asmask(), low(b), low(c)), select(high(a.asvec()).asmask(), high(b), high(c))); }
KFR_INTRINSIC vec<Tout, N> select(const mask<T1, N>& m, const T2& x, const T3& y) { static_assert(sizeof(T1) == sizeof(Tout), "select: incompatible types"); return intrinsics::select(bitcast<Tout>(m.asvec()).asmask(), innercast<Tout>(x), innercast<Tout>(y)); }