simdpp::blend

From libsimdpp-docs
template<unsigned N, class V1, class V2, class V3>

PROMOTED_EXPRESSION blend( const any_vec<N,V1>& on, const any_vec<N,V2>& off,

                           const any_vec<N,V3>& mask );

Blends vectors in two vectors according to a mask. Elements for which corresponding element in mask is set to ones are picked from the on vector. Elements for which corresponding element in mask is set to zeroes are picked from the off vector.

The return type is a vector expression of N bytes. The vector type is governed by the expression promotion rules.

Parameters[edit]

on, off, mask - any two vectors of same size

Return value[edit]

A vector expression evaluating to mask ? on : off.

Equivalent operation[edit]

r0 = mask0 ? on0 : off0
...
rN = maskN ? onN : offN

See also[edit]