From 9bc471310e24c3b62295b24619fdbf984b374cd5 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Fri, 27 Jan 2023 08:00:40 +0200 Subject: [PATCH] Update mulx multipliers --- include/boost/unordered/detail/mulx.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/boost/unordered/detail/mulx.hpp b/include/boost/unordered/detail/mulx.hpp index 93baea9f..1cb6af02 100644 --- a/include/boost/unordered/detail/mulx.hpp +++ b/include/boost/unordered/detail/mulx.hpp @@ -94,15 +94,17 @@ inline boost::uint32_t mulx32( boost::uint32_t x, boost::uint32_t y ) #endif #endif +// multipliers from https://arxiv.org/abs/2001.05304 + inline std::size_t mulx( std::size_t x ) noexcept { #if defined(BOOST_UNORDERED_64B_ARCHITECTURE) - return (std::size_t)mulx64( (boost::uint64_t)x, 0x9E3779B97F4A7C15ull ); + return (std::size_t)mulx64( (boost::uint64_t)x, 0xDEFBA91144F2B375ull ); #else /* 32 bits assumed */ - return mulx32( x, 0x9E3779B9u ); + return mulx32( x, 0xE817FB2Du ); #endif }