llvm.org GIT mirror llvm / 6a206fc
[Hashing] hash_1to3_bytes - avoid trunc(v + zext(x)) NFCI. MSVC complains about the extension to uint64_t for an addition followed by truncation back to uint32_t - add an explicit uint32_t cast to avoid this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366020 91177308-0d34-0410-b5e6-96231b3b80d8 Simon Pilgrim a month ago
1 changed file(s) with 1 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
190190 uint8_t b = s[len >> 1];
191191 uint8_t c = s[len - 1];
192192 uint32_t y = static_cast(a) + (static_cast(b) << 8);
193 uint32_t z = len + (static_cast(c) << 2);
193 uint32_t z = static_cast(len) + (static_cast(c) << 2);
194194 return shift_mix(y * k2 ^ z * k3 ^ seed) * k2;
195195 }
196196