Lines Matching full:sum
42 uint64_t sum = 0;/* Need 64-bit accumulator when nbytes > 64K */ in checksum_simple() local
44 /* Sum all halfwords, assume misaligned accesses are handled in HW */ in checksum_simple()
47 sum += *hptr++; in checksum_simple()
53 sum += *(uint8_t *) hptr; in checksum_simple()
56 /* Fold 64-bit sum to 32 bits */ in checksum_simple()
57 sum = (sum & 0xffffffff) + (sum >> 32); in checksum_simple()
58 sum = (sum & 0xffffffff) + (sum >> 32); in checksum_simple()
59 Assert(sum == (uint32_t) sum); in checksum_simple()
61 /* Fold 32-bit sum to 16 bits */ in checksum_simple()
62 sum = (sum & 0xffff) + (sum >> 16); in checksum_simple()
63 sum = (sum & 0xffff) + (sum >> 16); in checksum_simple()
64 Assert(sum == (uint16_t) sum); in checksum_simple()
66 return (uint16_t) sum; in checksum_simple()