config.hpp 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. * Copyright Andrey Semashev 2013, 2022.
  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. #ifndef BOOST_UUID_DETAIL_CONFIG_HPP_INCLUDED_
  13. #define BOOST_UUID_DETAIL_CONFIG_HPP_INCLUDED_
  14. #include <boost/config.hpp>
  15. #ifdef BOOST_HAS_PRAGMA_ONCE
  16. #pragma once
  17. #endif
  18. #if !defined(BOOST_UUID_NO_SIMD)
  19. #if defined(__GNUC__) && defined(__SSE2__)
  20. // GCC and its pretenders go here
  21. #ifndef BOOST_UUID_USE_SSE2
  22. #define BOOST_UUID_USE_SSE2
  23. #endif
  24. #if defined(__SSE3__) && !defined(BOOST_UUID_USE_SSE3)
  25. #define BOOST_UUID_USE_SSE3
  26. #endif
  27. #if defined(__SSE4_1__) && !defined(BOOST_UUID_USE_SSE41)
  28. #define BOOST_UUID_USE_SSE41
  29. #endif
  30. #if defined(__AVX__) && !defined(BOOST_UUID_USE_AVX)
  31. #define BOOST_UUID_USE_AVX
  32. #endif
  33. #if ((defined(__AVX512F__) && defined(__AVX512VL__) && defined(__AVX512BW__)) || defined(__AVX10_1__)) && !defined(BOOST_UUID_USE_AVX10_1)
  34. #define BOOST_UUID_USE_AVX10_1
  35. #endif
  36. #elif defined(_MSC_VER)
  37. #if (defined(_M_X64) || (defined(_M_IX86) && defined(_M_IX86_FP) && _M_IX86_FP >= 2)) && !defined(BOOST_UUID_USE_SSE2)
  38. #define BOOST_UUID_USE_SSE2
  39. #endif
  40. #if defined(__AVX__) && !defined(BOOST_UUID_USE_AVX)
  41. #define BOOST_UUID_USE_AVX
  42. #endif
  43. #if ((defined(__AVX512F__) && defined(__AVX512VL__) && defined(__AVX512BW__)) || defined(__AVX10_1__)) && !defined(BOOST_UUID_USE_AVX10_1)
  44. #define BOOST_UUID_USE_AVX10_1
  45. #endif
  46. #endif
  47. // More advanced ISA extensions imply less advanced are also available
  48. #if !defined(BOOST_UUID_USE_AVX) && defined(BOOST_UUID_USE_AVX10_1)
  49. #define BOOST_UUID_USE_AVX
  50. #endif
  51. #if !defined(BOOST_UUID_USE_SSE41) && defined(BOOST_UUID_USE_AVX)
  52. #define BOOST_UUID_USE_SSE41
  53. #endif
  54. #if !defined(BOOST_UUID_USE_SSE3) && defined(BOOST_UUID_USE_SSE41)
  55. #define BOOST_UUID_USE_SSE3
  56. #endif
  57. #if !defined(BOOST_UUID_USE_SSE2) && defined(BOOST_UUID_USE_SSE3)
  58. #define BOOST_UUID_USE_SSE2
  59. #endif
  60. #if !defined(BOOST_UUID_NO_SIMD) && \
  61. !defined(BOOST_UUID_USE_AVX10_1) && \
  62. !defined(BOOST_UUID_USE_AVX) && \
  63. !defined(BOOST_UUID_USE_SSE41) && \
  64. !defined(BOOST_UUID_USE_SSE3) && \
  65. !defined(BOOST_UUID_USE_SSE2)
  66. #define BOOST_UUID_NO_SIMD
  67. #endif
  68. #endif // !defined(BOOST_UUID_NO_SIMD)
  69. #endif // BOOST_UUID_DETAIL_CONFIG_HPP_INCLUDED_