From 0f3137c05dc7f3169c63729461cdafb6d4492343 Mon Sep 17 00:00:00 2001 From: Stefan Dragnev Date: Tue, 14 Jun 2022 12:06:11 +0200 Subject: [PATCH 1/3] explicitly check for ARM/ARM64 on Windows --- include/boost/multiprecision/cpp_int/intel_intrinsics.hpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/include/boost/multiprecision/cpp_int/intel_intrinsics.hpp b/include/boost/multiprecision/cpp_int/intel_intrinsics.hpp index 37717cd51..1dfe181de 100644 --- a/include/boost/multiprecision/cpp_int/intel_intrinsics.hpp +++ b/include/boost/multiprecision/cpp_int/intel_intrinsics.hpp @@ -35,10 +35,12 @@ #undef BOOST_MP_HAS_IMMINTRIN_H #endif -#if defined(BOOST_MSVC) && !defined(_M_IX86) && !defined(_M_X64) && !defined(_M_AMD64) +#if defined(_WIN32) && (defined(_M_ARM64) || defined(_M_ARM)) // -// When targeting platforms such as ARM, msvc still has the Intel headers in it's include path -// even though they're not usable. See https://github.com/boostorg/multiprecision/issues/321 +// When targeting platforms such as ARM, msvc (and also clang when emulating msvc) still has the +// Intel headers in its include path even though they're not usable. +// See https://github.com/boostorg/multiprecision/issues/321 +// Also https://github.com/boostorg/multiprecision/issues/475 // #undef BOOST_MP_HAS_IMMINTRIN_H #endif From 34c88c38fe8c855d93afee5cd1b505b8b5d9b24c Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Fri, 1 Jul 2022 19:53:41 -0700 Subject: [PATCH 2/3] Fix warning C4702: unreachable code in integer.hpp --- include/boost/multiprecision/integer.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/boost/multiprecision/integer.hpp b/include/boost/multiprecision/integer.hpp index a5ed9fd7c..2873b730a 100644 --- a/include/boost/multiprecision/integer.hpp +++ b/include/boost/multiprecision/integer.hpp @@ -336,11 +336,12 @@ BOOST_MP_CXX14_CONSTEXPR Integer bitwise_sqrt(const Integer& x, Integer& r) template BOOST_MP_CXX14_CONSTEXPR typename std::enable_if::value, Integer>::type sqrt(const Integer& x, Integer& r) { - return detail::bitwise_sqrt(x, r); #ifndef BOOST_MP_NO_CONSTEXPR_DETECTION // recursive Karatsuba sqrt can cause issues in constexpr context: if (BOOST_MP_IS_CONST_EVALUATED(x)) + { return detail::bitwise_sqrt(x, r); + } #endif if (x == 0u) { r = 0u; From 804641e9efb69d7aff5c2c17d8b00601bc591bea Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Sat, 2 Jul 2022 19:36:41 +0100 Subject: [PATCH 3/3] Correct search and replace SNAFU in test case. --- test/test_eigen_interop.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_eigen_interop.cpp b/test/test_eigen_interop.cpp index f18e22c04..99776b982 100644 --- a/test/test_eigen_interop.cpp +++ b/test/test_eigen_interop.cpp @@ -363,7 +363,7 @@ void example10() cout << "a.abs().sqrt() =" << endl << a.abs().sqrt() << endl; cout << "a.min(a.abs().sqrt()) =" << endl - << a.std::min)(a.abs().sqrt()) << endl; + << (a.min)(a.abs().sqrt()) << endl; } template