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

Function select

dlib/simd/simd4f.h:681–695  ·  view source on GitHub ↗

perform cmp ? a : b

Source from the content-addressed store, hash-verified

679
680 // perform cmp ? a : b
681 inline simd4f select(const simd4f_bool& cmp, const simd4f& a, const simd4f& b)
682 {
683#ifdef DLIB_HAVE_SSE41
684 return _mm_blendv_ps(b,a,cmp);
685#elif defined(DLIB_HAVE_SSE2)
686 return _mm_or_ps(_mm_and_ps(cmp,a) , _mm_andnot_ps(cmp,b));
687#elif defined(DLIB_HAVE_NEON)
688 return vbslq_f32(cmp, a, b);
689#else
690 return simd4f(cmp[0]?a[0]:b[0],
691 cmp[1]?a[1]:b[1],
692 cmp[2]?a[2]:b[2],
693 cmp[3]?a[3]:b[3]);
694#endif
695 }
696
697// ----------------------------------------------------------------------------------------
698

Callers

nothing calls this directly

Calls 1

simd4fClass · 0.70

Tested by

no test coverage detected