1/*
2Copyright Charly Chevalier 2015
3Copyright Joel Falcou 2015
4Distributed under the Boost Software License, Version 1.0.
5(See accompanying file LICENSE_1_0.txt or copy at
6http://www.boost.org/LICENSE_1_0.txt)
7*/
8
9#ifndef BOOST_PREDEF_HARDWARE_SIMD_X86_H
10#define BOOST_PREDEF_HARDWARE_SIMD_X86_H
11
12#include <boost/predef/version_number.h>
13#include <boost/predef/hardware/simd/x86/versions.h>
14
15/*`
16 [heading `BOOST_HW_SIMD_X86`]
17
18 The SIMD extension for x86 (*if detected*).
19 Version number depends on the most recent detected extension.
20
21 [table
22 [[__predef_symbol__] [__predef_version__]]
23
24 [[`__SSE__`] [__predef_detection__]]
25 [[`_M_X64`] [__predef_detection__]]
26 [[`_M_IX86_FP >= 1`] [__predef_detection__]]
27
28 [[`__SSE2__`] [__predef_detection__]]
29 [[`_M_X64`] [__predef_detection__]]
30 [[`_M_IX86_FP >= 2`] [__predef_detection__]]
31
32 [[`__SSE3__`] [__predef_detection__]]
33
34 [[`__SSSE3__`] [__predef_detection__]]
35
36 [[`__SSE4_1__`] [__predef_detection__]]
37
38 [[`__SSE4_2__`] [__predef_detection__]]
39
40 [[`__AVX__`] [__predef_detection__]]
41
42 [[`__FMA__`] [__predef_detection__]]
43
44 [[`__AVX2__`] [__predef_detection__]]
45 ]
46
47 [table
48 [[__predef_symbol__] [__predef_version__]]
49
50 [[`__SSE__`] [BOOST_HW_SIMD_X86_SSE_VERSION]]
51 [[`_M_X64`] [BOOST_HW_SIMD_X86_SSE_VERSION]]
52 [[`_M_IX86_FP >= 1`] [BOOST_HW_SIMD_X86_SSE_VERSION]]
53
54 [[`__SSE2__`] [BOOST_HW_SIMD_X86_SSE2_VERSION]]
55 [[`_M_X64`] [BOOST_HW_SIMD_X86_SSE2_VERSION]]
56 [[`_M_IX86_FP >= 2`] [BOOST_HW_SIMD_X86_SSE2_VERSION]]
57
58 [[`__SSE3__`] [BOOST_HW_SIMD_X86_SSE3_VERSION]]
59
60 [[`__SSSE3__`] [BOOST_HW_SIMD_X86_SSSE3_VERSION]]
61
62 [[`__SSE4_1__`] [BOOST_HW_SIMD_X86_SSE4_1_VERSION]]
63
64 [[`__SSE4_2__`] [BOOST_HW_SIMD_X86_SSE4_2_VERSION]]
65
66 [[`__AVX__`] [BOOST_HW_SIMD_X86_AVX_VERSION]]
67
68 [[`__FMA__`] [BOOST_HW_SIMD_X86_FMA3_VERSION]]
69
70 [[`__AVX2__`] [BOOST_HW_SIMD_X86_AVX2_VERSION]]
71 ]
72
73 */
74
75#define BOOST_HW_SIMD_X86 BOOST_VERSION_NUMBER_NOT_AVAILABLE
76
77#undef BOOST_HW_SIMD_X86
78#if !defined(BOOST_HW_SIMD_X86) && defined(__MIC__)
79# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_MIC_VERSION
80#endif
81#if !defined(BOOST_HW_SIMD_X86) && defined(__AVX2__)
82# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_AVX2_VERSION
83#endif
84#if !defined(BOOST_HW_SIMD_X86) && defined(__AVX__)
85# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_AVX_VERSION
86#endif
87#if !defined(BOOST_HW_SIMD_X86) && defined(__FMA__)
88# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_FMA_VERSION
89#endif
90#if !defined(BOOST_HW_SIMD_X86) && defined(__SSE4_2__)
91# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_SSE4_2_VERSION
92#endif
93#if !defined(BOOST_HW_SIMD_X86) && defined(__SSE4_1__)
94# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_SSE4_1_VERSION
95#endif
96#if !defined(BOOST_HW_SIMD_X86) && defined(__SSSE3__)
97# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_SSSE3_VERSION
98#endif
99#if !defined(BOOST_HW_SIMD_X86) && defined(__SSE3__)
100# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_SSE3_VERSION
101#endif
102#if !defined(BOOST_HW_SIMD_X86) && (defined(__SSE2__) || defined(_M_X64) || (defined(_M_IX86_FP) && _M_IX86_FP >= 2))
103# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_SSE2_VERSION
104#endif
105#if !defined(BOOST_HW_SIMD_X86) && (defined(__SSE__) || defined(_M_X64) || (defined(_M_IX86_FP) && _M_IX86_FP >= 1))
106# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_SSE_VERSION
107#endif
108#if !defined(BOOST_HW_SIMD_X86) && defined(__MMX__)
109# define BOOST_HW_SIMD_X86 BOOST_HW_SIMD_X86_MMX_VERSION
110#endif
111
112#if !defined(BOOST_HW_SIMD_X86)
113# define BOOST_HW_SIMD_X86 BOOST_VERSION_NUMBER_NOT_AVAILABLE
114#else
115# define BOOST_HW_SIMD_X86_AVAILABLE
116#endif
117
118#define BOOST_HW_SIMD_X86_NAME "x86 SIMD"
119
120#endif
121
122#include <boost/predef/detail/test.h>
123BOOST_PREDEF_DECLARE_TEST(BOOST_HW_SIMD_X86, BOOST_HW_SIMD_X86_NAME)
124