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

Function xsum_small_add_sqnorm

xs/sources/xsum.c:1026–1043  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1024 Mixes calls of xsum_carry_propagate with calls of xsum_add1_no_carry. */
1025
1026void xsum_small_add_sqnorm (xsum_small_accumulator *restrict sacc,
1027 const xsum_flt *restrict vec,
1028 xsum_length n)
1029{ xsum_length m, i;
1030
1031 while (n > 0)
1032 { if (sacc->adds_until_propagate == 0)
1033 { (void) xsum_carry_propagate(sacc);
1034 }
1035 m = n <= sacc->adds_until_propagate ? n : sacc->adds_until_propagate;
1036 for (i = 0; i < m; i++)
1037 { xsum_add1_no_carry (sacc, vec[i] * vec[i]);
1038 }
1039 sacc->adds_until_propagate -= m;
1040 vec += m;
1041 n -= m;
1042 }
1043}
1044
1045
1046/* ADD DOT PRODUCT OF VECTORS OF FLOATING-POINT NUMBERS TO SMALL ACCUMULATOR.

Callers

nothing calls this directly

Calls 2

xsum_carry_propagateFunction · 0.85
xsum_add1_no_carryFunction · 0.85

Tested by

no test coverage detected