MCPcopy Create free account
hub / github.com/ARM-software/astc-encoder / select

Function select

Source/astcenc_vecmathlib_sse_4.h:684–693  ·  view source on GitHub ↗

* @brief Return lanes from @c b if @c cond is set, else @c a. */

Source from the content-addressed store, hash-verified

682 * @brief Return lanes from @c b if @c cond is set, else @c a.
683 */
684ASTCENC_SIMD_INLINE vint4 select(vint4 a, vint4 b, vmask4 cond)
685{
686 __m128i condi = _mm_castps_si128(cond.m);
687
688#if ASTCENC_SSE >= 41
689 return vint4(_mm_blendv_epi8(a.m, b.m, condi));
690#else
691 return vint4(_mm_or_si128(_mm_and_si128(condi, b.m), _mm_andnot_si128(condi, a.m)));
692#endif
693}
694
695// ============================================================================
696// vfloat4 operators and functions

Callers

nothing calls this directly

Calls 2

vint4Class · 0.70
vfloat4Class · 0.70

Tested by

no test coverage detected