]>
Commit | Line | Data |
---|---|---|
b32b8144 FG |
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 | ||
14 | #ifndef BOOST_ATOMIC_DETAIL_HWCAPS_GCC_PPC_HPP_INCLUDED_ | |
15 | #define BOOST_ATOMIC_DETAIL_HWCAPS_GCC_PPC_HPP_INCLUDED_ | |
16 | ||
17 | #include <boost/atomic/detail/config.hpp> | |
18 | ||
19 | #ifdef BOOST_HAS_PRAGMA_ONCE | |
20 | #pragma once | |
21 | #endif | |
22 | ||
23 | #if defined(__POWERPC__) || defined(__PPC__) | |
24 | ||
25 | #if defined(_ARCH_PWR8) | |
26 | // Power8 and later architectures have 8 and 16-bit instructions | |
27 | #define BOOST_ATOMIC_DETAIL_PPC_HAS_LBARX_STBCX | |
28 | #define BOOST_ATOMIC_DETAIL_PPC_HAS_LHARX_STHCX | |
29 | #endif | |
30 | ||
31 | #if defined(__powerpc64__) || defined(__PPC64__) | |
32 | // Power7 and later architectures in 64-bit mode have 64-bit instructions | |
33 | #define BOOST_ATOMIC_DETAIL_PPC_HAS_LDARX_STDCX | |
34 | #if defined(_ARCH_PWR8) | |
35 | // Power8 also has 128-bit instructions | |
36 | #define BOOST_ATOMIC_DETAIL_PPC_HAS_LQARX_STQCX | |
37 | #endif | |
38 | #endif | |
39 | ||
40 | #endif // defined(__POWERPC__) || defined(__PPC__) | |
41 | ||
42 | #endif // BOOST_ATOMIC_DETAIL_HWCAPS_GCC_PPC_HPP_INCLUDED_ |