File indexing completed on 2025-01-30 09:33:50
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef BOOST_ATOMIC_DETAIL_CAPS_GCC_ATOMIC_HPP_INCLUDED_
0015 #define BOOST_ATOMIC_DETAIL_CAPS_GCC_ATOMIC_HPP_INCLUDED_
0016
0017 #include <boost/atomic/detail/config.hpp>
0018 #include <boost/atomic/detail/int_sizes.hpp>
0019
0020 #if defined(BOOST_ATOMIC_DETAIL_CORE_ARCH_BACKEND_HEADER)
0021 #include BOOST_ATOMIC_DETAIL_CORE_ARCH_BACKEND_HEADER(boost/atomic/detail/caps_arch_)
0022 #endif
0023
0024 #ifdef BOOST_HAS_PRAGMA_ONCE
0025 #pragma once
0026 #endif
0027
0028
0029 #define BOOST_ATOMIC_DETAIL_GCC_ATOMIC_INT8_LOCK_FREE __GCC_ATOMIC_CHAR_LOCK_FREE
0030
0031 #if BOOST_ATOMIC_DETAIL_SIZEOF_SHORT == 2
0032 #define BOOST_ATOMIC_DETAIL_GCC_ATOMIC_INT16_LOCK_FREE __GCC_ATOMIC_SHORT_LOCK_FREE
0033 #elif BOOST_ATOMIC_DETAIL_SIZEOF_INT == 2
0034 #define BOOST_ATOMIC_DETAIL_GCC_ATOMIC_INT16_LOCK_FREE __GCC_ATOMIC_INT_LOCK_FREE
0035 #elif BOOST_ATOMIC_DETAIL_SIZEOF_LONG == 2
0036 #define BOOST_ATOMIC_DETAIL_GCC_ATOMIC_INT16_LOCK_FREE __GCC_ATOMIC_LONG_LOCK_FREE
0037 #elif BOOST_ATOMIC_DETAIL_SIZEOF_LLONG == 2
0038 #define BOOST_ATOMIC_DETAIL_GCC_ATOMIC_INT16_LOCK_FREE __GCC_ATOMIC_LLONG_LOCK_FREE
0039 #else
0040 #define BOOST_ATOMIC_DETAIL_GCC_ATOMIC_INT16_LOCK_FREE 0
0041 #endif
0042
0043 #if BOOST_ATOMIC_DETAIL_SIZEOF_SHORT == 4
0044 #define BOOST_ATOMIC_DETAIL_GCC_ATOMIC_INT32_LOCK_FREE __GCC_ATOMIC_SHORT_LOCK_FREE
0045 #elif BOOST_ATOMIC_DETAIL_SIZEOF_INT == 4
0046 #define BOOST_ATOMIC_DETAIL_GCC_ATOMIC_INT32_LOCK_FREE __GCC_ATOMIC_INT_LOCK_FREE
0047 #elif BOOST_ATOMIC_DETAIL_SIZEOF_LONG == 4
0048 #define BOOST_ATOMIC_DETAIL_GCC_ATOMIC_INT32_LOCK_FREE __GCC_ATOMIC_LONG_LOCK_FREE
0049 #elif BOOST_ATOMIC_DETAIL_SIZEOF_LLONG == 4
0050 #define BOOST_ATOMIC_DETAIL_GCC_ATOMIC_INT32_LOCK_FREE __GCC_ATOMIC_LLONG_LOCK_FREE
0051 #else
0052 #define BOOST_ATOMIC_DETAIL_GCC_ATOMIC_INT32_LOCK_FREE 0
0053 #endif
0054
0055 #if BOOST_ATOMIC_DETAIL_SIZEOF_SHORT == 8
0056 #define BOOST_ATOMIC_DETAIL_GCC_ATOMIC_INT64_LOCK_FREE __GCC_ATOMIC_SHORT_LOCK_FREE
0057 #elif BOOST_ATOMIC_DETAIL_SIZEOF_INT == 8
0058 #define BOOST_ATOMIC_DETAIL_GCC_ATOMIC_INT64_LOCK_FREE __GCC_ATOMIC_INT_LOCK_FREE
0059 #elif BOOST_ATOMIC_DETAIL_SIZEOF_LONG == 8
0060 #define BOOST_ATOMIC_DETAIL_GCC_ATOMIC_INT64_LOCK_FREE __GCC_ATOMIC_LONG_LOCK_FREE
0061 #elif BOOST_ATOMIC_DETAIL_SIZEOF_LLONG == 8
0062 #define BOOST_ATOMIC_DETAIL_GCC_ATOMIC_INT64_LOCK_FREE __GCC_ATOMIC_LLONG_LOCK_FREE
0063 #else
0064 #define BOOST_ATOMIC_DETAIL_GCC_ATOMIC_INT64_LOCK_FREE 0
0065 #endif
0066
0067 #if BOOST_ATOMIC_DETAIL_SIZEOF_SHORT == 16
0068 #define BOOST_ATOMIC_DETAIL_GCC_ATOMIC_INT128_LOCK_FREE __GCC_ATOMIC_SHORT_LOCK_FREE
0069 #elif BOOST_ATOMIC_DETAIL_SIZEOF_INT == 16
0070 #define BOOST_ATOMIC_DETAIL_GCC_ATOMIC_INT128_LOCK_FREE __GCC_ATOMIC_INT_LOCK_FREE
0071 #elif BOOST_ATOMIC_DETAIL_SIZEOF_LONG == 16
0072 #define BOOST_ATOMIC_DETAIL_GCC_ATOMIC_INT128_LOCK_FREE __GCC_ATOMIC_LONG_LOCK_FREE
0073 #elif BOOST_ATOMIC_DETAIL_SIZEOF_LLONG == 16
0074 #define BOOST_ATOMIC_DETAIL_GCC_ATOMIC_INT128_LOCK_FREE __GCC_ATOMIC_LLONG_LOCK_FREE
0075 #else
0076 #define BOOST_ATOMIC_DETAIL_GCC_ATOMIC_INT128_LOCK_FREE 0
0077 #endif
0078
0079
0080
0081
0082
0083
0084 #if defined(BOOST_ATOMIC_DETAIL_X86_HAS_CMPXCHG16B) &&\
0085 (\
0086 (defined(BOOST_CLANG) && (__clang_major__ < 3 || (__clang_major__ == 3 && __clang_minor__ < 5))) ||\
0087 (defined(BOOST_GCC) && BOOST_GCC >= 70000)\
0088 )
0089 #undef BOOST_ATOMIC_DETAIL_GCC_ATOMIC_INT128_LOCK_FREE
0090 #define BOOST_ATOMIC_DETAIL_GCC_ATOMIC_INT128_LOCK_FREE 0
0091 #endif
0092
0093
0094
0095
0096
0097 #if defined(BOOST_ATOMIC_DETAIL_X86_HAS_CMPXCHG8B) && defined(BOOST_CLANG)
0098 #undef BOOST_ATOMIC_DETAIL_GCC_ATOMIC_INT64_LOCK_FREE
0099 #define BOOST_ATOMIC_DETAIL_GCC_ATOMIC_INT64_LOCK_FREE 0
0100 #endif
0101
0102
0103 #if !defined(BOOST_ATOMIC_INT128_LOCK_FREE) || (BOOST_ATOMIC_INT128_LOCK_FREE < BOOST_ATOMIC_DETAIL_GCC_ATOMIC_INT128_LOCK_FREE)
0104 #undef BOOST_ATOMIC_INT128_LOCK_FREE
0105 #define BOOST_ATOMIC_INT128_LOCK_FREE BOOST_ATOMIC_DETAIL_GCC_ATOMIC_INT128_LOCK_FREE
0106 #endif
0107
0108 #if !defined(BOOST_ATOMIC_INT64_LOCK_FREE) || (BOOST_ATOMIC_INT64_LOCK_FREE < BOOST_ATOMIC_DETAIL_GCC_ATOMIC_INT64_LOCK_FREE) || (BOOST_ATOMIC_INT64_LOCK_FREE < BOOST_ATOMIC_INT128_LOCK_FREE)
0109 #undef BOOST_ATOMIC_INT64_LOCK_FREE
0110 #if BOOST_ATOMIC_DETAIL_GCC_ATOMIC_INT64_LOCK_FREE >= BOOST_ATOMIC_INT128_LOCK_FREE
0111 #define BOOST_ATOMIC_INT64_LOCK_FREE BOOST_ATOMIC_DETAIL_GCC_ATOMIC_INT64_LOCK_FREE
0112 #else
0113 #define BOOST_ATOMIC_INT64_LOCK_FREE BOOST_ATOMIC_INT128_LOCK_FREE
0114 #endif
0115 #endif
0116
0117 #if !defined(BOOST_ATOMIC_INT32_LOCK_FREE) || (BOOST_ATOMIC_INT32_LOCK_FREE < BOOST_ATOMIC_DETAIL_GCC_ATOMIC_INT32_LOCK_FREE) || (BOOST_ATOMIC_INT32_LOCK_FREE < BOOST_ATOMIC_INT64_LOCK_FREE)
0118 #undef BOOST_ATOMIC_INT32_LOCK_FREE
0119 #if BOOST_ATOMIC_DETAIL_GCC_ATOMIC_INT32_LOCK_FREE >= BOOST_ATOMIC_INT64_LOCK_FREE
0120 #define BOOST_ATOMIC_INT32_LOCK_FREE BOOST_ATOMIC_DETAIL_GCC_ATOMIC_INT32_LOCK_FREE
0121 #else
0122 #define BOOST_ATOMIC_INT32_LOCK_FREE BOOST_ATOMIC_INT64_LOCK_FREE
0123 #endif
0124 #endif
0125
0126 #if !defined(BOOST_ATOMIC_INT16_LOCK_FREE) || (BOOST_ATOMIC_INT16_LOCK_FREE < BOOST_ATOMIC_DETAIL_GCC_ATOMIC_INT16_LOCK_FREE) || (BOOST_ATOMIC_INT16_LOCK_FREE < BOOST_ATOMIC_INT32_LOCK_FREE)
0127 #undef BOOST_ATOMIC_INT16_LOCK_FREE
0128 #if BOOST_ATOMIC_DETAIL_GCC_ATOMIC_INT16_LOCK_FREE >= BOOST_ATOMIC_INT32_LOCK_FREE
0129 #define BOOST_ATOMIC_INT16_LOCK_FREE BOOST_ATOMIC_DETAIL_GCC_ATOMIC_INT16_LOCK_FREE
0130 #else
0131 #define BOOST_ATOMIC_INT16_LOCK_FREE BOOST_ATOMIC_INT32_LOCK_FREE
0132 #endif
0133 #endif
0134
0135 #if !defined(BOOST_ATOMIC_INT8_LOCK_FREE) || (BOOST_ATOMIC_INT8_LOCK_FREE < BOOST_ATOMIC_DETAIL_GCC_ATOMIC_INT8_LOCK_FREE) || (BOOST_ATOMIC_INT8_LOCK_FREE < BOOST_ATOMIC_INT16_LOCK_FREE)
0136 #undef BOOST_ATOMIC_INT8_LOCK_FREE
0137 #if BOOST_ATOMIC_DETAIL_GCC_ATOMIC_INT8_LOCK_FREE >= BOOST_ATOMIC_INT16_LOCK_FREE
0138 #define BOOST_ATOMIC_INT8_LOCK_FREE BOOST_ATOMIC_DETAIL_GCC_ATOMIC_INT8_LOCK_FREE
0139 #else
0140 #define BOOST_ATOMIC_INT8_LOCK_FREE BOOST_ATOMIC_INT16_LOCK_FREE
0141 #endif
0142 #endif
0143
0144 #if !defined(BOOST_ATOMIC_POINTER_LOCK_FREE) || (BOOST_ATOMIC_POINTER_LOCK_FREE < __GCC_ATOMIC_POINTER_LOCK_FREE)
0145 #undef BOOST_ATOMIC_POINTER_LOCK_FREE
0146 #define BOOST_ATOMIC_POINTER_LOCK_FREE __GCC_ATOMIC_POINTER_LOCK_FREE
0147 #endif
0148
0149 #if !defined(BOOST_ATOMIC_THREAD_FENCE) || (BOOST_ATOMIC_THREAD_FENCE < 2)
0150 #undef BOOST_ATOMIC_THREAD_FENCE
0151 #define BOOST_ATOMIC_THREAD_FENCE 2
0152 #endif
0153 #if !defined(BOOST_ATOMIC_SIGNAL_FENCE) || (BOOST_ATOMIC_SIGNAL_FENCE < 2)
0154 #undef BOOST_ATOMIC_SIGNAL_FENCE
0155 #define BOOST_ATOMIC_SIGNAL_FENCE 2
0156 #endif
0157
0158 #endif