config.hpp 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. #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. #elif defined(_MSC_VER)
  31. #if (defined(_M_X64) || (defined(_M_IX86) && defined(_M_IX86_FP) && _M_IX86_FP >= 2)) && !defined(BOOST_UUID_USE_SSE2)
  32. #define BOOST_UUID_USE_SSE2
  33. #endif
  34. #if defined(__AVX__)
  35. #if !defined(BOOST_UUID_USE_SSE41)
  36. #define BOOST_UUID_USE_SSE41
  37. #endif
  38. #if !defined(BOOST_UUID_USE_SSE3)
  39. #define BOOST_UUID_USE_SSE3
  40. #endif
  41. #if !defined(BOOST_UUID_USE_SSE2)
  42. #define BOOST_UUID_USE_SSE2
  43. #endif
  44. #endif
  45. #endif
  46. // More advanced ISA extensions imply less advanced are also available
  47. #if !defined(BOOST_UUID_USE_SSE3) && defined(BOOST_UUID_USE_SSE41)
  48. #define BOOST_UUID_USE_SSE3
  49. #endif
  50. #if !defined(BOOST_UUID_USE_SSE2) && defined(BOOST_UUID_USE_SSE3)
  51. #define BOOST_UUID_USE_SSE2
  52. #endif
  53. #if !defined(BOOST_UUID_NO_SIMD) && !defined(BOOST_UUID_USE_SSE41) && !defined(BOOST_UUID_USE_SSE3) && !defined(BOOST_UUID_USE_SSE2)
  54. #define BOOST_UUID_NO_SIMD
  55. #endif
  56. #endif // !defined(BOOST_UUID_NO_SIMD)
  57. #endif // BOOST_UUID_DETAIL_CONFIG_HPP_INCLUDED_