MCPcopy Create free account
hub / github.com/davisking/dlib / select

Function select

dlib/simd/simd4i.h:570–583  ·  view source on GitHub ↗

perform cmp ? a : b

Source from the content-addressed store, hash-verified

568
569 // perform cmp ? a : b
570 inline simd4i select(const simd4i& cmp, const simd4i& a, const simd4i& b)
571 {
572#ifdef DLIB_HAVE_SSE41
573 return _mm_blendv_epi8(b,a,cmp);
574#elif defined(DLIB_HAVE_SSE2)
575 return ((cmp&a) | _mm_andnot_si128(cmp,b));
576#elif defined(DLIB_HAVE_VSX)
577 return vec_sel(b(), a(), cmp.to_bool());
578#elif defined(DLIB_HAVE_NEON)
579 return vbslq_s32(cmp, a, b);
580#else
581 return ((cmp&a) | (~cmp&b));
582#endif
583 }
584
585// ----------------------------------------------------------------------------------------
586

Callers

nothing calls this directly

Calls 1

to_boolMethod · 0.80

Tested by

no test coverage detected