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.
v := set(4, cast(s32) 3);
assert(horizontal_sum(v) == 12);horizontal_sum :: (a: $T/SIMD_Array) -> a.type
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.
Parameters
- a: $T/SIMD_Array
Returns
- a.type
v := set(4, cast(s32) 3);
assert(horizontal_sum(v) == 12);