• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *            Copyright Andrey Semashev 2013.
3  * Distributed under the Boost Software License, Version 1.0.
4  *    (See accompanying file LICENSE_1_0.txt or copy at
5  *          https://www.boost.org/LICENSE_1_0.txt)
6  */
7 /*!
8  * \file   uuid/detail/config.hpp
9  *
10  * \brief  This header defines configuration macros for Boost.UUID.
11  */
12 
13 #ifndef BOOST_UUID_DETAIL_CONFIG_HPP_INCLUDED_
14 #define BOOST_UUID_DETAIL_CONFIG_HPP_INCLUDED_
15 
16 #include <boost/config.hpp>
17 
18 #ifdef BOOST_HAS_PRAGMA_ONCE
19 #pragma once
20 #endif
21 
22 #if !defined(BOOST_UUID_NO_SIMD)
23 
24 #if defined(__GNUC__) && defined(__SSE2__)
25 
26 // GCC and its pretenders go here
27 #ifndef BOOST_UUID_USE_SSE2
28 #define BOOST_UUID_USE_SSE2
29 #endif
30 
31 #if defined(__SSE3__) && !defined(BOOST_UUID_USE_SSE3)
32 #define BOOST_UUID_USE_SSE3
33 #endif
34 
35 #if defined(__SSE4_1__) && !defined(BOOST_UUID_USE_SSE41)
36 #define BOOST_UUID_USE_SSE41
37 #endif
38 
39 #elif defined(_MSC_VER)
40 
41 #if (defined(_M_X64) || (defined(_M_IX86) && defined(_M_IX86_FP) && _M_IX86_FP >= 2)) && !defined(BOOST_UUID_USE_SSE2)
42 #define BOOST_UUID_USE_SSE2
43 #endif
44 
45 #if defined(__AVX__)
46 #if !defined(BOOST_UUID_USE_SSE41)
47 #define BOOST_UUID_USE_SSE41
48 #endif
49 #if !defined(BOOST_UUID_USE_SSE3)
50 #define BOOST_UUID_USE_SSE3
51 #endif
52 #if !defined(BOOST_UUID_USE_SSE2)
53 #define BOOST_UUID_USE_SSE2
54 #endif
55 #endif
56 
57 #endif
58 
59 // More advanced ISA extensions imply less advanced are also available
60 #if !defined(BOOST_UUID_USE_SSE3) && defined(BOOST_UUID_USE_SSE41)
61 #define BOOST_UUID_USE_SSE3
62 #endif
63 
64 #if !defined(BOOST_UUID_USE_SSE2) && defined(BOOST_UUID_USE_SSE3)
65 #define BOOST_UUID_USE_SSE2
66 #endif
67 
68 #if !defined(BOOST_UUID_NO_SIMD) && !defined(BOOST_UUID_USE_SSE41) && !defined(BOOST_UUID_USE_SSE3) && !defined(BOOST_UUID_USE_SSE2)
69 #define BOOST_UUID_NO_SIMD
70 #endif
71 
72 #endif // !defined(BOOST_UUID_NO_SIMD)
73 
74 #endif // BOOST_UUID_DETAIL_CONFIG_HPP_INCLUDED_
75