Lines Matching full:sum
85 uint64_t sum = 0; in slurp_small() local
88 sum += load32(cptr); in slurp_small()
94 sum += load16(cptr); in slurp_small()
99 sum += (uint8_t) *cptr; in slurp_small()
101 return sum; in slurp_small()
112 fold_and_swap(uint64_t sum, bool swap) in fold_and_swap() argument
114 /* Fold 64-bit sum to 32 bits */ in fold_and_swap()
115 sum = (sum & 0xffffffff) + (sum >> 32); in fold_and_swap()
116 sum = (sum & 0xffffffff) + (sum >> 32); in fold_and_swap()
117 Assert(sum == (uint32_t) sum); in fold_and_swap()
119 /* Fold 32-bit sum to 16 bits */ in fold_and_swap()
120 sum = (sum & 0xffff) + (sum >> 16); in fold_and_swap()
121 sum = (sum & 0xffff) + (sum >> 16); in fold_and_swap()
122 Assert(sum == (uint16_t) sum); in fold_and_swap()
126 sum = bswap16(sum); in fold_and_swap()
129 return (uint16_t) sum; in fold_and_swap()