]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/predef/hardware/simd.h
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 #include <boost/predef/hardware/simd/x86.h>
10 #include <boost/predef/hardware/simd/x86_amd.h>
11 #include <boost/predef/hardware/simd/arm.h>
12 #include <boost/predef/hardware/simd/ppc.h>
14 #ifndef BOOST_PREDEF_HARDWARE_SIMD_H
15 #define BOOST_PREDEF_HARDWARE_SIMD_H
17 #include <boost/predef/version_number.h>
20 [section Using the `BOOST_HW_SIMD_*` predefs]
21 [include ../doc/hardware_simd.qbk]
24 [/ --------------------------- ]
26 [section `BOOST_HW_SIMD_*`]
28 [heading `BOOST_HW_SIMD`]
30 The SIMD extension detected for a specific architectures.
31 Version number depends on the detected extension.
34 [[__predef_symbol__] [__predef_version__]]
36 [[`BOOST_HW_SIMD_X86_AVAILABLE`] [__predef_detection__]]
37 [[`BOOST_HW_SIMD_X86_AMD_AVAILABLE`] [__predef_detection__]]
38 [[`BOOST_HW_SIMD_ARM_AVAILABLE`] [__predef_detection__]]
39 [[`BOOST_HW_SIMD_PPC_AVAILABLE`] [__predef_detection__]]
42 [include ../include/boost/predef/hardware/simd/x86.h]
43 [include ../include/boost/predef/hardware/simd/x86_amd.h]
44 [include ../include/boost/predef/hardware/simd/arm.h]
45 [include ../include/boost/predef/hardware/simd/ppc.h]
49 [/ --------------------------- ]
51 [section `BOOST_HW_SIMD_X86_*_VERSION`]
52 [include ../include/boost/predef/hardware/simd/x86/versions.h]
55 [section `BOOST_HW_SIMD_X86_AMD_*_VERSION`]
56 [include ../include/boost/predef/hardware/simd/x86_amd/versions.h]
59 [section `BOOST_HW_SIMD_ARM_*_VERSION`]
60 [include ../include/boost/predef/hardware/simd/arm/versions.h]
63 [section `BOOST_HW_SIMD_PPC_*_VERSION`]
64 [include ../include/boost/predef/hardware/simd/ppc/versions.h]
69 // We check if SIMD extension of multiples architectures have been detected,
70 // if yes, then this is an error!
72 // NOTE: _X86_AMD implies _X86, so there is no need to check for it here!
74 #if defined(BOOST_HW_SIMD_ARM_AVAILABLE) && defined(BOOST_HW_SIMD_PPC_AVAILABLE) ||\
75 defined(BOOST_HW_SIMD_ARM_AVAILABLE) && defined(BOOST_HW_SIMD_X86_AVAILABLE) ||\
76 defined(BOOST_HW_SIMD_PPC_AVAILABLE) && defined(BOOST_HW_SIMD_X86_AVAILABLE)
77 # error "Multiple SIMD architectures detected, this cannot happen!"
80 #if defined(BOOST_HW_SIMD_X86_AVAILABLE) && defined(BOOST_HW_SIMD_X86_AMD_AVAILABLE)
81 // If both standard _X86 and _X86_AMD are available,
82 // then take the biggest version of the two!
83 # if BOOST_HW_SIMD_X86 >= BOOST_HW_SIMD_X86_AMD
84 # define BOOST_HW_SIMD BOOST_HW_SIMD_X86
86 # define BOOST_HW_SIMD BOOST_HW_SIMD_X86_AMD
90 #if !defined(BOOST_HW_SIMD)
91 // At this point, only one of these two is defined
92 # if defined(BOOST_HW_SIMD_X86_AVAILABLE)
93 # define BOOST_HW_SIMD BOOST_HW_SIMD_X86
95 # if defined(BOOST_HW_SIMD_X86_AMD_AVAILABLE)
96 # define BOOST_HW_SIMD BOOST_HW_SIMD_X86_AMD
100 #if defined(BOOST_HW_SIMD_ARM_AVAILABLE)
101 # define BOOST_HW_SIMD BOOST_HW_SIMD_ARM
104 #if defined(BOOST_HW_SIMD_PPC_AVAILABLE)
105 # define BOOST_HW_SIMD BOOST_HW_SIMD_PPC
108 #if defined(BOOST_HW_SIMD)
109 # define BOOST_HW_SIMD_AVAILABLE
111 # define BOOST_HW_SIMD BOOST_VERSION_NUMBER_NOT_AVAILABLE
114 #define BOOST_HW_SIMD_NAME "Hardware SIMD"
118 #include <boost/predef/detail/test.h>
119 BOOST_PREDEF_DECLARE_TEST(BOOST_HW_SIMD
, BOOST_HW_SIMD_NAME
)