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

Function hmax

Source/astcenc_vecmathlib_avx2_8.h:487–496  ·  view source on GitHub ↗

* @brief Return the horizontal maximum of a vector. */

Source from the content-addressed store, hash-verified

485 * @brief Return the horizontal maximum of a vector.
486 */
487ASTCENC_SIMD_INLINE vint8 hmax(vint8 a)
488{
489 // Build max within groups of 2, then 4, then 8
490 __m256i m = _mm256_max_epi32(a.m, _mm256_shuffle_epi32(a.m, _MM_SHUFFLE(2, 3, 0, 1)));
491 m = _mm256_max_epi32(m, _mm256_shuffle_epi32(m, _MM_SHUFFLE(1, 0, 3, 2)));
492 m = _mm256_max_epi32(m, _mm256_permute2x128_si256(m, m, 0x01));
493
494 vint8 vmax(m);
495 return vmax;
496}
497
498/**
499 * @brief Return the horizontal maximum of a vector.

Callers 1

hmax_sFunction · 0.70

Calls 1

vfloat8Class · 0.70

Tested by

no test coverage detected