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

Function haccumulate

Source/astcenc_vecmathlib_rvv_n.h:851–864  ·  view source on GitHub ↗

* @brief Accumulate lane-wise sums for a vector, folded 4-wide. * * This is invariant with 4-wide implementations. */

Source from the content-addressed store, hash-verified

849 * This is invariant with 4-wide implementations.
850 */
851ASTCENC_SIMD_INLINE void haccumulate(vfloat4& accum, vfloat a)
852{
853#if defined(ASTCENC_NO_INVARIANCE)
854 accum.m[0] += hadd_s(a);
855#else
856 vfloat_t vacc = __riscv_vle32_v_f32m1(accum.m, 4);
857 vacc = __riscv_vfadd(vacc, a.m, 4);
858 for (size_t i = 4; i < vfloat::vl(); i += 4)
859 {
860 vacc = __riscv_vfadd(vacc, __riscv_vslidedown(a.m, i, 4), 4);
861 }
862 __riscv_vse32(accum.m, vacc, 4);
863#endif
864}
865
866/**
867 * @brief Accumulate lane-wise sums for a vector.

Callers

nothing calls this directly

Calls 2

hadd_sFunction · 0.70
selectFunction · 0.70

Tested by

no test coverage detected