From e39e6ec7f8bd72f60590c686eb4f15c8915ae31a Mon Sep 17 00:00:00 2001 From: Charly Chevalier Date: Wed, 8 Jul 2015 17:27:37 +0200 Subject: [PATCH] x86: Add FMA4 predef --- include/boost/predef/hardware/simd/x86/fma4.h | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/include/boost/predef/hardware/simd/x86/fma4.h b/include/boost/predef/hardware/simd/x86/fma4.h index d44798e..79c9721 100644 --- a/include/boost/predef/hardware/simd/x86/fma4.h +++ b/include/boost/predef/hardware/simd/x86/fma4.h @@ -9,4 +9,42 @@ http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_FMA4_H #define BOOST_PREDEF_HARDWARE_SIMD_X86_FMA4_H +#include + +/*` + [heading `BOOST_HW_SIMD_X86_FMA4`] + + [@https://en.wikipedia.org/wiki/FMA_instruction_set FMA4] x86 extension. + Version number is the default BOOST_VERSION_NUMBER_AVAILABLE. + + This extension is only available on particular CPUs. It does imply + AVX and SSE4a, but it is not implied by extensions newer than SSE3. + For example, AVX2 does not imply it. + + [table + [[__predef_symbol__] [__predef_version__]] + + [[`__FMA4__`] [__predef_detection__]] + ] + */ + +#define BOOST_HW_SIMD_X86_FMA4 BOOST_VERSION_NUMBER_NOT_AVAILABLE + +#if defined(__FMA4__) +# undef BOOST_HW_SIMD_X86_FMA4 +/* We do not give a valid version for this one, since it not always + * available if newer extension than AVX are enabled. */ +# define BOOST_HW_SIMD_X86_FMA4 BOOST_VERSION_NUMBER_AVAILABLE +# define BOOST_HW_SIMD_X86_FMA4_AVAILABLE #endif + +#define BOOST_HW_SIMD_X86_FMA4_NAME "FMA4" + +#if defined(BOOST_HW_SIMD_X86_FMA4_AVAILABLE) +# include +#endif + +#endif + +#include +BOOST_PREDEF_DECLARE_TEST(BOOST_HW_SIMD_X86_FMA4, BOOST_HW_SIMD_X86_FMA4_NAME)