File indexing completed on 2025-01-30 09:33:57
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef BOOST_ATOMIC_DETAIL_FLOAT_SIZES_HPP_INCLUDED_
0015 #define BOOST_ATOMIC_DETAIL_FLOAT_SIZES_HPP_INCLUDED_
0016
0017 #include <boost/atomic/detail/config.hpp>
0018
0019 #ifdef BOOST_HAS_PRAGMA_ONCE
0020 #pragma once
0021 #endif
0022
0023
0024
0025
0026
0027
0028
0029 #if defined(__FLT_RADIX__) && defined(__FLT_MANT_DIG__) && defined(__FLT_MAX_EXP__) && \
0030 defined(__DBL_MANT_DIG__) && defined(__DBL_MAX_EXP__) && defined(__LDBL_MANT_DIG__) && defined(__LDBL_MAX_EXP__)
0031
0032 #if (__FLT_RADIX__ == 2)
0033
0034 #if (__FLT_MANT_DIG__ == 11) && (__FLT_MAX_EXP__ == 16)
0035 #define BOOST_ATOMIC_DETAIL_SIZEOF_FLOAT_VALUE 2
0036 #elif (__FLT_MANT_DIG__ == 24) && (__FLT_MAX_EXP__ == 128)
0037 #define BOOST_ATOMIC_DETAIL_SIZEOF_FLOAT_VALUE 4
0038 #elif (__FLT_MANT_DIG__ == 53) && (__FLT_MAX_EXP__ == 1024)
0039 #define BOOST_ATOMIC_DETAIL_SIZEOF_FLOAT_VALUE 8
0040 #elif (__FLT_MANT_DIG__ == 64 || __FLT_MANT_DIG__ == 53 || __FLT_MANT_DIG__ == 24) && (__FLT_MAX_EXP__ == 16384)
0041 #define BOOST_ATOMIC_DETAIL_SIZEOF_FLOAT_VALUE 10
0042 #elif (__FLT_MANT_DIG__ == 106) && (__FLT_MAX_EXP__ == 1024)
0043 #define BOOST_ATOMIC_DETAIL_SIZEOF_FLOAT_VALUE 16
0044 #elif (__FLT_MANT_DIG__ == 113) && (__FLT_MAX_EXP__ == 16384)
0045 #define BOOST_ATOMIC_DETAIL_SIZEOF_FLOAT_VALUE 16
0046 #elif (__FLT_MANT_DIG__ == 237) && (__FLT_MAX_EXP__ == 262144)
0047 #define BOOST_ATOMIC_DETAIL_SIZEOF_FLOAT_VALUE 32
0048 #endif
0049
0050 #if (__DBL_MANT_DIG__ == 11) && (__DBL_MAX_EXP__ == 16)
0051 #define BOOST_ATOMIC_DETAIL_SIZEOF_DOUBLE_VALUE 2
0052 #elif (__DBL_MANT_DIG__ == 24) && (__DBL_MAX_EXP__ == 128)
0053 #define BOOST_ATOMIC_DETAIL_SIZEOF_DOUBLE_VALUE 4
0054 #elif (__DBL_MANT_DIG__ == 53) && (__DBL_MAX_EXP__ == 1024)
0055 #define BOOST_ATOMIC_DETAIL_SIZEOF_DOUBLE_VALUE 8
0056 #elif (__DBL_MANT_DIG__ == 64 || __DBL_MANT_DIG__ == 53 || __DBL_MANT_DIG__ == 24) && (__DBL_MAX_EXP__ == 16384)
0057 #define BOOST_ATOMIC_DETAIL_SIZEOF_DOUBLE_VALUE 10
0058 #elif (__DBL_MANT_DIG__ == 106) && (__DBL_MAX_EXP__ == 1024)
0059 #define BOOST_ATOMIC_DETAIL_SIZEOF_DOUBLE_VALUE 16
0060 #elif (__DBL_MANT_DIG__ == 113) && (__DBL_MAX_EXP__ == 16384)
0061 #define BOOST_ATOMIC_DETAIL_SIZEOF_DOUBLE_VALUE 16
0062 #elif (__DBL_MANT_DIG__ == 237) && (__DBL_MAX_EXP__ == 262144)
0063 #define BOOST_ATOMIC_DETAIL_SIZEOF_DOUBLE_VALUE 32
0064 #endif
0065
0066 #if (__LDBL_MANT_DIG__ == 11) && (__LDBL_MAX_EXP__ == 16)
0067 #define BOOST_ATOMIC_DETAIL_SIZEOF_LONG_DOUBLE_VALUE 2
0068 #elif (__LDBL_MANT_DIG__ == 24) && (__LDBL_MAX_EXP__ == 128)
0069 #define BOOST_ATOMIC_DETAIL_SIZEOF_LONG_DOUBLE_VALUE 4
0070 #elif (__LDBL_MANT_DIG__ == 53) && (__LDBL_MAX_EXP__ == 1024)
0071 #define BOOST_ATOMIC_DETAIL_SIZEOF_LONG_DOUBLE_VALUE 8
0072 #elif (__LDBL_MANT_DIG__ == 64 || __LDBL_MANT_DIG__ == 53 || __LDBL_MANT_DIG__ == 24) && (__LDBL_MAX_EXP__ == 16384)
0073 #define BOOST_ATOMIC_DETAIL_SIZEOF_LONG_DOUBLE_VALUE 10
0074 #elif (__LDBL_MANT_DIG__ == 106) && (__LDBL_MAX_EXP__ == 1024)
0075 #define BOOST_ATOMIC_DETAIL_SIZEOF_LONG_DOUBLE_VALUE 16
0076 #elif (__LDBL_MANT_DIG__ == 113) && (__LDBL_MAX_EXP__ == 16384)
0077 #define BOOST_ATOMIC_DETAIL_SIZEOF_LONG_DOUBLE_VALUE 16
0078 #elif (__LDBL_MANT_DIG__ == 237) && (__LDBL_MAX_EXP__ == 262144)
0079 #define BOOST_ATOMIC_DETAIL_SIZEOF_LONG_DOUBLE_VALUE 32
0080 #endif
0081
0082 #elif (__FLT_RADIX__ == 10)
0083
0084 #if (__FLT_MANT_DIG__ == 7) && (__FLT_MAX_EXP__ == 97)
0085 #define BOOST_ATOMIC_DETAIL_SIZEOF_FLOAT_VALUE 4
0086 #elif (__FLT_MANT_DIG__ == 16) && (__FLT_MAX_EXP__ == 385)
0087 #define BOOST_ATOMIC_DETAIL_SIZEOF_FLOAT_VALUE 8
0088 #elif (__FLT_MANT_DIG__ == 34) && (__FLT_MAX_EXP__ == 6145)
0089 #define BOOST_ATOMIC_DETAIL_SIZEOF_FLOAT_VALUE 16
0090 #endif
0091
0092 #if (__DBL_MANT_DIG__ == 7) && (__DBL_MAX_EXP__ == 97)
0093 #define BOOST_ATOMIC_DETAIL_SIZEOF_DOUBLE_VALUE 4
0094 #elif (__DBL_MANT_DIG__ == 16) && (__DBL_MAX_EXP__ == 385)
0095 #define BOOST_ATOMIC_DETAIL_SIZEOF_DOUBLE_VALUE 8
0096 #elif (__DBL_MANT_DIG__ == 34) && (__DBL_MAX_EXP__ == 6145)
0097 #define BOOST_ATOMIC_DETAIL_SIZEOF_DOUBLE_VALUE 16
0098 #endif
0099
0100 #if (__LDBL_MANT_DIG__ == 7) && (__LDBL_MAX_EXP__ == 97)
0101 #define BOOST_ATOMIC_DETAIL_SIZEOF_LONG_DOUBLE_VALUE 4
0102 #elif (__LDBL_MANT_DIG__ == 16) && (__LDBL_MAX_EXP__ == 385)
0103 #define BOOST_ATOMIC_DETAIL_SIZEOF_LONG_DOUBLE_VALUE 8
0104 #elif (__LDBL_MANT_DIG__ == 34) && (__LDBL_MAX_EXP__ == 6145)
0105 #define BOOST_ATOMIC_DETAIL_SIZEOF_LONG_DOUBLE_VALUE 16
0106 #endif
0107
0108 #endif
0109
0110 #else
0111
0112 #include <cfloat>
0113
0114 #if (FLT_RADIX == 2)
0115
0116 #if (FLT_MANT_DIG == 11) && (FLT_MAX_EXP == 16)
0117 #define BOOST_ATOMIC_DETAIL_SIZEOF_FLOAT_VALUE 2
0118 #elif (FLT_MANT_DIG == 24) && (FLT_MAX_EXP == 128)
0119 #define BOOST_ATOMIC_DETAIL_SIZEOF_FLOAT_VALUE 4
0120 #elif (FLT_MANT_DIG == 53) && (FLT_MAX_EXP == 1024)
0121 #define BOOST_ATOMIC_DETAIL_SIZEOF_FLOAT_VALUE 8
0122 #elif (FLT_MANT_DIG == 64 || FLT_MANT_DIG == 53 || FLT_MANT_DIG == 24) && (FLT_MAX_EXP == 16384)
0123 #define BOOST_ATOMIC_DETAIL_SIZEOF_FLOAT_VALUE 10
0124 #elif (FLT_MANT_DIG == 106) && (FLT_MAX_EXP == 1024)
0125 #define BOOST_ATOMIC_DETAIL_SIZEOF_FLOAT_VALUE 16
0126 #elif (FLT_MANT_DIG == 113) && (FLT_MAX_EXP == 16384)
0127 #define BOOST_ATOMIC_DETAIL_SIZEOF_FLOAT_VALUE 16
0128 #elif (FLT_MANT_DIG == 237) && (FLT_MAX_EXP == 262144)
0129 #define BOOST_ATOMIC_DETAIL_SIZEOF_FLOAT_VALUE 32
0130 #endif
0131
0132 #if (DBL_MANT_DIG == 11) && (DBL_MAX_EXP == 16)
0133 #define BOOST_ATOMIC_DETAIL_SIZEOF_DOUBLE_VALUE 2
0134 #elif (DBL_MANT_DIG == 24) && (DBL_MAX_EXP == 128)
0135 #define BOOST_ATOMIC_DETAIL_SIZEOF_DOUBLE_VALUE 4
0136 #elif (DBL_MANT_DIG == 53) && (DBL_MAX_EXP == 1024)
0137 #define BOOST_ATOMIC_DETAIL_SIZEOF_DOUBLE_VALUE 8
0138 #elif (DBL_MANT_DIG == 64 || DBL_MANT_DIG == 53 || DBL_MANT_DIG == 24) && (DBL_MAX_EXP == 16384)
0139 #define BOOST_ATOMIC_DETAIL_SIZEOF_DOUBLE_VALUE 10
0140 #elif (DBL_MANT_DIG == 106) && (DBL_MAX_EXP == 1024)
0141 #define BOOST_ATOMIC_DETAIL_SIZEOF_DOUBLE_VALUE 16
0142 #elif (DBL_MANT_DIG == 113) && (DBL_MAX_EXP == 16384)
0143 #define BOOST_ATOMIC_DETAIL_SIZEOF_DOUBLE_VALUE 16
0144 #elif (DBL_MANT_DIG == 237) && (DBL_MAX_EXP == 262144)
0145 #define BOOST_ATOMIC_DETAIL_SIZEOF_DOUBLE_VALUE 32
0146 #endif
0147
0148 #if (LDBL_MANT_DIG == 11) && (LDBL_MAX_EXP == 16)
0149 #define BOOST_ATOMIC_DETAIL_SIZEOF_LONG_DOUBLE_VALUE 2
0150 #elif (LDBL_MANT_DIG == 24) && (LDBL_MAX_EXP == 128)
0151 #define BOOST_ATOMIC_DETAIL_SIZEOF_LONG_DOUBLE_VALUE 4
0152 #elif (LDBL_MANT_DIG == 53) && (LDBL_MAX_EXP == 1024)
0153 #define BOOST_ATOMIC_DETAIL_SIZEOF_LONG_DOUBLE_VALUE 8
0154 #elif (LDBL_MANT_DIG == 64 || LDBL_MANT_DIG == 53 || LDBL_MANT_DIG == 24) && (LDBL_MAX_EXP == 16384)
0155 #define BOOST_ATOMIC_DETAIL_SIZEOF_LONG_DOUBLE_VALUE 10
0156 #elif (LDBL_MANT_DIG == 106) && (LDBL_MAX_EXP == 1024)
0157 #define BOOST_ATOMIC_DETAIL_SIZEOF_LONG_DOUBLE_VALUE 16
0158 #elif (LDBL_MANT_DIG == 113) && (LDBL_MAX_EXP == 16384)
0159 #define BOOST_ATOMIC_DETAIL_SIZEOF_LONG_DOUBLE_VALUE 16
0160 #elif (LDBL_MANT_DIG == 237) && (LDBL_MAX_EXP == 262144)
0161 #define BOOST_ATOMIC_DETAIL_SIZEOF_LONG_DOUBLE_VALUE 32
0162 #endif
0163
0164 #elif (FLT_RADIX == 10)
0165
0166 #if (FLT_MANT_DIG == 7) && (FLT_MAX_EXP == 97)
0167 #define BOOST_ATOMIC_DETAIL_SIZEOF_FLOAT_VALUE 4
0168 #elif (FLT_MANT_DIG == 16) && (FLT_MAX_EXP == 385)
0169 #define BOOST_ATOMIC_DETAIL_SIZEOF_FLOAT_VALUE 8
0170 #elif (FLT_MANT_DIG == 34) && (FLT_MAX_EXP == 6145)
0171 #define BOOST_ATOMIC_DETAIL_SIZEOF_FLOAT_VALUE 16
0172 #endif
0173
0174 #if (DBL_MANT_DIG == 7) && (DBL_MAX_EXP == 97)
0175 #define BOOST_ATOMIC_DETAIL_SIZEOF_DOUBLE_VALUE 4
0176 #elif (DBL_MANT_DIG == 16) && (DBL_MAX_EXP == 385)
0177 #define BOOST_ATOMIC_DETAIL_SIZEOF_DOUBLE_VALUE 8
0178 #elif (DBL_MANT_DIG == 34) && (DBL_MAX_EXP == 6145)
0179 #define BOOST_ATOMIC_DETAIL_SIZEOF_DOUBLE_VALUE 16
0180 #endif
0181
0182 #if (LDBL_MANT_DIG == 7) && (LDBL_MAX_EXP == 97)
0183 #define BOOST_ATOMIC_DETAIL_SIZEOF_LONG_DOUBLE_VALUE 4
0184 #elif (LDBL_MANT_DIG == 16) && (LDBL_MAX_EXP == 385)
0185 #define BOOST_ATOMIC_DETAIL_SIZEOF_LONG_DOUBLE_VALUE 8
0186 #elif (LDBL_MANT_DIG == 34) && (LDBL_MAX_EXP == 6145)
0187 #define BOOST_ATOMIC_DETAIL_SIZEOF_LONG_DOUBLE_VALUE 16
0188 #endif
0189
0190 #endif
0191
0192 #endif
0193
0194
0195 #if defined(__SIZEOF_FLOAT__)
0196 #define BOOST_ATOMIC_DETAIL_SIZEOF_FLOAT __SIZEOF_FLOAT__
0197 #endif
0198 #if defined(__SIZEOF_DOUBLE__)
0199 #define BOOST_ATOMIC_DETAIL_SIZEOF_DOUBLE __SIZEOF_DOUBLE__
0200 #endif
0201 #if defined(__SIZEOF_LONG_DOUBLE__)
0202 #define BOOST_ATOMIC_DETAIL_SIZEOF_LONG_DOUBLE __SIZEOF_LONG_DOUBLE__
0203 #endif
0204
0205 #if !defined(BOOST_ATOMIC_DETAIL_SIZEOF_FLOAT) || !defined(BOOST_ATOMIC_DETAIL_SIZEOF_DOUBLE) || !defined(BOOST_ATOMIC_DETAIL_SIZEOF_LONG_DOUBLE)
0206
0207 #define BOOST_ATOMIC_DETAIL_ALIGN_SIZE_TO_POWER_OF_2(x)\
0208 ((x) == 1u ? 1u : ((x) == 2u ? 2u : ((x) <= 4u ? 4u : ((x) <= 8u ? 8u : ((x) <= 16u ? 16u : ((x) <= 32u ? 32u : (x)))))))
0209
0210
0211 #if !defined(BOOST_ATOMIC_DETAIL_SIZEOF_FLOAT) && defined(BOOST_ATOMIC_DETAIL_SIZEOF_FLOAT_VALUE)
0212 #define BOOST_ATOMIC_DETAIL_SIZEOF_FLOAT BOOST_ATOMIC_DETAIL_ALIGN_SIZE_TO_POWER_OF_2(BOOST_ATOMIC_DETAIL_SIZEOF_FLOAT_VALUE)
0213 #endif
0214 #if !defined(BOOST_ATOMIC_DETAIL_SIZEOF_DOUBLE) && defined(BOOST_ATOMIC_DETAIL_SIZEOF_DOUBLE_VALUE)
0215 #define BOOST_ATOMIC_DETAIL_SIZEOF_DOUBLE BOOST_ATOMIC_DETAIL_ALIGN_SIZE_TO_POWER_OF_2(BOOST_ATOMIC_DETAIL_SIZEOF_DOUBLE_VALUE)
0216 #endif
0217 #if !defined(BOOST_ATOMIC_DETAIL_SIZEOF_LONG_DOUBLE) && defined(BOOST_ATOMIC_DETAIL_SIZEOF_LONG_DOUBLE_VALUE)
0218 #define BOOST_ATOMIC_DETAIL_SIZEOF_LONG_DOUBLE BOOST_ATOMIC_DETAIL_ALIGN_SIZE_TO_POWER_OF_2(BOOST_ATOMIC_DETAIL_SIZEOF_LONG_DOUBLE_VALUE)
0219 #endif
0220
0221 #endif
0222
0223 #if !defined(BOOST_ATOMIC_DETAIL_SIZEOF_FLOAT_VALUE) || !defined(BOOST_ATOMIC_DETAIL_SIZEOF_FLOAT) ||\
0224 !defined(BOOST_ATOMIC_DETAIL_SIZEOF_DOUBLE_VALUE) || !defined(BOOST_ATOMIC_DETAIL_SIZEOF_DOUBLE) ||\
0225 !defined(BOOST_ATOMIC_DETAIL_SIZEOF_LONG_DOUBLE_VALUE) || !defined(BOOST_ATOMIC_DETAIL_SIZEOF_LONG_DOUBLE)
0226 #error Boost.Atomic: Failed to determine builtin floating point type sizes, the target platform is not supported. Please, report to the developers (patches are welcome).
0227 #endif
0228
0229 #endif