SIMD module

horizontal_sum

procedureSource

The sum of all lanes, added in lane order from the first lane, as a single value of the lane type. Integer lanes wrap on overflow; for floats the order of addition fixes the rounding.

Example↗
v := set(4, cast(s32) 3);
assert(horizontal_sum(v) == 12);
horizontal_sum :: (a: $T/SIMD_Array) -> a.type

Parameters

Returns

a.type

See also