2 Copyright Charly Chevalier 2015
3 Copyright Joel Falcou 2015
4 Distributed under the Boost Software License, Version 1.0.
5 (See accompanying file LICENSE_1_0.txt or copy at
6 http://www.boost.org/LICENSE_1_0.txt)
9 #ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_AMD_H
10 #define BOOST_PREDEF_HARDWARE_SIMD_X86_AMD_H
12 #include <boost/predef/version_number.h>
13 #include <boost/predef/hardware/simd/x86_amd/versions.h>
16 [heading `BOOST_HW_SIMD_X86_AMD`]
18 The SIMD extension for x86 (AMD) (*if detected*).
19 Version number depends on the most recent detected extension.
22 [[__predef_symbol__] [__predef_version__]]
24 [[`__SSE4A__`] [__predef_detection__]]
26 [[`__FMA4__`] [__predef_detection__]]
28 [[`__XOP__`] [__predef_detection__]]
30 [[`BOOST_HW_SIMD_X86`] [__predef_detection__]]
34 [[__predef_symbol__] [__predef_version__]]
36 [[`__SSE4A__`] [BOOST_HW_SIMD_X86_SSE4A_VERSION]]
38 [[`__FMA4__`] [BOOST_HW_SIMD_X86_FMA4_VERSION]]
40 [[`__XOP__`] [BOOST_HW_SIMD_X86_XOP_VERSION]]
42 [[`BOOST_HW_SIMD_X86`] [BOOST_HW_SIMD_X86]]
45 [note This predef includes every other x86 SIMD extensions and also has other
46 more specific extensions (FMA4, XOP, SSE4a). You should use this predef
47 instead of `BOOST_HW_SIMD_X86` to test if those specific extensions have
52 #define BOOST_HW_SIMD_X86_AMD BOOST_VERSION_NUMBER_NOT_AVAILABLE
54 // AMD CPUs also use x86 architecture. We first try to detect if any AMD
55 // specific extension are detected, if yes, then try to detect more recent x86
58 #undef BOOST_HW_SIMD_X86_AMD
59 #if !defined(BOOST_HW_SIMD_X86_AMD) && defined(__XOP__)
60 # define BOOST_HW_SIMD_X86_AMD BOOST_HW_SIMD_X86_AMD_XOP_VERSION
62 #if !defined(BOOST_HW_SIMD_X86_AMD) && defined(__FMA4__)
63 # define BOOST_HW_SIMD_X86_AMD BOOST_HW_SIMD_X86_AMD_FMA4_VERSION
65 #if !defined(BOOST_HW_SIMD_X86_AMD) && defined(__SSE4A__)
66 # define BOOST_HW_SIMD_X86_AMD BOOST_HW_SIMD_X86_AMD_SSE4A_VERSION
69 #if !defined(BOOST_HW_SIMD_X86_AMD)
70 # define BOOST_HW_SIMD_X86_AMD BOOST_VERSION_NUMBER_NOT_AVAILABLE
72 // At this point, we know that we have an AMD CPU, we do need to check for
73 // other x86 extensions to determine the final version number.
74 # include <boost/predef/hardware/simd/x86.h>
75 # if BOOST_HW_SIMD_X86 > BOOST_HW_SIMD_X86_AMD
76 # undef BOOST_HW_SIMD_X86_AMD
77 # define BOOST_HW_SIMD_X86_AMD BOOST_HW_SIMD_X86
79 # define BOOST_HW_SIMD_X86_AMD_AVAILABLE
82 #define BOOST_HW_SIMD_X86_AMD_NAME "x86 (AMD) SIMD"
86 #include <boost/predef/detail/test.h>
87 BOOST_PREDEF_DECLARE_TEST(BOOST_HW_SIMD_X86_AMD, BOOST_HW_SIMD_X86_AMD_NAME)