3 ms·
Thanks. > Coincidentally, I also started working on a new set of hash functions based on the mul32/xor/shift motifs precisely for the purpose of getting someth
by jsnell 10y ago
Thanks.
> Coincidentally, I also started working on a new set of hash functions based on the mul32/xor/shift motifs precisely for the purpose of getting something that could be efficiently vectorized for performance while still able to run on, say, a 32-bit ARM core.
That's cool to hear. I'm happy to reimplement hash functions to fit my bizarre needs, but as per the post I really don't want to design them :)
What's your view on how switching from rotates to shift-xors affects quality? Is it mostly neutral as long as the constants are chosen correctly, or is there some quality loss?
- jandrewrogers 10y agoThe use of multiplication as an operator introduces a bit value bias that arguably makes replacing shift with rotate less of a problem than it would be for algorithms that use e.g. the add/rot/xor operators, since shift introduces a (non-symmetrical) counter-bias to multiply as it is basically a special case of division. Rotate is nice for bit diffusion but most of the necessary heavy lifting is in the high bits being shifted low. I have no hard evidence but my intuition is that the loss of quality by moving from rotate to shift is below the noise floor of what is required to patch up the bit value bias introduced by multiply.