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

Function xsum_small_add_accumulator

xs/sources/xsum.c:1075–1102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1073 number. Source and destination may be the same. */
1074
1075void xsum_small_add_accumulator (xsum_small_accumulator *dst_sacc,
1076 xsum_small_accumulator *src_sacc)
1077{
1078 int i;
1079
1080 if (xsum_debug) c_printf("\nADDING ACCUMULATOR TO A SMALL ACCUMULATOR\n");
1081
1082 xsum_carry_propagate (dst_sacc);
1083
1084 if (dst_sacc == src_sacc)
1085 { for (i = 0; i < XSUM_SCHUNKS; i++)
1086 { dst_sacc->chunk[i] += dst_sacc->chunk[i];
1087 }
1088 }
1089 else
1090 {
1091 xsum_carry_propagate (src_sacc);
1092
1093 if (src_sacc->Inf) xsum_small_add_inf_nan (dst_sacc, src_sacc->Inf);
1094 if (src_sacc->NaN) xsum_small_add_inf_nan (dst_sacc, src_sacc->NaN);
1095
1096 for (i = 0; i < XSUM_SCHUNKS; i++)
1097 { dst_sacc->chunk[i] += src_sacc->chunk[i];
1098 }
1099 }
1100
1101 dst_sacc->adds_until_propagate = XSUM_SMALL_CARRY_TERMS-2;
1102}
1103
1104
1105/* NEGATE THE VALUE IN A SMALL ACCUMULATOR. */

Callers 1

Calls 2

xsum_carry_propagateFunction · 0.85
xsum_small_add_inf_nanFunction · 0.85

Tested by

no test coverage detected