caps_arch_gcc_ppc.hpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*
  2. * Distributed under the Boost Software License, Version 1.0.
  3. * (See accompanying file LICENSE_1_0.txt or copy at
  4. * http://www.boost.org/LICENSE_1_0.txt)
  5. *
  6. * Copyright (c) 2009 Helge Bahmann
  7. * Copyright (c) 2013 Tim Blechmann
  8. * Copyright (c) 2014 Andrey Semashev
  9. */
  10. /*!
  11. * \file atomic/detail/caps_arch_gcc_ppc.hpp
  12. *
  13. * This header defines feature capabilities macros
  14. */
  15. #ifndef BOOST_ATOMIC_DETAIL_CAPS_ARCH_GCC_PPC_HPP_INCLUDED_
  16. #define BOOST_ATOMIC_DETAIL_CAPS_ARCH_GCC_PPC_HPP_INCLUDED_
  17. #include <boost/atomic/detail/config.hpp>
  18. #ifdef BOOST_HAS_PRAGMA_ONCE
  19. #pragma once
  20. #endif
  21. #if defined(__POWERPC__) || defined(__PPC__)
  22. #if defined(_ARCH_PWR8)
  23. // Power8 and later architectures have 8 and 16-bit instructions
  24. #define BOOST_ATOMIC_DETAIL_PPC_HAS_LBARX_STBCX
  25. #define BOOST_ATOMIC_DETAIL_PPC_HAS_LHARX_STHCX
  26. #endif
  27. #if defined(__powerpc64__) || defined(__PPC64__)
  28. // Power7 and later architectures in 64-bit mode have 64-bit instructions
  29. #define BOOST_ATOMIC_DETAIL_PPC_HAS_LDARX_STDCX
  30. #if defined(_ARCH_PWR8)
  31. // Power8 also has 128-bit instructions
  32. #define BOOST_ATOMIC_DETAIL_PPC_HAS_LQARX_STQCX
  33. #endif
  34. #endif
  35. #endif // defined(__POWERPC__) || defined(__PPC__)
  36. #define BOOST_ATOMIC_INT8_LOCK_FREE 2
  37. #define BOOST_ATOMIC_INT16_LOCK_FREE 2
  38. #define BOOST_ATOMIC_INT32_LOCK_FREE 2
  39. #if defined(BOOST_ATOMIC_DETAIL_PPC_HAS_LDARX_STDCX)
  40. #define BOOST_ATOMIC_INT64_LOCK_FREE 2
  41. #endif
  42. #define BOOST_ATOMIC_POINTER_LOCK_FREE 2
  43. #define BOOST_ATOMIC_THREAD_FENCE 2
  44. #define BOOST_ATOMIC_SIGNAL_FENCE 2
  45. #endif // BOOST_ATOMIC_DETAIL_CAPS_ARCH_GCC_PPC_HPP_INCLUDED_