hwcaps_gcc_ppc.hpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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) 2017 Andrey Semashev
  7. */
  8. /*!
  9. * \file atomic/detail/hwcaps_gcc_ppc.hpp
  10. *
  11. * This header defines hardware capabilities macros for PowerPC
  12. */
  13. #ifndef BOOST_ATOMIC_DETAIL_HWCAPS_GCC_PPC_HPP_INCLUDED_
  14. #define BOOST_ATOMIC_DETAIL_HWCAPS_GCC_PPC_HPP_INCLUDED_
  15. #include <boost/atomic/detail/config.hpp>
  16. #ifdef BOOST_HAS_PRAGMA_ONCE
  17. #pragma once
  18. #endif
  19. #if defined(__POWERPC__) || defined(__PPC__)
  20. #if defined(_ARCH_PWR8)
  21. // Power8 and later architectures have 8 and 16-bit instructions
  22. #define BOOST_ATOMIC_DETAIL_PPC_HAS_LBARX_STBCX
  23. #define BOOST_ATOMIC_DETAIL_PPC_HAS_LHARX_STHCX
  24. #endif
  25. #if defined(__powerpc64__) || defined(__PPC64__)
  26. // Power7 and later architectures in 64-bit mode have 64-bit instructions
  27. #define BOOST_ATOMIC_DETAIL_PPC_HAS_LDARX_STDCX
  28. #if defined(_ARCH_PWR8)
  29. // Power8 also has 128-bit instructions
  30. #define BOOST_ATOMIC_DETAIL_PPC_HAS_LQARX_STQCX
  31. #endif
  32. #endif
  33. #endif // defined(__POWERPC__) || defined(__PPC__)
  34. #endif // BOOST_ATOMIC_DETAIL_HWCAPS_GCC_PPC_HPP_INCLUDED_