From 1b27540a96a0014d60971379d046b876f99273e5 Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Tue, 8 Dec 2015 10:40:33 +0100 Subject: [PATCH] Fix redefinition of BOOST_HW_SIMD for x86 (AMD) --- include/boost/predef/hardware/simd.h | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/include/boost/predef/hardware/simd.h b/include/boost/predef/hardware/simd.h index 4de1e70..ac5c9da 100644 --- a/include/boost/predef/hardware/simd.h +++ b/include/boost/predef/hardware/simd.h @@ -77,12 +77,24 @@ http://www.boost.org/LICENSE_1_0.txt) # error "Multiple SIMD architectures detected, this cannot happen!" #endif -#if defined(BOOST_HW_SIMD_X86_AVAILABLE) -# define BOOST_HW_SIMD BOOST_HW_SIMD_X86 +#if defined(BOOST_HW_SIMD_X86_AVAILABLE) && defined(BOOST_HW_SIMD_X86_AMD_AVAILABLE) + // If both standard _X86 and _X86_AMD are available, + // then take the biggest version of the two! +# if BOOST_HW_SIMD_X86 >= BOOST_HW_SIMD_X86_AMD +# define BOOST_HW_SIMD BOOST_HW_SIMD_X86 +# else +# define BOOST_HW_SIMD BOOST_HW_SIMD_X86_AMD +# endif #endif -#if defined(BOOST_HW_SIMD_X86_AMD_AVAILABLE) -# define BOOST_HW_SIMD BOOST_HW_SIMD_X86_AMD +#if !defined(BOOST_HW_SIMD) + // At this point, only one of these two is defined +# if defined(BOOST_HW_SIMD_X86_AVAILABLE) +# define BOOST_HW_SIMD BOOST_HW_SIMD_X86 +# endif +# if defined(BOOST_HW_SIMD_X86_AMD_AVAILABLE) +# define BOOST_HW_SIMD BOOST_HW_SIMD_X86_AMD +# endif #endif #if defined(BOOST_HW_SIMD_ARM_AVAILABLE)