MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / xsum_small_add_dot

Function xsum_small_add_dot

xs/sources/xsum.c:1049–1067  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1047 Mixes calls of xsum_carry_propagate with calls of xsum_add1_no_carry. */
1048
1049void xsum_small_add_dot (xsum_small_accumulator *restrict sacc,
1050 const xsum_flt *vec1, const xsum_flt *vec2,
1051 xsum_length n)
1052{ xsum_length m, i;
1053
1054 while (n > 0)
1055 { if (sacc->adds_until_propagate == 0)
1056 { (void) xsum_carry_propagate(sacc);
1057 }
1058 m = n <= sacc->adds_until_propagate ? n : sacc->adds_until_propagate;
1059 for (i = 0; i < m; i++)
1060 { xsum_add1_no_carry (sacc, vec1[i] * vec2[i]);
1061 }
1062 sacc->adds_until_propagate -= m;
1063 vec1 += m;
1064 vec2 += m;
1065 n -= m;
1066 }
1067}
1068
1069
1070/* ADD A SMALL ACCUMULATOR TO ANOTHER SMALL ACCUMULATOR. The first argument

Callers

nothing calls this directly

Calls 2

xsum_carry_propagateFunction · 0.85
xsum_add1_no_carryFunction · 0.85

Tested by

no test coverage detected