Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 09:33:50

0001 /*
0002  * Distributed under the Boost Software License, Version 1.0.
0003  * (See accompanying file LICENSE_1_0.txt or copy at
0004  * http://www.boost.org/LICENSE_1_0.txt)
0005  *
0006  * Copyright (c) 2020, 2022 Andrey Semashev
0007  */
0008 /*!
0009  * \file   atomic/detail/caps_arch_gcc_aarch64.hpp
0010  *
0011  * This header defines feature capabilities macros
0012  */
0013 
0014 #ifndef BOOST_ATOMIC_DETAIL_CAPS_ARCH_GCC_AARCH64_HPP_INCLUDED_
0015 #define BOOST_ATOMIC_DETAIL_CAPS_ARCH_GCC_AARCH64_HPP_INCLUDED_
0016 
0017 #include <boost/atomic/detail/config.hpp>
0018 
0019 #ifdef BOOST_HAS_PRAGMA_ONCE
0020 #pragma once
0021 #endif
0022 
0023 #if defined(__AARCH64EL__) || \
0024     (defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) || \
0025     (defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)) || \
0026     defined(BOOST_WINDOWS)
0027 #define BOOST_ATOMIC_DETAIL_AARCH64_LITTLE_ENDIAN
0028 #elif defined(__AARCH64EB__) || \
0029     defined(__ARM_BIG_ENDIAN) || \
0030     (defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) || \
0031     (defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__))
0032 #define BOOST_ATOMIC_DETAIL_AARCH64_BIG_ENDIAN
0033 #else
0034 #include <boost/predef/other/endian.h>
0035 #if BOOST_ENDIAN_LITTLE_BYTE
0036 #define BOOST_ATOMIC_DETAIL_AARCH64_LITTLE_ENDIAN
0037 #elif BOOST_ENDIAN_BIG_BYTE
0038 #define BOOST_ATOMIC_DETAIL_AARCH64_BIG_ENDIAN
0039 #else
0040 #error "Boost.Atomic: Failed to determine AArch64 endianness, the target platform is not supported. Please, report to the developers (patches are welcome)."
0041 #endif
0042 #endif
0043 
0044 #if defined(__ARM_FEATURE_ATOMICS)
0045 // ARMv8.1 added Large System Extensions, which includes cas, swp, and a number of other read-modify-write instructions
0046 #define BOOST_ATOMIC_DETAIL_AARCH64_HAS_LSE
0047 #endif
0048 
0049 #if defined(__ARM_FEATURE_COMPLEX)
0050 // ARMv8.3 added Release Consistency processor consistent (RCpc) memory model, which includes ldapr and similar instructions.
0051 // Unfortunately, there seems to be no dedicated __ARM_FEATURE macro for this, so we use __ARM_FEATURE_COMPLEX, which is also defined starting ARMv8.3.
0052 #define BOOST_ATOMIC_DETAIL_AARCH64_HAS_RCPC
0053 #endif
0054 
0055 #define BOOST_ATOMIC_INT8_LOCK_FREE 2
0056 #define BOOST_ATOMIC_INT16_LOCK_FREE 2
0057 #define BOOST_ATOMIC_INT32_LOCK_FREE 2
0058 #define BOOST_ATOMIC_INT64_LOCK_FREE 2
0059 #define BOOST_ATOMIC_INT128_LOCK_FREE 2
0060 #define BOOST_ATOMIC_POINTER_LOCK_FREE 2
0061 
0062 #define BOOST_ATOMIC_THREAD_FENCE 2
0063 #define BOOST_ATOMIC_SIGNAL_FENCE 2
0064 
0065 #endif // BOOST_ATOMIC_DETAIL_CAPS_ARCH_GCC_AARCH64_HPP_INCLUDED_