forked from boostorg/unordered
@ -103,17 +103,15 @@ inline boost::uint32_t mulx32( boost::uint32_t x, boost::uint32_t y )
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// multipliers from https://arxiv.org/abs/2001.05304
|
|
||||||
|
|
||||||
inline std::size_t mulx( std::size_t x ) noexcept
|
inline std::size_t mulx( std::size_t x ) noexcept
|
||||||
{
|
{
|
||||||
#if defined(BOOST_UNORDERED_64B_ARCHITECTURE)
|
#if defined(BOOST_UNORDERED_64B_ARCHITECTURE)
|
||||||
|
|
||||||
return (std::size_t)mulx64( (boost::uint64_t)x, 0xDEFBA91144F2B375ull );
|
return (std::size_t)mulx64( (boost::uint64_t)x, 0x9E3779B97F4A7C15ull );
|
||||||
|
|
||||||
#else /* 32 bits assumed */
|
#else /* 32 bits assumed */
|
||||||
|
|
||||||
return mulx32( x, 0xE817FB2Du );
|
return mulx32( x, 0x9E3779B9u );
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user