The best way to control Claude Code, Codex and more from any computer or phone
Large file — syntax highlighting disabled.
| 1 | /* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */ |
| 2 | /* 71fd833d9666141edcd1d3c109a80e228303d8d7 */ |
| 3 | /* :: Begin simde/wasm/simd128.h :: */ |
| 4 | /* SPDX-License-Identifier: MIT |
| 5 | * |
| 6 | * Permission is hereby granted, free of charge, to any person |
| 7 | * obtaining a copy of this software and associated documentation |
| 8 | * files (the "Software"), to deal in the Software without |
| 9 | * restriction, including without limitation the rights to use, copy, |
| 10 | * modify, merge, publish, distribute, sublicense, and/or sell copies |
| 11 | * of the Software, and to permit persons to whom the Software is |
| 12 | * furnished to do so, subject to the following conditions: |
| 13 | * |
| 14 | * The above copyright notice and this permission notice shall be |
| 15 | * included in all copies or substantial portions of the Software. |
| 16 | * |
| 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 18 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 20 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS |
| 21 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN |
| 22 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 23 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 24 | * SOFTWARE. |
| 25 | * |
| 26 | * Copyright: |
| 27 | * 2021 Evan Nemerson <evan@nemerson.com> |
| 28 | * 2023 Michael R. Crusoe <crusoe@debian.org> |
| 29 | */ |
| 30 | |
| 31 | #if !defined(SIMDE_WASM_SIMD128_H) |
| 32 | #define SIMDE_WASM_SIMD128_H |
| 33 | |
| 34 | /* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */ |
| 35 | /* 71fd833d9666141edcd1d3c109a80e228303d8d7 */ |
| 36 | /* :: Begin simde/simde-common.h :: */ |
| 37 | /* SPDX-License-Identifier: MIT |
| 38 | * |
| 39 | * Permission is hereby granted, free of charge, to any person |
| 40 | * obtaining a copy of this software and associated documentation |
| 41 | * files (the "Software"), to deal in the Software without |
| 42 | * restriction, including without limitation the rights to use, copy, |
| 43 | * modify, merge, publish, distribute, sublicense, and/or sell copies |
| 44 | * of the Software, and to permit persons to whom the Software is |
| 45 | * furnished to do so, subject to the following conditions: |
| 46 | * |
| 47 | * The above copyright notice and this permission notice shall be |
| 48 | * included in all copies or substantial portions of the Software. |
| 49 | * |
| 50 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 51 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 52 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 53 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS |
| 54 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN |
| 55 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 56 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 57 | * SOFTWARE. |
| 58 | * |
| 59 | * Copyright: |
| 60 | * 2017-2020 Evan Nemerson <evan@nemerson.com> |
| 61 | * 2023 Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology) |
| 62 | * 2023 Ju-Hung Li <jhlee@pllab.cs.nthu.edu.tw> (Copyright owned by NTHU pllab) |
| 63 | */ |
| 64 | |
| 65 | #if !defined(SIMDE_COMMON_H) |
| 66 | #define SIMDE_COMMON_H |
| 67 | |
| 68 | /* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */ |
| 69 | /* 71fd833d9666141edcd1d3c109a80e228303d8d7 */ |
| 70 | /* :: Begin simde/hedley.h :: */ |
| 71 | /* Hedley - https://nemequ.github.io/hedley |
| 72 | * Created by Evan Nemerson <evan@nemerson.com> |
| 73 | * |
| 74 | * To the extent possible under law, the author(s) have dedicated all |
| 75 | * copyright and related and neighboring rights to this software to |
| 76 | * the public domain worldwide. This software is distributed without |
| 77 | * any warranty. |
| 78 | * |
| 79 | * For details, see <http://creativecommons.org/publicdomain/zero/1.0/>. |
| 80 | * SPDX-License-Identifier: CC0-1.0 |
| 81 | */ |
| 82 | |
| 83 | #if !defined(HEDLEY_VERSION) || (HEDLEY_VERSION < 16) |
| 84 | #if defined(HEDLEY_VERSION) |
| 85 | # undef HEDLEY_VERSION |
| 86 | #endif |
| 87 | #define HEDLEY_VERSION 16 |
| 88 | |
| 89 | #if defined(HEDLEY_STRINGIFY_EX) |
| 90 | # undef HEDLEY_STRINGIFY_EX |
| 91 | #endif |
| 92 | #define HEDLEY_STRINGIFY_EX(x) #x |
| 93 | |
| 94 | #if defined(HEDLEY_STRINGIFY) |
| 95 | # undef HEDLEY_STRINGIFY |
| 96 | #endif |
| 97 | #define HEDLEY_STRINGIFY(x) HEDLEY_STRINGIFY_EX(x) |
| 98 | |
| 99 | #if defined(HEDLEY_CONCAT_EX) |
| 100 | # undef HEDLEY_CONCAT_EX |
| 101 | #endif |
| 102 | #define HEDLEY_CONCAT_EX(a,b) a##b |
| 103 | |
| 104 | #if defined(HEDLEY_CONCAT) |
| 105 | # undef HEDLEY_CONCAT |
| 106 | #endif |
| 107 | #define HEDLEY_CONCAT(a,b) HEDLEY_CONCAT_EX(a,b) |
| 108 | |
| 109 | #if defined(HEDLEY_CONCAT3_EX) |
| 110 | # undef HEDLEY_CONCAT3_EX |
| 111 | #endif |
| 112 | #define HEDLEY_CONCAT3_EX(a,b,c) a##b##c |
| 113 | |
| 114 | #if defined(HEDLEY_CONCAT3) |
| 115 | # undef HEDLEY_CONCAT3 |
| 116 | #endif |
| 117 | #define HEDLEY_CONCAT3(a,b,c) HEDLEY_CONCAT3_EX(a,b,c) |
| 118 | |
| 119 | #if defined(HEDLEY_VERSION_ENCODE) |
| 120 | # undef HEDLEY_VERSION_ENCODE |
| 121 | #endif |
| 122 | #define HEDLEY_VERSION_ENCODE(major,minor,revision) (((major) * 1000000) + ((minor) * 1000) + (revision)) |
| 123 | |
| 124 | #if defined(HEDLEY_VERSION_DECODE_MAJOR) |
| 125 | # undef HEDLEY_VERSION_DECODE_MAJOR |
| 126 | #endif |
| 127 | #define HEDLEY_VERSION_DECODE_MAJOR(version) ((version) / 1000000) |
| 128 | |
| 129 | #if defined(HEDLEY_VERSION_DECODE_MINOR) |
| 130 | # undef HEDLEY_VERSION_DECODE_MINOR |
| 131 | #endif |
| 132 | #define HEDLEY_VERSION_DECODE_MINOR(version) (((version) % 1000000) / 1000) |
| 133 | |
| 134 | #if defined(HEDLEY_VERSION_DECODE_REVISION) |
| 135 | # undef HEDLEY_VERSION_DECODE_REVISION |
| 136 | #endif |
| 137 | #define HEDLEY_VERSION_DECODE_REVISION(version) ((version) % 1000) |
| 138 | |
| 139 | #if defined(HEDLEY_GNUC_VERSION) |
| 140 | # undef HEDLEY_GNUC_VERSION |
| 141 | #endif |
| 142 | #if defined(__GNUC__) && defined(__GNUC_PATCHLEVEL__) |
| 143 | # define HEDLEY_GNUC_VERSION HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__) |
| 144 | #elif defined(__GNUC__) |
| 145 | # define HEDLEY_GNUC_VERSION HEDLEY_VERSION_ENCODE(__GNUC__, __GNUC_MINOR__, 0) |
| 146 | #endif |
| 147 | |
| 148 | #if defined(HEDLEY_GNUC_VERSION_CHECK) |
| 149 | # undef HEDLEY_GNUC_VERSION_CHECK |
| 150 | #endif |
| 151 | #if defined(HEDLEY_GNUC_VERSION) |
| 152 | # define HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) (HEDLEY_GNUC_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) |
| 153 | #else |
| 154 | # define HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) (0) |
| 155 | #endif |
| 156 | |
| 157 | #if defined(HEDLEY_MSVC_VERSION) |
| 158 | # undef HEDLEY_MSVC_VERSION |
| 159 | #endif |
| 160 | #if defined(_MSC_FULL_VER) && (_MSC_FULL_VER >= 140000000) && !defined(__ICL) |
| 161 | # define HEDLEY_MSVC_VERSION HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 10000000, (_MSC_FULL_VER % 10000000) / 100000, (_MSC_FULL_VER % 100000) / 100) |
| 162 | #elif defined(_MSC_FULL_VER) && !defined(__ICL) |
| 163 | # define HEDLEY_MSVC_VERSION HEDLEY_VERSION_ENCODE(_MSC_FULL_VER / 1000000, (_MSC_FULL_VER % 1000000) / 10000, (_MSC_FULL_VER % 10000) / 10) |
| 164 | #elif defined(_MSC_VER) && !defined(__ICL) |
| 165 | # define HEDLEY_MSVC_VERSION HEDLEY_VERSION_ENCODE(_MSC_VER / 100, _MSC_VER % 100, 0) |
| 166 | #endif |
| 167 | |
| 168 | #if defined(HEDLEY_MSVC_VERSION_CHECK) |
| 169 | # undef HEDLEY_MSVC_VERSION_CHECK |
| 170 | #endif |
| 171 | #if !defined(HEDLEY_MSVC_VERSION) |
| 172 | # define HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (0) |
| 173 | #elif defined(_MSC_VER) && (_MSC_VER >= 1400) |
| 174 | # define HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_FULL_VER >= ((major * 10000000) + (minor * 100000) + (patch))) |
| 175 | #elif defined(_MSC_VER) && (_MSC_VER >= 1200) |
| 176 | # define HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_FULL_VER >= ((major * 1000000) + (minor * 10000) + (patch))) |
| 177 | #else |
| 178 | # define HEDLEY_MSVC_VERSION_CHECK(major,minor,patch) (_MSC_VER >= ((major * 100) + (minor))) |
| 179 | #endif |
| 180 | |
| 181 | #if defined(HEDLEY_INTEL_VERSION) |
| 182 | # undef HEDLEY_INTEL_VERSION |
| 183 | #endif |
| 184 | #if defined(__INTEL_COMPILER) && defined(__INTEL_COMPILER_UPDATE) && !defined(__ICL) |
| 185 | # define HEDLEY_INTEL_VERSION HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, __INTEL_COMPILER_UPDATE) |
| 186 | #elif defined(__INTEL_COMPILER) && !defined(__ICL) |
| 187 | # define HEDLEY_INTEL_VERSION HEDLEY_VERSION_ENCODE(__INTEL_COMPILER / 100, __INTEL_COMPILER % 100, 0) |
| 188 | #endif |
| 189 | |
| 190 | #if defined(HEDLEY_INTEL_VERSION_CHECK) |
| 191 | # undef HEDLEY_INTEL_VERSION_CHECK |
| 192 | #endif |
| 193 | #if defined(HEDLEY_INTEL_VERSION) |
| 194 | # define HEDLEY_INTEL_VERSION_CHECK(major,minor,patch) (HEDLEY_INTEL_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) |
| 195 | #else |
| 196 | # define HEDLEY_INTEL_VERSION_CHECK(major,minor,patch) (0) |
| 197 | #endif |
| 198 | |
| 199 | #if defined(HEDLEY_INTEL_CL_VERSION) |
| 200 | # undef HEDLEY_INTEL_CL_VERSION |
| 201 | #endif |
| 202 | #if defined(__INTEL_COMPILER) && defined(__INTEL_COMPILER_UPDATE) && defined(__ICL) |
| 203 | # define HEDLEY_INTEL_CL_VERSION HEDLEY_VERSION_ENCODE(__INTEL_COMPILER, __INTEL_COMPILER_UPDATE, 0) |
| 204 | #endif |
| 205 | |
| 206 | #if defined(HEDLEY_INTEL_CL_VERSION_CHECK) |
| 207 | # undef HEDLEY_INTEL_CL_VERSION_CHECK |
| 208 | #endif |
| 209 | #if defined(HEDLEY_INTEL_CL_VERSION) |
| 210 | # define HEDLEY_INTEL_CL_VERSION_CHECK(major,minor,patch) (HEDLEY_INTEL_CL_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) |
| 211 | #else |
| 212 | # define HEDLEY_INTEL_CL_VERSION_CHECK(major,minor,patch) (0) |
| 213 | #endif |
| 214 | |
| 215 | #if defined(HEDLEY_PGI_VERSION) |
| 216 | # undef HEDLEY_PGI_VERSION |
| 217 | #endif |
| 218 | #if defined(__PGI) && defined(__PGIC__) && defined(__PGIC_MINOR__) && defined(__PGIC_PATCHLEVEL__) |
| 219 | # define HEDLEY_PGI_VERSION HEDLEY_VERSION_ENCODE(__PGIC__, __PGIC_MINOR__, __PGIC_PATCHLEVEL__) |
| 220 | #endif |
| 221 | |
| 222 | #if defined(HEDLEY_PGI_VERSION_CHECK) |
| 223 | # undef HEDLEY_PGI_VERSION_CHECK |
| 224 | #endif |
| 225 | #if defined(HEDLEY_PGI_VERSION) |
| 226 | # define HEDLEY_PGI_VERSION_CHECK(major,minor,patch) (HEDLEY_PGI_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) |
| 227 | #else |
| 228 | # define HEDLEY_PGI_VERSION_CHECK(major,minor,patch) (0) |
| 229 | #endif |
| 230 | |
| 231 | #if defined(HEDLEY_SUNPRO_VERSION) |
| 232 | # undef HEDLEY_SUNPRO_VERSION |
| 233 | #endif |
| 234 | #if defined(__SUNPRO_C) && (__SUNPRO_C > 0x1000) |
| 235 | # define HEDLEY_SUNPRO_VERSION HEDLEY_VERSION_ENCODE((((__SUNPRO_C >> 16) & 0xf) * 10) + ((__SUNPRO_C >> 12) & 0xf), (((__SUNPRO_C >> 8) & 0xf) * 10) + ((__SUNPRO_C >> 4) & 0xf), (__SUNPRO_C & 0xf) * 10) |
| 236 | #elif defined(__SUNPRO_C) |
| 237 | # define HEDLEY_SUNPRO_VERSION HEDLEY_VERSION_ENCODE((__SUNPRO_C >> 8) & 0xf, (__SUNPRO_C >> 4) & 0xf, (__SUNPRO_C) & 0xf) |
| 238 | #elif defined(__SUNPRO_CC) && (__SUNPRO_CC > 0x1000) |
| 239 | # define HEDLEY_SUNPRO_VERSION HEDLEY_VERSION_ENCODE((((__SUNPRO_CC >> 16) & 0xf) * 10) + ((__SUNPRO_CC >> 12) & 0xf), (((__SUNPRO_CC >> 8) & 0xf) * 10) + ((__SUNPRO_CC >> 4) & 0xf), (__SUNPRO_CC & 0xf) * 10) |
| 240 | #elif defined(__SUNPRO_CC) |
| 241 | # define HEDLEY_SUNPRO_VERSION HEDLEY_VERSION_ENCODE((__SUNPRO_CC >> 8) & 0xf, (__SUNPRO_CC >> 4) & 0xf, (__SUNPRO_CC) & 0xf) |
| 242 | #endif |
| 243 | |
| 244 | #if defined(HEDLEY_SUNPRO_VERSION_CHECK) |
| 245 | # undef HEDLEY_SUNPRO_VERSION_CHECK |
| 246 | #endif |
| 247 | #if defined(HEDLEY_SUNPRO_VERSION) |
| 248 | # define HEDLEY_SUNPRO_VERSION_CHECK(major,minor,patch) (HEDLEY_SUNPRO_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) |
| 249 | #else |
| 250 | # define HEDLEY_SUNPRO_VERSION_CHECK(major,minor,patch) (0) |
| 251 | #endif |
| 252 | |
| 253 | #if defined(HEDLEY_EMSCRIPTEN_VERSION) |
| 254 | # undef HEDLEY_EMSCRIPTEN_VERSION |
| 255 | #endif |
| 256 | #if defined(__EMSCRIPTEN__) |
| 257 | # include <emscripten.h> |
| 258 | # define HEDLEY_EMSCRIPTEN_VERSION HEDLEY_VERSION_ENCODE(__EMSCRIPTEN_major__, __EMSCRIPTEN_minor__, __EMSCRIPTEN_tiny__) |
| 259 | #endif |
| 260 | |
| 261 | #if defined(HEDLEY_EMSCRIPTEN_VERSION_CHECK) |
| 262 | # undef HEDLEY_EMSCRIPTEN_VERSION_CHECK |
| 263 | #endif |
| 264 | #if defined(HEDLEY_EMSCRIPTEN_VERSION) |
| 265 | # define HEDLEY_EMSCRIPTEN_VERSION_CHECK(major,minor,patch) (HEDLEY_EMSCRIPTEN_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) |
| 266 | #else |
| 267 | # define HEDLEY_EMSCRIPTEN_VERSION_CHECK(major,minor,patch) (0) |
| 268 | #endif |
| 269 | |
| 270 | #if defined(HEDLEY_ARM_VERSION) |
| 271 | # undef HEDLEY_ARM_VERSION |
| 272 | #endif |
| 273 | #if defined(__CC_ARM) && defined(__ARMCOMPILER_VERSION) |
| 274 | # define HEDLEY_ARM_VERSION HEDLEY_VERSION_ENCODE(__ARMCOMPILER_VERSION / 1000000, (__ARMCOMPILER_VERSION % 1000000) / 10000, (__ARMCOMPILER_VERSION % 10000) / 100) |
| 275 | #elif defined(__CC_ARM) && defined(__ARMCC_VERSION) |
| 276 | # define HEDLEY_ARM_VERSION HEDLEY_VERSION_ENCODE(__ARMCC_VERSION / 1000000, (__ARMCC_VERSION % 1000000) / 10000, (__ARMCC_VERSION % 10000) / 100) |
| 277 | #endif |
| 278 | |
| 279 | #if defined(HEDLEY_ARM_VERSION_CHECK) |
| 280 | # undef HEDLEY_ARM_VERSION_CHECK |
| 281 | #endif |
| 282 | #if defined(HEDLEY_ARM_VERSION) |
| 283 | # define HEDLEY_ARM_VERSION_CHECK(major,minor,patch) (HEDLEY_ARM_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) |
| 284 | #else |
| 285 | # define HEDLEY_ARM_VERSION_CHECK(major,minor,patch) (0) |
| 286 | #endif |
| 287 | |
| 288 | #if defined(HEDLEY_IBM_VERSION) |
| 289 | # undef HEDLEY_IBM_VERSION |
| 290 | #endif |
| 291 | #if defined(__ibmxl__) |
| 292 | # define HEDLEY_IBM_VERSION HEDLEY_VERSION_ENCODE(__ibmxl_version__, __ibmxl_release__, __ibmxl_modification__) |
| 293 | #elif defined(__xlC__) && defined(__xlC_ver__) |
| 294 | # define HEDLEY_IBM_VERSION HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, (__xlC_ver__ >> 8) & 0xff) |
| 295 | #elif defined(__xlC__) |
| 296 | # define HEDLEY_IBM_VERSION HEDLEY_VERSION_ENCODE(__xlC__ >> 8, __xlC__ & 0xff, 0) |
| 297 | #endif |
| 298 | |
| 299 | #if defined(HEDLEY_IBM_VERSION_CHECK) |
| 300 | # undef HEDLEY_IBM_VERSION_CHECK |
| 301 | #endif |
| 302 | #if defined(HEDLEY_IBM_VERSION) |
| 303 | # define HEDLEY_IBM_VERSION_CHECK(major,minor,patch) (HEDLEY_IBM_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) |
| 304 | #else |
| 305 | # define HEDLEY_IBM_VERSION_CHECK(major,minor,patch) (0) |
| 306 | #endif |
| 307 | |
| 308 | #if defined(HEDLEY_TI_VERSION) |
| 309 | # undef HEDLEY_TI_VERSION |
| 310 | #endif |
| 311 | #if \ |
| 312 | defined(__TI_COMPILER_VERSION__) && \ |
| 313 | ( \ |
| 314 | defined(__TMS470__) || defined(__TI_ARM__) || \ |
| 315 | defined(__MSP430__) || \ |
| 316 | defined(__TMS320C2000__) \ |
| 317 | ) |
| 318 | # if (__TI_COMPILER_VERSION__ >= 16000000) |
| 319 | # define HEDLEY_TI_VERSION HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) |
| 320 | # endif |
| 321 | #endif |
| 322 | |
| 323 | #if defined(HEDLEY_TI_VERSION_CHECK) |
| 324 | # undef HEDLEY_TI_VERSION_CHECK |
| 325 | #endif |
| 326 | #if defined(HEDLEY_TI_VERSION) |
| 327 | # define HEDLEY_TI_VERSION_CHECK(major,minor,patch) (HEDLEY_TI_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) |
| 328 | #else |
| 329 | # define HEDLEY_TI_VERSION_CHECK(major,minor,patch) (0) |
| 330 | #endif |
| 331 | |
| 332 | #if defined(HEDLEY_TI_CL2000_VERSION) |
| 333 | # undef HEDLEY_TI_CL2000_VERSION |
| 334 | #endif |
| 335 | #if defined(__TI_COMPILER_VERSION__) && defined(__TMS320C2000__) |
| 336 | # define HEDLEY_TI_CL2000_VERSION HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) |
| 337 | #endif |
| 338 | |
| 339 | #if defined(HEDLEY_TI_CL2000_VERSION_CHECK) |
| 340 | # undef HEDLEY_TI_CL2000_VERSION_CHECK |
| 341 | #endif |
| 342 | #if defined(HEDLEY_TI_CL2000_VERSION) |
| 343 | # define HEDLEY_TI_CL2000_VERSION_CHECK(major,minor,patch) (HEDLEY_TI_CL2000_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) |
| 344 | #else |
| 345 | # define HEDLEY_TI_CL2000_VERSION_CHECK(major,minor,patch) (0) |
| 346 | #endif |
| 347 | |
| 348 | #if defined(HEDLEY_TI_CL430_VERSION) |
| 349 | # undef HEDLEY_TI_CL430_VERSION |
| 350 | #endif |
| 351 | #if defined(__TI_COMPILER_VERSION__) && defined(__MSP430__) |
| 352 | # define HEDLEY_TI_CL430_VERSION HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) |
| 353 | #endif |
| 354 | |
| 355 | #if defined(HEDLEY_TI_CL430_VERSION_CHECK) |
| 356 | # undef HEDLEY_TI_CL430_VERSION_CHECK |
| 357 | #endif |
| 358 | #if defined(HEDLEY_TI_CL430_VERSION) |
| 359 | # define HEDLEY_TI_CL430_VERSION_CHECK(major,minor,patch) (HEDLEY_TI_CL430_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) |
| 360 | #else |
| 361 | # define HEDLEY_TI_CL430_VERSION_CHECK(major,minor,patch) (0) |
| 362 | #endif |
| 363 | |
| 364 | #if defined(HEDLEY_TI_ARMCL_VERSION) |
| 365 | # undef HEDLEY_TI_ARMCL_VERSION |
| 366 | #endif |
| 367 | #if defined(__TI_COMPILER_VERSION__) && (defined(__TMS470__) || defined(__TI_ARM__)) |
| 368 | # define HEDLEY_TI_ARMCL_VERSION HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) |
| 369 | #endif |
| 370 | |
| 371 | #if defined(HEDLEY_TI_ARMCL_VERSION_CHECK) |
| 372 | # undef HEDLEY_TI_ARMCL_VERSION_CHECK |
| 373 | #endif |
| 374 | #if defined(HEDLEY_TI_ARMCL_VERSION) |
| 375 | # define HEDLEY_TI_ARMCL_VERSION_CHECK(major,minor,patch) (HEDLEY_TI_ARMCL_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) |
| 376 | #else |
| 377 | # define HEDLEY_TI_ARMCL_VERSION_CHECK(major,minor,patch) (0) |
| 378 | #endif |
| 379 | |
| 380 | #if defined(HEDLEY_TI_CL6X_VERSION) |
| 381 | # undef HEDLEY_TI_CL6X_VERSION |
| 382 | #endif |
| 383 | #if defined(__TI_COMPILER_VERSION__) && defined(__TMS320C6X__) |
| 384 | # define HEDLEY_TI_CL6X_VERSION HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) |
| 385 | #endif |
| 386 | |
| 387 | #if defined(HEDLEY_TI_CL6X_VERSION_CHECK) |
| 388 | # undef HEDLEY_TI_CL6X_VERSION_CHECK |
| 389 | #endif |
| 390 | #if defined(HEDLEY_TI_CL6X_VERSION) |
| 391 | # define HEDLEY_TI_CL6X_VERSION_CHECK(major,minor,patch) (HEDLEY_TI_CL6X_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) |
| 392 | #else |
| 393 | # define HEDLEY_TI_CL6X_VERSION_CHECK(major,minor,patch) (0) |
| 394 | #endif |
| 395 | |
| 396 | #if defined(HEDLEY_TI_CL7X_VERSION) |
| 397 | # undef HEDLEY_TI_CL7X_VERSION |
| 398 | #endif |
| 399 | #if defined(__TI_COMPILER_VERSION__) && defined(__C7000__) |
| 400 | # define HEDLEY_TI_CL7X_VERSION HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) |
| 401 | #endif |
| 402 | |
| 403 | #if defined(HEDLEY_TI_CL7X_VERSION_CHECK) |
| 404 | # undef HEDLEY_TI_CL7X_VERSION_CHECK |
| 405 | #endif |
| 406 | #if defined(HEDLEY_TI_CL7X_VERSION) |
| 407 | # define HEDLEY_TI_CL7X_VERSION_CHECK(major,minor,patch) (HEDLEY_TI_CL7X_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) |
| 408 | #else |
| 409 | # define HEDLEY_TI_CL7X_VERSION_CHECK(major,minor,patch) (0) |
| 410 | #endif |
| 411 | |
| 412 | #if defined(HEDLEY_TI_CLPRU_VERSION) |
| 413 | # undef HEDLEY_TI_CLPRU_VERSION |
| 414 | #endif |
| 415 | #if defined(__TI_COMPILER_VERSION__) && defined(__PRU__) |
| 416 | # define HEDLEY_TI_CLPRU_VERSION HEDLEY_VERSION_ENCODE(__TI_COMPILER_VERSION__ / 1000000, (__TI_COMPILER_VERSION__ % 1000000) / 1000, (__TI_COMPILER_VERSION__ % 1000)) |
| 417 | #endif |
| 418 | |
| 419 | #if defined(HEDLEY_TI_CLPRU_VERSION_CHECK) |
| 420 | # undef HEDLEY_TI_CLPRU_VERSION_CHECK |
| 421 | #endif |
| 422 | #if defined(HEDLEY_TI_CLPRU_VERSION) |
| 423 | # define HEDLEY_TI_CLPRU_VERSION_CHECK(major,minor,patch) (HEDLEY_TI_CLPRU_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) |
| 424 | #else |
| 425 | # define HEDLEY_TI_CLPRU_VERSION_CHECK(major,minor,patch) (0) |
| 426 | #endif |
| 427 | |
| 428 | #if defined(HEDLEY_CRAY_VERSION) |
| 429 | # undef HEDLEY_CRAY_VERSION |
| 430 | #endif |
| 431 | #if defined(_CRAYC) |
| 432 | # if defined(_RELEASE_PATCHLEVEL) |
| 433 | # define HEDLEY_CRAY_VERSION HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, _RELEASE_PATCHLEVEL) |
| 434 | # else |
| 435 | # define HEDLEY_CRAY_VERSION HEDLEY_VERSION_ENCODE(_RELEASE_MAJOR, _RELEASE_MINOR, 0) |
| 436 | # endif |
| 437 | #endif |
| 438 | |
| 439 | #if defined(HEDLEY_CRAY_VERSION_CHECK) |
| 440 | # undef HEDLEY_CRAY_VERSION_CHECK |
| 441 | #endif |
| 442 | #if defined(HEDLEY_CRAY_VERSION) |
| 443 | # define HEDLEY_CRAY_VERSION_CHECK(major,minor,patch) (HEDLEY_CRAY_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) |
| 444 | #else |
| 445 | # define HEDLEY_CRAY_VERSION_CHECK(major,minor,patch) (0) |
| 446 | #endif |
| 447 | |
| 448 | #if defined(HEDLEY_IAR_VERSION) |
| 449 | # undef HEDLEY_IAR_VERSION |
| 450 | #endif |
| 451 | #if defined(__IAR_SYSTEMS_ICC__) |
| 452 | # if __VER__ > 1000 |
| 453 | # define HEDLEY_IAR_VERSION HEDLEY_VERSION_ENCODE((__VER__ / 1000000), ((__VER__ / 1000) % 1000), (__VER__ % 1000)) |
| 454 | # else |
| 455 | # define HEDLEY_IAR_VERSION HEDLEY_VERSION_ENCODE(__VER__ / 100, __VER__ % 100, 0) |
| 456 | # endif |
| 457 | #endif |
| 458 | |
| 459 | #if defined(HEDLEY_IAR_VERSION_CHECK) |
| 460 | # undef HEDLEY_IAR_VERSION_CHECK |
| 461 | #endif |
| 462 | #if defined(HEDLEY_IAR_VERSION) |
| 463 | # define HEDLEY_IAR_VERSION_CHECK(major,minor,patch) (HEDLEY_IAR_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) |
| 464 | #else |
| 465 | # define HEDLEY_IAR_VERSION_CHECK(major,minor,patch) (0) |
| 466 | #endif |
| 467 | |
| 468 | #if defined(HEDLEY_TINYC_VERSION) |
| 469 | # undef HEDLEY_TINYC_VERSION |
| 470 | #endif |
| 471 | #if defined(__TINYC__) |
| 472 | # define HEDLEY_TINYC_VERSION HEDLEY_VERSION_ENCODE(__TINYC__ / 1000, (__TINYC__ / 100) % 10, __TINYC__ % 100) |
| 473 | #endif |
| 474 | |
| 475 | #if defined(HEDLEY_TINYC_VERSION_CHECK) |
| 476 | # undef HEDLEY_TINYC_VERSION_CHECK |
| 477 | #endif |
| 478 | #if defined(HEDLEY_TINYC_VERSION) |
| 479 | # define HEDLEY_TINYC_VERSION_CHECK(major,minor,patch) (HEDLEY_TINYC_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) |
| 480 | #else |
| 481 | # define HEDLEY_TINYC_VERSION_CHECK(major,minor,patch) (0) |
| 482 | #endif |
| 483 | |
| 484 | #if defined(HEDLEY_DMC_VERSION) |
| 485 | # undef HEDLEY_DMC_VERSION |
| 486 | #endif |
| 487 | #if defined(__DMC__) |
| 488 | # define HEDLEY_DMC_VERSION HEDLEY_VERSION_ENCODE(__DMC__ >> 8, (__DMC__ >> 4) & 0xf, __DMC__ & 0xf) |
| 489 | #endif |
| 490 | |
| 491 | #if defined(HEDLEY_DMC_VERSION_CHECK) |
| 492 | # undef HEDLEY_DMC_VERSION_CHECK |
| 493 | #endif |
| 494 | #if defined(HEDLEY_DMC_VERSION) |
| 495 | # define HEDLEY_DMC_VERSION_CHECK(major,minor,patch) (HEDLEY_DMC_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) |
| 496 | #else |
| 497 | # define HEDLEY_DMC_VERSION_CHECK(major,minor,patch) (0) |
| 498 | #endif |
| 499 | |
| 500 | #if defined(HEDLEY_COMPCERT_VERSION) |
| 501 | # undef HEDLEY_COMPCERT_VERSION |
| 502 | #endif |
| 503 | #if defined(__COMPCERT_VERSION__) |
| 504 | # define HEDLEY_COMPCERT_VERSION HEDLEY_VERSION_ENCODE(__COMPCERT_VERSION__ / 10000, (__COMPCERT_VERSION__ / 100) % 100, __COMPCERT_VERSION__ % 100) |
| 505 | #endif |
| 506 | |
| 507 | #if defined(HEDLEY_COMPCERT_VERSION_CHECK) |
| 508 | # undef HEDLEY_COMPCERT_VERSION_CHECK |
| 509 | #endif |
| 510 | #if defined(HEDLEY_COMPCERT_VERSION) |
| 511 | # define HEDLEY_COMPCERT_VERSION_CHECK(major,minor,patch) (HEDLEY_COMPCERT_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) |
| 512 | #else |
| 513 | # define HEDLEY_COMPCERT_VERSION_CHECK(major,minor,patch) (0) |
| 514 | #endif |
| 515 | |
| 516 | #if defined(HEDLEY_PELLES_VERSION) |
| 517 | # undef HEDLEY_PELLES_VERSION |
| 518 | #endif |
| 519 | #if defined(__POCC__) |
| 520 | # define HEDLEY_PELLES_VERSION HEDLEY_VERSION_ENCODE(__POCC__ / 100, __POCC__ % 100, 0) |
| 521 | #endif |
| 522 | |
| 523 | #if defined(HEDLEY_PELLES_VERSION_CHECK) |
| 524 | # undef HEDLEY_PELLES_VERSION_CHECK |
| 525 | #endif |
| 526 | #if defined(HEDLEY_PELLES_VERSION) |
| 527 | # define HEDLEY_PELLES_VERSION_CHECK(major,minor,patch) (HEDLEY_PELLES_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) |
| 528 | #else |
| 529 | # define HEDLEY_PELLES_VERSION_CHECK(major,minor,patch) (0) |
| 530 | #endif |
| 531 | |
| 532 | #if defined(HEDLEY_MCST_LCC_VERSION) |
| 533 | # undef HEDLEY_MCST_LCC_VERSION |
| 534 | #endif |
| 535 | #if defined(__LCC__) && defined(__LCC_MINOR__) |
| 536 | # define HEDLEY_MCST_LCC_VERSION HEDLEY_VERSION_ENCODE(__LCC__ / 100, __LCC__ % 100, __LCC_MINOR__) |
| 537 | #endif |
| 538 | |
| 539 | #if defined(HEDLEY_MCST_LCC_VERSION_CHECK) |
| 540 | # undef HEDLEY_MCST_LCC_VERSION_CHECK |
| 541 | #endif |
| 542 | #if defined(HEDLEY_MCST_LCC_VERSION) |
| 543 | # define HEDLEY_MCST_LCC_VERSION_CHECK(major,minor,patch) (HEDLEY_MCST_LCC_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) |
| 544 | #else |
| 545 | # define HEDLEY_MCST_LCC_VERSION_CHECK(major,minor,patch) (0) |
| 546 | #endif |
| 547 | |
| 548 | #if defined(HEDLEY_GCC_VERSION) |
| 549 | # undef HEDLEY_GCC_VERSION |
| 550 | #endif |
| 551 | #if \ |
| 552 | defined(HEDLEY_GNUC_VERSION) && \ |
| 553 | !defined(__clang__) && \ |
| 554 | !defined(HEDLEY_INTEL_VERSION) && \ |
| 555 | !defined(HEDLEY_PGI_VERSION) && \ |
| 556 | !defined(HEDLEY_ARM_VERSION) && \ |
| 557 | !defined(HEDLEY_CRAY_VERSION) && \ |
| 558 | !defined(HEDLEY_TI_VERSION) && \ |
| 559 | !defined(HEDLEY_TI_ARMCL_VERSION) && \ |
| 560 | !defined(HEDLEY_TI_CL430_VERSION) && \ |
| 561 | !defined(HEDLEY_TI_CL2000_VERSION) && \ |
| 562 | !defined(HEDLEY_TI_CL6X_VERSION) && \ |
| 563 | !defined(HEDLEY_TI_CL7X_VERSION) && \ |
| 564 | !defined(HEDLEY_TI_CLPRU_VERSION) && \ |
| 565 | !defined(__COMPCERT__) && \ |
| 566 | !defined(HEDLEY_MCST_LCC_VERSION) |
| 567 | # define HEDLEY_GCC_VERSION HEDLEY_GNUC_VERSION |
| 568 | #endif |
| 569 | |
| 570 | #if defined(HEDLEY_GCC_VERSION_CHECK) |
| 571 | # undef HEDLEY_GCC_VERSION_CHECK |
| 572 | #endif |
| 573 | #if defined(HEDLEY_GCC_VERSION) |
| 574 | # define HEDLEY_GCC_VERSION_CHECK(major,minor,patch) (HEDLEY_GCC_VERSION >= HEDLEY_VERSION_ENCODE(major, minor, patch)) |
| 575 | #else |
| 576 | # define HEDLEY_GCC_VERSION_CHECK(major,minor,patch) (0) |
| 577 | #endif |
| 578 | |
| 579 | #if defined(HEDLEY_HAS_ATTRIBUTE) |
| 580 | # undef HEDLEY_HAS_ATTRIBUTE |
| 581 | #endif |
| 582 | #if \ |
| 583 | defined(__has_attribute) && \ |
| 584 | ( \ |
| 585 | (!defined(HEDLEY_IAR_VERSION) || HEDLEY_IAR_VERSION_CHECK(8,5,9)) \ |
| 586 | ) |
| 587 | # define HEDLEY_HAS_ATTRIBUTE(attribute) __has_attribute(attribute) |
| 588 | #else |
| 589 | # define HEDLEY_HAS_ATTRIBUTE(attribute) (0) |
| 590 | #endif |
| 591 | |
| 592 | #if defined(HEDLEY_GNUC_HAS_ATTRIBUTE) |
| 593 | # undef HEDLEY_GNUC_HAS_ATTRIBUTE |
| 594 | #endif |
| 595 | #if defined(__has_attribute) |
| 596 | # define HEDLEY_GNUC_HAS_ATTRIBUTE(attribute,major,minor,patch) HEDLEY_HAS_ATTRIBUTE(attribute) |
| 597 | #else |
| 598 | # define HEDLEY_GNUC_HAS_ATTRIBUTE(attribute,major,minor,patch) HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) |
| 599 | #endif |
| 600 | |
| 601 | #if defined(HEDLEY_GCC_HAS_ATTRIBUTE) |
| 602 | # undef HEDLEY_GCC_HAS_ATTRIBUTE |
| 603 | #endif |
| 604 | #if defined(__has_attribute) |
| 605 | # define HEDLEY_GCC_HAS_ATTRIBUTE(attribute,major,minor,patch) HEDLEY_HAS_ATTRIBUTE(attribute) |
| 606 | #else |
| 607 | # define HEDLEY_GCC_HAS_ATTRIBUTE(attribute,major,minor,patch) HEDLEY_GCC_VERSION_CHECK(major,minor,patch) |
| 608 | #endif |
| 609 | |
| 610 | #if defined(HEDLEY_HAS_CPP_ATTRIBUTE) |
| 611 | # undef HEDLEY_HAS_CPP_ATTRIBUTE |
| 612 | #endif |
| 613 | #if \ |
| 614 | defined(__has_cpp_attribute) && \ |
| 615 | defined(__cplusplus) && \ |
| 616 | (!defined(HEDLEY_SUNPRO_VERSION) || HEDLEY_SUNPRO_VERSION_CHECK(5,15,0)) |
| 617 | # define HEDLEY_HAS_CPP_ATTRIBUTE(attribute) __has_cpp_attribute(attribute) |
| 618 | #else |
| 619 | # define HEDLEY_HAS_CPP_ATTRIBUTE(attribute) (0) |
| 620 | #endif |
| 621 | |
| 622 | #if defined(HEDLEY_HAS_CPP_ATTRIBUTE_NS) |
| 623 | # undef HEDLEY_HAS_CPP_ATTRIBUTE_NS |
| 624 | #endif |
| 625 | #if !defined(__cplusplus) || !defined(__has_cpp_attribute) |
| 626 | # define HEDLEY_HAS_CPP_ATTRIBUTE_NS(ns,attribute) (0) |
| 627 | #elif \ |
| 628 | !defined(HEDLEY_PGI_VERSION) && \ |
| 629 | !defined(HEDLEY_IAR_VERSION) && \ |
| 630 | (!defined(HEDLEY_SUNPRO_VERSION) || HEDLEY_SUNPRO_VERSION_CHECK(5,15,0)) && \ |
| 631 | (!defined(HEDLEY_MSVC_VERSION) || HEDLEY_MSVC_VERSION_CHECK(19,20,0)) |
| 632 | # define HEDLEY_HAS_CPP_ATTRIBUTE_NS(ns,attribute) HEDLEY_HAS_CPP_ATTRIBUTE(ns::attribute) |
| 633 | #else |
| 634 | # define HEDLEY_HAS_CPP_ATTRIBUTE_NS(ns,attribute) (0) |
| 635 | #endif |
| 636 | |
| 637 | #if defined(HEDLEY_GNUC_HAS_CPP_ATTRIBUTE) |
| 638 | # undef HEDLEY_GNUC_HAS_CPP_ATTRIBUTE |
| 639 | #endif |
| 640 | #if defined(__has_cpp_attribute) && defined(__cplusplus) |
| 641 | # define HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) __has_cpp_attribute(attribute) |
| 642 | #else |
| 643 | # define HEDLEY_GNUC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) |
| 644 | #endif |
| 645 | |
| 646 | #if defined(HEDLEY_GCC_HAS_CPP_ATTRIBUTE) |
| 647 | # undef HEDLEY_GCC_HAS_CPP_ATTRIBUTE |
| 648 | #endif |
| 649 | #if defined(__has_cpp_attribute) && defined(__cplusplus) |
| 650 | # define HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) __has_cpp_attribute(attribute) |
| 651 | #else |
| 652 | # define HEDLEY_GCC_HAS_CPP_ATTRIBUTE(attribute,major,minor,patch) HEDLEY_GCC_VERSION_CHECK(major,minor,patch) |
| 653 | #endif |
| 654 | |
| 655 | #if defined(HEDLEY_HAS_BUILTIN) |
| 656 | # undef HEDLEY_HAS_BUILTIN |
| 657 | #endif |
| 658 | #if defined(__has_builtin) |
| 659 | # define HEDLEY_HAS_BUILTIN(builtin) __has_builtin(builtin) |
| 660 | #else |
| 661 | # define HEDLEY_HAS_BUILTIN(builtin) (0) |
| 662 | #endif |
| 663 | |
| 664 | #if defined(HEDLEY_GNUC_HAS_BUILTIN) |
| 665 | # undef HEDLEY_GNUC_HAS_BUILTIN |
| 666 | #endif |
| 667 | #if defined(__has_builtin) |
| 668 | # define HEDLEY_GNUC_HAS_BUILTIN(builtin,major,minor,patch) __has_builtin(builtin) |
| 669 | #else |
| 670 | # define HEDLEY_GNUC_HAS_BUILTIN(builtin,major,minor,patch) HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) |
| 671 | #endif |
| 672 | |
| 673 | #if defined(HEDLEY_GCC_HAS_BUILTIN) |
| 674 | # undef HEDLEY_GCC_HAS_BUILTIN |
| 675 | #endif |
| 676 | #if defined(__has_builtin) |
| 677 | # define HEDLEY_GCC_HAS_BUILTIN(builtin,major,minor,patch) __has_builtin(builtin) |
| 678 | #else |
| 679 | # define HEDLEY_GCC_HAS_BUILTIN(builtin,major,minor,patch) HEDLEY_GCC_VERSION_CHECK(major,minor,patch) |
| 680 | #endif |
| 681 | |
| 682 | #if defined(HEDLEY_HAS_FEATURE) |
| 683 | # undef HEDLEY_HAS_FEATURE |
| 684 | #endif |
| 685 | #if defined(__has_feature) |
| 686 | # define HEDLEY_HAS_FEATURE(feature) __has_feature(feature) |
| 687 | #else |
| 688 | # define HEDLEY_HAS_FEATURE(feature) (0) |
| 689 | #endif |
| 690 | |
| 691 | #if defined(HEDLEY_GNUC_HAS_FEATURE) |
| 692 | # undef HEDLEY_GNUC_HAS_FEATURE |
| 693 | #endif |
| 694 | #if defined(__has_feature) |
| 695 | # define HEDLEY_GNUC_HAS_FEATURE(feature,major,minor,patch) __has_feature(feature) |
| 696 | #else |
| 697 | # define HEDLEY_GNUC_HAS_FEATURE(feature,major,minor,patch) HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) |
| 698 | #endif |
| 699 | |
| 700 | #if defined(HEDLEY_GCC_HAS_FEATURE) |
| 701 | # undef HEDLEY_GCC_HAS_FEATURE |
| 702 | #endif |
| 703 | #if defined(__has_feature) |
| 704 | # define HEDLEY_GCC_HAS_FEATURE(feature,major,minor,patch) __has_feature(feature) |
| 705 | #else |
| 706 | # define HEDLEY_GCC_HAS_FEATURE(feature,major,minor,patch) HEDLEY_GCC_VERSION_CHECK(major,minor,patch) |
| 707 | #endif |
| 708 | |
| 709 | #if defined(HEDLEY_HAS_EXTENSION) |
| 710 | # undef HEDLEY_HAS_EXTENSION |
| 711 | #endif |
| 712 | #if defined(__has_extension) |
| 713 | # define HEDLEY_HAS_EXTENSION(extension) __has_extension(extension) |
| 714 | #else |
| 715 | # define HEDLEY_HAS_EXTENSION(extension) (0) |
| 716 | #endif |
| 717 | |
| 718 | #if defined(HEDLEY_GNUC_HAS_EXTENSION) |
| 719 | # undef HEDLEY_GNUC_HAS_EXTENSION |
| 720 | #endif |
| 721 | #if defined(__has_extension) |
| 722 | # define HEDLEY_GNUC_HAS_EXTENSION(extension,major,minor,patch) __has_extension(extension) |
| 723 | #else |
| 724 | # define HEDLEY_GNUC_HAS_EXTENSION(extension,major,minor,patch) HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) |
| 725 | #endif |
| 726 | |
| 727 | #if defined(HEDLEY_GCC_HAS_EXTENSION) |
| 728 | # undef HEDLEY_GCC_HAS_EXTENSION |
| 729 | #endif |
| 730 | #if defined(__has_extension) |
| 731 | # define HEDLEY_GCC_HAS_EXTENSION(extension,major,minor,patch) __has_extension(extension) |
| 732 | #else |
| 733 | # define HEDLEY_GCC_HAS_EXTENSION(extension,major,minor,patch) HEDLEY_GCC_VERSION_CHECK(major,minor,patch) |
| 734 | #endif |
| 735 | |
| 736 | #if defined(HEDLEY_HAS_DECLSPEC_ATTRIBUTE) |
| 737 | # undef HEDLEY_HAS_DECLSPEC_ATTRIBUTE |
| 738 | #endif |
| 739 | #if defined(__has_declspec_attribute) |
| 740 | # define HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) __has_declspec_attribute(attribute) |
| 741 | #else |
| 742 | # define HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) (0) |
| 743 | #endif |
| 744 | |
| 745 | #if defined(HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE) |
| 746 | # undef HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE |
| 747 | #endif |
| 748 | #if defined(__has_declspec_attribute) |
| 749 | # define HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) __has_declspec_attribute(attribute) |
| 750 | #else |
| 751 | # define HEDLEY_GNUC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) |
| 752 | #endif |
| 753 | |
| 754 | #if defined(HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE) |
| 755 | # undef HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE |
| 756 | #endif |
| 757 | #if defined(__has_declspec_attribute) |
| 758 | # define HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) __has_declspec_attribute(attribute) |
| 759 | #else |
| 760 | # define HEDLEY_GCC_HAS_DECLSPEC_ATTRIBUTE(attribute,major,minor,patch) HEDLEY_GCC_VERSION_CHECK(major,minor,patch) |
| 761 | #endif |
| 762 | |
| 763 | #if defined(HEDLEY_HAS_WARNING) |
| 764 | # undef HEDLEY_HAS_WARNING |
| 765 | #endif |
| 766 | #if defined(__has_warning) |
| 767 | # define HEDLEY_HAS_WARNING(warning) __has_warning(warning) |
| 768 | #else |
| 769 | # define HEDLEY_HAS_WARNING(warning) (0) |
| 770 | #endif |
| 771 | |
| 772 | #if defined(HEDLEY_GNUC_HAS_WARNING) |
| 773 | # undef HEDLEY_GNUC_HAS_WARNING |
| 774 | #endif |
| 775 | #if defined(__has_warning) |
| 776 | # define HEDLEY_GNUC_HAS_WARNING(warning,major,minor,patch) __has_warning(warning) |
| 777 | #else |
| 778 | # define HEDLEY_GNUC_HAS_WARNING(warning,major,minor,patch) HEDLEY_GNUC_VERSION_CHECK(major,minor,patch) |
| 779 | #endif |
| 780 | |
| 781 | #if defined(HEDLEY_GCC_HAS_WARNING) |
| 782 | # undef HEDLEY_GCC_HAS_WARNING |
| 783 | #endif |
| 784 | #if defined(__has_warning) |
| 785 | # define HEDLEY_GCC_HAS_WARNING(warning,major,minor,patch) __has_warning(warning) |
| 786 | #else |
| 787 | # define HEDLEY_GCC_HAS_WARNING(warning,major,minor,patch) HEDLEY_GCC_VERSION_CHECK(major,minor,patch) |
| 788 | #endif |
| 789 | |
| 790 | #if \ |
| 791 | (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || \ |
| 792 | defined(__clang__) || \ |
| 793 | HEDLEY_GCC_VERSION_CHECK(3,0,0) || \ |
| 794 | HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ |
| 795 | HEDLEY_IAR_VERSION_CHECK(8,0,0) || \ |
| 796 | HEDLEY_PGI_VERSION_CHECK(18,4,0) || \ |
| 797 | HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ |
| 798 | HEDLEY_TI_VERSION_CHECK(15,12,0) || \ |
| 799 | HEDLEY_TI_ARMCL_VERSION_CHECK(4,7,0) || \ |
| 800 | HEDLEY_TI_CL430_VERSION_CHECK(2,0,1) || \ |
| 801 | HEDLEY_TI_CL2000_VERSION_CHECK(6,1,0) || \ |
| 802 | HEDLEY_TI_CL6X_VERSION_CHECK(7,0,0) || \ |
| 803 | HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ |
| 804 | HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ |
| 805 | HEDLEY_CRAY_VERSION_CHECK(5,0,0) || \ |
| 806 | HEDLEY_TINYC_VERSION_CHECK(0,9,17) || \ |
| 807 | HEDLEY_SUNPRO_VERSION_CHECK(8,0,0) || \ |
| 808 | (HEDLEY_IBM_VERSION_CHECK(10,1,0) && defined(__C99_PRAGMA_OPERATOR)) |
| 809 | # define HEDLEY_PRAGMA(value) _Pragma(#value) |
| 810 | #elif HEDLEY_MSVC_VERSION_CHECK(15,0,0) |
| 811 | # define HEDLEY_PRAGMA(value) __pragma(value) |
| 812 | #else |
| 813 | # define HEDLEY_PRAGMA(value) |
| 814 | #endif |
| 815 | |
| 816 | #if defined(HEDLEY_DIAGNOSTIC_PUSH) |
| 817 | # undef HEDLEY_DIAGNOSTIC_PUSH |
| 818 | #endif |
| 819 | #if defined(HEDLEY_DIAGNOSTIC_POP) |
| 820 | # undef HEDLEY_DIAGNOSTIC_POP |
| 821 | #endif |
| 822 | #if defined(__clang__) |
| 823 | # define HEDLEY_DIAGNOSTIC_PUSH _Pragma("clang diagnostic push") |
| 824 | # define HEDLEY_DIAGNOSTIC_POP _Pragma("clang diagnostic pop") |
| 825 | #elif HEDLEY_INTEL_VERSION_CHECK(13,0,0) |
| 826 | # define HEDLEY_DIAGNOSTIC_PUSH _Pragma("warning(push)") |
| 827 | # define HEDLEY_DIAGNOSTIC_POP _Pragma("warning(pop)") |
| 828 | #elif HEDLEY_GCC_VERSION_CHECK(4,6,0) |
| 829 | # define HEDLEY_DIAGNOSTIC_PUSH _Pragma("GCC diagnostic push") |
| 830 | # define HEDLEY_DIAGNOSTIC_POP _Pragma("GCC diagnostic pop") |
| 831 | #elif \ |
| 832 | HEDLEY_MSVC_VERSION_CHECK(15,0,0) || \ |
| 833 | HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) |
| 834 | # define HEDLEY_DIAGNOSTIC_PUSH __pragma(warning(push)) |
| 835 | # define HEDLEY_DIAGNOSTIC_POP __pragma(warning(pop)) |
| 836 | #elif HEDLEY_ARM_VERSION_CHECK(5,6,0) |
| 837 | # define HEDLEY_DIAGNOSTIC_PUSH _Pragma("push") |
| 838 | # define HEDLEY_DIAGNOSTIC_POP _Pragma("pop") |
| 839 | #elif \ |
| 840 | HEDLEY_TI_VERSION_CHECK(15,12,0) || \ |
| 841 | HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ |
| 842 | HEDLEY_TI_CL430_VERSION_CHECK(4,4,0) || \ |
| 843 | HEDLEY_TI_CL6X_VERSION_CHECK(8,1,0) || \ |
| 844 | HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ |
| 845 | HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) |
| 846 | # define HEDLEY_DIAGNOSTIC_PUSH _Pragma("diag_push") |
| 847 | # define HEDLEY_DIAGNOSTIC_POP _Pragma("diag_pop") |
| 848 | #elif HEDLEY_PELLES_VERSION_CHECK(2,90,0) |
| 849 | # define HEDLEY_DIAGNOSTIC_PUSH _Pragma("warning(push)") |
| 850 | # define HEDLEY_DIAGNOSTIC_POP _Pragma("warning(pop)") |
| 851 | #else |
| 852 | # define HEDLEY_DIAGNOSTIC_PUSH |
| 853 | # define HEDLEY_DIAGNOSTIC_POP |
| 854 | #endif |
| 855 | |
| 856 | /* HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_ is for |
| 857 | HEDLEY INTERNAL USE ONLY. API subject to change without notice. */ |
| 858 | #if defined(HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_) |
| 859 | # undef HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_ |
| 860 | #endif |
| 861 | #if defined(__cplusplus) |
| 862 | # if HEDLEY_HAS_WARNING("-Wc++98-compat") |
| 863 | # if HEDLEY_HAS_WARNING("-Wc++17-extensions") |
| 864 | # if HEDLEY_HAS_WARNING("-Wc++1z-extensions") |
| 865 | # define HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(xpr) \ |
| 866 | HEDLEY_DIAGNOSTIC_PUSH \ |
| 867 | _Pragma("clang diagnostic ignored \"-Wc++98-compat\"") \ |
| 868 | _Pragma("clang diagnostic ignored \"-Wc++17-extensions\"") \ |
| 869 | _Pragma("clang diagnostic ignored \"-Wc++1z-extensions\"") \ |
| 870 | xpr \ |
| 871 | HEDLEY_DIAGNOSTIC_POP |
| 872 | # else |
| 873 | # define HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(xpr) \ |
| 874 | HEDLEY_DIAGNOSTIC_PUSH \ |
| 875 | _Pragma("clang diagnostic ignored \"-Wc++98-compat\"") \ |
| 876 | _Pragma("clang diagnostic ignored \"-Wc++17-extensions\"") \ |
| 877 | xpr \ |
| 878 | HEDLEY_DIAGNOSTIC_POP |
| 879 | # endif |
| 880 | # else |
| 881 | # define HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(xpr) \ |
| 882 | HEDLEY_DIAGNOSTIC_PUSH \ |
| 883 | _Pragma("clang diagnostic ignored \"-Wc++98-compat\"") \ |
| 884 | xpr \ |
| 885 | HEDLEY_DIAGNOSTIC_POP |
| 886 | # endif |
| 887 | # endif |
| 888 | #endif |
| 889 | #if !defined(HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_) |
| 890 | # define HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(x) x |
| 891 | #endif |
| 892 | |
| 893 | #if defined(HEDLEY_CONST_CAST) |
| 894 | # undef HEDLEY_CONST_CAST |
| 895 | #endif |
| 896 | #if defined(__cplusplus) |
| 897 | # define HEDLEY_CONST_CAST(T, expr) (const_cast<T>(expr)) |
| 898 | #elif \ |
| 899 | HEDLEY_HAS_WARNING("-Wcast-qual") || \ |
| 900 | HEDLEY_GCC_VERSION_CHECK(4,6,0) || \ |
| 901 | HEDLEY_INTEL_VERSION_CHECK(13,0,0) |
| 902 | # define HEDLEY_CONST_CAST(T, expr) (__extension__ ({ \ |
| 903 | HEDLEY_DIAGNOSTIC_PUSH \ |
| 904 | HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL \ |
| 905 | ((T) (expr)); \ |
| 906 | HEDLEY_DIAGNOSTIC_POP \ |
| 907 | })) |
| 908 | #else |
| 909 | # define HEDLEY_CONST_CAST(T, expr) ((T) (expr)) |
| 910 | #endif |
| 911 | |
| 912 | #if defined(HEDLEY_REINTERPRET_CAST) |
| 913 | # undef HEDLEY_REINTERPRET_CAST |
| 914 | #endif |
| 915 | #if defined(__cplusplus) |
| 916 | # define HEDLEY_REINTERPRET_CAST(T, expr) (reinterpret_cast<T>(expr)) |
| 917 | #else |
| 918 | # define HEDLEY_REINTERPRET_CAST(T, expr) ((T) (expr)) |
| 919 | #endif |
| 920 | |
| 921 | #if defined(HEDLEY_STATIC_CAST) |
| 922 | # undef HEDLEY_STATIC_CAST |
| 923 | #endif |
| 924 | #if defined(__cplusplus) |
| 925 | # define HEDLEY_STATIC_CAST(T, expr) (static_cast<T>(expr)) |
| 926 | #else |
| 927 | # define HEDLEY_STATIC_CAST(T, expr) ((T) (expr)) |
| 928 | #endif |
| 929 | |
| 930 | #if defined(HEDLEY_CPP_CAST) |
| 931 | # undef HEDLEY_CPP_CAST |
| 932 | #endif |
| 933 | #if defined(__cplusplus) |
| 934 | # if HEDLEY_HAS_WARNING("-Wold-style-cast") |
| 935 | # define HEDLEY_CPP_CAST(T, expr) \ |
| 936 | HEDLEY_DIAGNOSTIC_PUSH \ |
| 937 | _Pragma("clang diagnostic ignored \"-Wold-style-cast\"") \ |
| 938 | ((T) (expr)) \ |
| 939 | HEDLEY_DIAGNOSTIC_POP |
| 940 | # elif HEDLEY_IAR_VERSION_CHECK(8,3,0) |
| 941 | # define HEDLEY_CPP_CAST(T, expr) \ |
| 942 | HEDLEY_DIAGNOSTIC_PUSH \ |
| 943 | _Pragma("diag_suppress=Pe137") \ |
| 944 | HEDLEY_DIAGNOSTIC_POP |
| 945 | # else |
| 946 | # define HEDLEY_CPP_CAST(T, expr) ((T) (expr)) |
| 947 | # endif |
| 948 | #else |
| 949 | # define HEDLEY_CPP_CAST(T, expr) (expr) |
| 950 | #endif |
| 951 | |
| 952 | #if defined(HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED) |
| 953 | # undef HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED |
| 954 | #endif |
| 955 | #if HEDLEY_HAS_WARNING("-Wdeprecated-declarations") |
| 956 | # define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"") |
| 957 | #elif HEDLEY_INTEL_VERSION_CHECK(13,0,0) |
| 958 | # define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("warning(disable:1478 1786)") |
| 959 | #elif HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) |
| 960 | # define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED __pragma(warning(disable:1478 1786)) |
| 961 | #elif HEDLEY_PGI_VERSION_CHECK(20,7,0) |
| 962 | # define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1215,1216,1444,1445") |
| 963 | #elif HEDLEY_PGI_VERSION_CHECK(17,10,0) |
| 964 | # define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1215,1444") |
| 965 | #elif HEDLEY_GCC_VERSION_CHECK(4,3,0) |
| 966 | # define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") |
| 967 | #elif HEDLEY_MSVC_VERSION_CHECK(15,0,0) |
| 968 | # define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED __pragma(warning(disable:4996)) |
| 969 | #elif HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) |
| 970 | # define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1215,1444") |
| 971 | #elif \ |
| 972 | HEDLEY_TI_VERSION_CHECK(15,12,0) || \ |
| 973 | (HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ |
| 974 | HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ |
| 975 | (HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ |
| 976 | HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ |
| 977 | (HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ |
| 978 | HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ |
| 979 | (HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ |
| 980 | HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ |
| 981 | HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ |
| 982 | HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) |
| 983 | # define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress 1291,1718") |
| 984 | #elif HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) && !defined(__cplusplus) |
| 985 | # define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("error_messages(off,E_DEPRECATED_ATT,E_DEPRECATED_ATT_MESS)") |
| 986 | #elif HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) && defined(__cplusplus) |
| 987 | # define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("error_messages(off,symdeprecated,symdeprecated2)") |
| 988 | #elif HEDLEY_IAR_VERSION_CHECK(8,0,0) |
| 989 | # define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("diag_suppress=Pe1444,Pe1215") |
| 990 | #elif HEDLEY_PELLES_VERSION_CHECK(2,90,0) |
| 991 | # define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED _Pragma("warn(disable:2241)") |
| 992 | #else |
| 993 | # define HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED |
| 994 | #endif |
| 995 | |
| 996 | #if defined(HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS) |
| 997 | # undef HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS |
| 998 | #endif |
| 999 | #if HEDLEY_HAS_WARNING("-Wunknown-pragmas") |
| 1000 | # define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("clang diagnostic ignored \"-Wunknown-pragmas\"") |
| 1001 | #elif HEDLEY_INTEL_VERSION_CHECK(13,0,0) |
| 1002 | # define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("warning(disable:161)") |
| 1003 | #elif HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) |
| 1004 | # define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS __pragma(warning(disable:161)) |
| 1005 | #elif HEDLEY_PGI_VERSION_CHECK(17,10,0) |
| 1006 | # define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 1675") |
| 1007 | #elif HEDLEY_GCC_VERSION_CHECK(4,3,0) |
| 1008 | # define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("GCC diagnostic ignored \"-Wunknown-pragmas\"") |
| 1009 | #elif HEDLEY_MSVC_VERSION_CHECK(15,0,0) |
| 1010 | # define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS __pragma(warning(disable:4068)) |
| 1011 | #elif \ |
| 1012 | HEDLEY_TI_VERSION_CHECK(16,9,0) || \ |
| 1013 | HEDLEY_TI_CL6X_VERSION_CHECK(8,0,0) || \ |
| 1014 | HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ |
| 1015 | HEDLEY_TI_CLPRU_VERSION_CHECK(2,3,0) |
| 1016 | # define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 163") |
| 1017 | #elif HEDLEY_TI_CL6X_VERSION_CHECK(8,0,0) |
| 1018 | # define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 163") |
| 1019 | #elif HEDLEY_IAR_VERSION_CHECK(8,0,0) |
| 1020 | # define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress=Pe161") |
| 1021 | #elif HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) |
| 1022 | # define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS _Pragma("diag_suppress 161") |
| 1023 | #else |
| 1024 | # define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS |
| 1025 | #endif |
| 1026 | |
| 1027 | #if defined(HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES) |
| 1028 | # undef HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES |
| 1029 | #endif |
| 1030 | #if HEDLEY_HAS_WARNING("-Wunknown-attributes") |
| 1031 | # define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("clang diagnostic ignored \"-Wunknown-attributes\"") |
| 1032 | #elif HEDLEY_GCC_VERSION_CHECK(4,6,0) |
| 1033 | # define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") |
| 1034 | #elif HEDLEY_INTEL_VERSION_CHECK(17,0,0) |
| 1035 | # define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("warning(disable:1292)") |
| 1036 | #elif HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) |
| 1037 | # define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES __pragma(warning(disable:1292)) |
| 1038 | #elif HEDLEY_MSVC_VERSION_CHECK(19,0,0) |
| 1039 | # define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES __pragma(warning(disable:5030)) |
| 1040 | #elif HEDLEY_PGI_VERSION_CHECK(20,7,0) |
| 1041 | # define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress 1097,1098") |
| 1042 | #elif HEDLEY_PGI_VERSION_CHECK(17,10,0) |
| 1043 | # define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress 1097") |
| 1044 | #elif HEDLEY_SUNPRO_VERSION_CHECK(5,14,0) && defined(__cplusplus) |
| 1045 | # define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("error_messages(off,attrskipunsup)") |
| 1046 | #elif \ |
| 1047 | HEDLEY_TI_VERSION_CHECK(18,1,0) || \ |
| 1048 | HEDLEY_TI_CL6X_VERSION_CHECK(8,3,0) || \ |
| 1049 | HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) |
| 1050 | # define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress 1173") |
| 1051 | #elif HEDLEY_IAR_VERSION_CHECK(8,0,0) |
| 1052 | # define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress=Pe1097") |
| 1053 | #elif HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) |
| 1054 | # define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES _Pragma("diag_suppress 1097") |
| 1055 | #else |
| 1056 | # define HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_CPP_ATTRIBUTES |
| 1057 | #endif |
| 1058 | |
| 1059 | #if defined(HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL) |
| 1060 | # undef HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL |
| 1061 | #endif |
| 1062 | #if HEDLEY_HAS_WARNING("-Wcast-qual") |
| 1063 | # define HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("clang diagnostic ignored \"-Wcast-qual\"") |
| 1064 | #elif HEDLEY_INTEL_VERSION_CHECK(13,0,0) |
| 1065 | # define HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("warning(disable:2203 2331)") |
| 1066 | #elif HEDLEY_GCC_VERSION_CHECK(3,0,0) |
| 1067 | # define HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL _Pragma("GCC diagnostic ignored \"-Wcast-qual\"") |
| 1068 | #else |
| 1069 | # define HEDLEY_DIAGNOSTIC_DISABLE_CAST_QUAL |
| 1070 | #endif |
| 1071 | |
| 1072 | #if defined(HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION) |
| 1073 | # undef HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION |
| 1074 | #endif |
| 1075 | #if HEDLEY_HAS_WARNING("-Wunused-function") |
| 1076 | # define HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION _Pragma("clang diagnostic ignored \"-Wunused-function\"") |
| 1077 | #elif HEDLEY_GCC_VERSION_CHECK(3,4,0) |
| 1078 | # define HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION _Pragma("GCC diagnostic ignored \"-Wunused-function\"") |
| 1079 | #elif HEDLEY_MSVC_VERSION_CHECK(1,0,0) |
| 1080 | # define HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION __pragma(warning(disable:4505)) |
| 1081 | #elif HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) |
| 1082 | # define HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION _Pragma("diag_suppress 3142") |
| 1083 | #else |
| 1084 | # define HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION |
| 1085 | #endif |
| 1086 | |
| 1087 | #if defined(HEDLEY_DEPRECATED) |
| 1088 | # undef HEDLEY_DEPRECATED |
| 1089 | #endif |
| 1090 | #if defined(HEDLEY_DEPRECATED_FOR) |
| 1091 | # undef HEDLEY_DEPRECATED_FOR |
| 1092 | #endif |
| 1093 | #if \ |
| 1094 | HEDLEY_MSVC_VERSION_CHECK(14,0,0) || \ |
| 1095 | HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) |
| 1096 | # define HEDLEY_DEPRECATED(since) __declspec(deprecated("Since " # since)) |
| 1097 | # define HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated("Since " #since "; use " #replacement)) |
| 1098 | #elif \ |
| 1099 | (HEDLEY_HAS_EXTENSION(attribute_deprecated_with_message) && !defined(HEDLEY_IAR_VERSION)) || \ |
| 1100 | HEDLEY_GCC_VERSION_CHECK(4,5,0) || \ |
| 1101 | HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ |
| 1102 | HEDLEY_ARM_VERSION_CHECK(5,6,0) || \ |
| 1103 | HEDLEY_SUNPRO_VERSION_CHECK(5,13,0) || \ |
| 1104 | HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ |
| 1105 | HEDLEY_TI_VERSION_CHECK(18,1,0) || \ |
| 1106 | HEDLEY_TI_ARMCL_VERSION_CHECK(18,1,0) || \ |
| 1107 | HEDLEY_TI_CL6X_VERSION_CHECK(8,3,0) || \ |
| 1108 | HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ |
| 1109 | HEDLEY_TI_CLPRU_VERSION_CHECK(2,3,0) || \ |
| 1110 | HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) |
| 1111 | # define HEDLEY_DEPRECATED(since) __attribute__((__deprecated__("Since " #since))) |
| 1112 | # define HEDLEY_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__("Since " #since "; use " #replacement))) |
| 1113 | #elif defined(__cplusplus) && (__cplusplus >= 201402L) |
| 1114 | # define HEDLEY_DEPRECATED(since) HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[deprecated("Since " #since)]]) |
| 1115 | # define HEDLEY_DEPRECATED_FOR(since, replacement) HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[deprecated("Since " #since "; use " #replacement)]]) |
| 1116 | #elif \ |
| 1117 | HEDLEY_HAS_ATTRIBUTE(deprecated) || \ |
| 1118 | HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ |
| 1119 | HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ |
| 1120 | HEDLEY_TI_VERSION_CHECK(15,12,0) || \ |
| 1121 | (HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ |
| 1122 | HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ |
| 1123 | (HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ |
| 1124 | HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ |
| 1125 | (HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ |
| 1126 | HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ |
| 1127 | (HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ |
| 1128 | HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ |
| 1129 | HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ |
| 1130 | HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ |
| 1131 | HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) || \ |
| 1132 | HEDLEY_IAR_VERSION_CHECK(8,10,0) |
| 1133 | # define HEDLEY_DEPRECATED(since) __attribute__((__deprecated__)) |
| 1134 | # define HEDLEY_DEPRECATED_FOR(since, replacement) __attribute__((__deprecated__)) |
| 1135 | #elif \ |
| 1136 | HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ |
| 1137 | HEDLEY_PELLES_VERSION_CHECK(6,50,0) || \ |
| 1138 | HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) |
| 1139 | # define HEDLEY_DEPRECATED(since) __declspec(deprecated) |
| 1140 | # define HEDLEY_DEPRECATED_FOR(since, replacement) __declspec(deprecated) |
| 1141 | #elif HEDLEY_IAR_VERSION_CHECK(8,0,0) |
| 1142 | # define HEDLEY_DEPRECATED(since) _Pragma("deprecated") |
| 1143 | # define HEDLEY_DEPRECATED_FOR(since, replacement) _Pragma("deprecated") |
| 1144 | #else |
| 1145 | # define HEDLEY_DEPRECATED(since) |
| 1146 | # define HEDLEY_DEPRECATED_FOR(since, replacement) |
| 1147 | #endif |
| 1148 | |
| 1149 | #if defined(HEDLEY_UNAVAILABLE) |
| 1150 | # undef HEDLEY_UNAVAILABLE |
| 1151 | #endif |
| 1152 | #if \ |
| 1153 | HEDLEY_HAS_ATTRIBUTE(warning) || \ |
| 1154 | HEDLEY_GCC_VERSION_CHECK(4,3,0) || \ |
| 1155 | HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ |
| 1156 | HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) |
| 1157 | # define HEDLEY_UNAVAILABLE(available_since) __attribute__((__warning__("Not available until " #available_since))) |
| 1158 | #else |
| 1159 | # define HEDLEY_UNAVAILABLE(available_since) |
| 1160 | #endif |
| 1161 | |
| 1162 | #if defined(HEDLEY_WARN_UNUSED_RESULT) |
| 1163 | # undef HEDLEY_WARN_UNUSED_RESULT |
| 1164 | #endif |
| 1165 | #if defined(HEDLEY_WARN_UNUSED_RESULT_MSG) |
| 1166 | # undef HEDLEY_WARN_UNUSED_RESULT_MSG |
| 1167 | #endif |
| 1168 | #if \ |
| 1169 | HEDLEY_HAS_ATTRIBUTE(warn_unused_result) || \ |
| 1170 | HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ |
| 1171 | HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ |
| 1172 | HEDLEY_TI_VERSION_CHECK(15,12,0) || \ |
| 1173 | (HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ |
| 1174 | HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ |
| 1175 | (HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ |
| 1176 | HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ |
| 1177 | (HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ |
| 1178 | HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ |
| 1179 | (HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ |
| 1180 | HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ |
| 1181 | HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ |
| 1182 | HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ |
| 1183 | (HEDLEY_SUNPRO_VERSION_CHECK(5,15,0) && defined(__cplusplus)) || \ |
| 1184 | HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ |
| 1185 | HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) |
| 1186 | # define HEDLEY_WARN_UNUSED_RESULT __attribute__((__warn_unused_result__)) |
| 1187 | # define HEDLEY_WARN_UNUSED_RESULT_MSG(msg) __attribute__((__warn_unused_result__)) |
| 1188 | #elif (HEDLEY_HAS_CPP_ATTRIBUTE(nodiscard) >= 201907L) |
| 1189 | # define HEDLEY_WARN_UNUSED_RESULT HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard]]) |
| 1190 | # define HEDLEY_WARN_UNUSED_RESULT_MSG(msg) HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard(msg)]]) |
| 1191 | #elif HEDLEY_HAS_CPP_ATTRIBUTE(nodiscard) |
| 1192 | # define HEDLEY_WARN_UNUSED_RESULT HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard]]) |
| 1193 | # define HEDLEY_WARN_UNUSED_RESULT_MSG(msg) HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[nodiscard]]) |
| 1194 | #elif defined(_Check_return_) /* SAL */ |
| 1195 | # define HEDLEY_WARN_UNUSED_RESULT _Check_return_ |
| 1196 | # define HEDLEY_WARN_UNUSED_RESULT_MSG(msg) _Check_return_ |
| 1197 | #else |
| 1198 | # define HEDLEY_WARN_UNUSED_RESULT |
| 1199 | # define HEDLEY_WARN_UNUSED_RESULT_MSG(msg) |
| 1200 | #endif |
| 1201 | |
| 1202 | #if defined(HEDLEY_SENTINEL) |
| 1203 | # undef HEDLEY_SENTINEL |
| 1204 | #endif |
| 1205 | #if \ |
| 1206 | HEDLEY_HAS_ATTRIBUTE(sentinel) || \ |
| 1207 | HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ |
| 1208 | HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ |
| 1209 | HEDLEY_ARM_VERSION_CHECK(5,4,0) || \ |
| 1210 | HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) |
| 1211 | # define HEDLEY_SENTINEL(position) __attribute__((__sentinel__(position))) |
| 1212 | #else |
| 1213 | # define HEDLEY_SENTINEL(position) |
| 1214 | #endif |
| 1215 | |
| 1216 | #if defined(HEDLEY_NO_RETURN) |
| 1217 | # undef HEDLEY_NO_RETURN |
| 1218 | #endif |
| 1219 | #if HEDLEY_IAR_VERSION_CHECK(8,0,0) |
| 1220 | # define HEDLEY_NO_RETURN __noreturn |
| 1221 | #elif \ |
| 1222 | HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ |
| 1223 | HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) |
| 1224 | # define HEDLEY_NO_RETURN __attribute__((__noreturn__)) |
| 1225 | #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L |
| 1226 | # define HEDLEY_NO_RETURN _Noreturn |
| 1227 | #elif defined(__cplusplus) && (__cplusplus >= 201103L) |
| 1228 | # define HEDLEY_NO_RETURN HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[noreturn]]) |
| 1229 | #elif \ |
| 1230 | HEDLEY_HAS_ATTRIBUTE(noreturn) || \ |
| 1231 | HEDLEY_GCC_VERSION_CHECK(3,2,0) || \ |
| 1232 | HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ |
| 1233 | HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ |
| 1234 | HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ |
| 1235 | HEDLEY_TI_VERSION_CHECK(15,12,0) || \ |
| 1236 | (HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ |
| 1237 | HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ |
| 1238 | (HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ |
| 1239 | HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ |
| 1240 | (HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ |
| 1241 | HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ |
| 1242 | (HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ |
| 1243 | HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ |
| 1244 | HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ |
| 1245 | HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ |
| 1246 | HEDLEY_IAR_VERSION_CHECK(8,10,0) |
| 1247 | # define HEDLEY_NO_RETURN __attribute__((__noreturn__)) |
| 1248 | #elif HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) |
| 1249 | # define HEDLEY_NO_RETURN _Pragma("does_not_return") |
| 1250 | #elif \ |
| 1251 | HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ |
| 1252 | HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) |
| 1253 | # define HEDLEY_NO_RETURN __declspec(noreturn) |
| 1254 | #elif HEDLEY_TI_CL6X_VERSION_CHECK(6,0,0) && defined(__cplusplus) |
| 1255 | # define HEDLEY_NO_RETURN _Pragma("FUNC_NEVER_RETURNS;") |
| 1256 | #elif HEDLEY_COMPCERT_VERSION_CHECK(3,2,0) |
| 1257 | # define HEDLEY_NO_RETURN __attribute((noreturn)) |
| 1258 | #elif HEDLEY_PELLES_VERSION_CHECK(9,0,0) |
| 1259 | # define HEDLEY_NO_RETURN __declspec(noreturn) |
| 1260 | #else |
| 1261 | # define HEDLEY_NO_RETURN |
| 1262 | #endif |
| 1263 | |
| 1264 | #if defined(HEDLEY_NO_ESCAPE) |
| 1265 | # undef HEDLEY_NO_ESCAPE |
| 1266 | #endif |
| 1267 | #if HEDLEY_HAS_ATTRIBUTE(noescape) |
| 1268 | # define HEDLEY_NO_ESCAPE __attribute__((__noescape__)) |
| 1269 | #else |
| 1270 | # define HEDLEY_NO_ESCAPE |
| 1271 | #endif |
| 1272 | |
| 1273 | #if defined(HEDLEY_UNREACHABLE) |
| 1274 | # undef HEDLEY_UNREACHABLE |
| 1275 | #endif |
| 1276 | #if defined(HEDLEY_UNREACHABLE_RETURN) |
| 1277 | # undef HEDLEY_UNREACHABLE_RETURN |
| 1278 | #endif |
| 1279 | #if defined(HEDLEY_ASSUME) |
| 1280 | # undef HEDLEY_ASSUME |
| 1281 | #endif |
| 1282 | #if \ |
| 1283 | HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ |
| 1284 | HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ |
| 1285 | HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) |
| 1286 | # define HEDLEY_ASSUME(expr) __assume(expr) |
| 1287 | #elif HEDLEY_HAS_BUILTIN(__builtin_assume) |
| 1288 | # define HEDLEY_ASSUME(expr) __builtin_assume(expr) |
| 1289 | #elif \ |
| 1290 | HEDLEY_TI_CL2000_VERSION_CHECK(6,2,0) || \ |
| 1291 | HEDLEY_TI_CL6X_VERSION_CHECK(4,0,0) |
| 1292 | # if defined(__cplusplus) |
| 1293 | # define HEDLEY_ASSUME(expr) std::_nassert(expr) |
| 1294 | # else |
| 1295 | # define HEDLEY_ASSUME(expr) _nassert(expr) |
| 1296 | # endif |
| 1297 | #endif |
| 1298 | #if \ |
| 1299 | (HEDLEY_HAS_BUILTIN(__builtin_unreachable) && (!defined(HEDLEY_ARM_VERSION))) || \ |
| 1300 | HEDLEY_GCC_VERSION_CHECK(4,5,0) || \ |
| 1301 | HEDLEY_PGI_VERSION_CHECK(18,10,0) || \ |
| 1302 | HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ |
| 1303 | HEDLEY_IBM_VERSION_CHECK(13,1,5) || \ |
| 1304 | HEDLEY_CRAY_VERSION_CHECK(10,0,0) || \ |
| 1305 | HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) |
| 1306 | # define HEDLEY_UNREACHABLE() __builtin_unreachable() |
| 1307 | #elif defined(HEDLEY_ASSUME) |
| 1308 | # define HEDLEY_UNREACHABLE() HEDLEY_ASSUME(0) |
| 1309 | #endif |
| 1310 | #if !defined(HEDLEY_ASSUME) |
| 1311 | # if defined(HEDLEY_UNREACHABLE) |
| 1312 | # define HEDLEY_ASSUME(expr) HEDLEY_STATIC_CAST(void, ((expr) ? 1 : (HEDLEY_UNREACHABLE(), 1))) |
| 1313 | # else |
| 1314 | # define HEDLEY_ASSUME(expr) HEDLEY_STATIC_CAST(void, expr) |
| 1315 | # endif |
| 1316 | #endif |
| 1317 | #if defined(HEDLEY_UNREACHABLE) |
| 1318 | # if \ |
| 1319 | HEDLEY_TI_CL2000_VERSION_CHECK(6,2,0) || \ |
| 1320 | HEDLEY_TI_CL6X_VERSION_CHECK(4,0,0) |
| 1321 | # define HEDLEY_UNREACHABLE_RETURN(value) return (HEDLEY_STATIC_CAST(void, HEDLEY_ASSUME(0)), (value)) |
| 1322 | # else |
| 1323 | # define HEDLEY_UNREACHABLE_RETURN(value) HEDLEY_UNREACHABLE() |
| 1324 | # endif |
| 1325 | #else |
| 1326 | # define HEDLEY_UNREACHABLE_RETURN(value) return (value) |
| 1327 | #endif |
| 1328 | #if !defined(HEDLEY_UNREACHABLE) |
| 1329 | # define HEDLEY_UNREACHABLE() HEDLEY_ASSUME(0) |
| 1330 | #endif |
| 1331 | |
| 1332 | HEDLEY_DIAGNOSTIC_PUSH |
| 1333 | #if HEDLEY_HAS_WARNING("-Wpedantic") |
| 1334 | # pragma clang diagnostic ignored "-Wpedantic" |
| 1335 | #endif |
| 1336 | #if HEDLEY_HAS_WARNING("-Wc++98-compat-pedantic") && defined(__cplusplus) |
| 1337 | # pragma clang diagnostic ignored "-Wc++98-compat-pedantic" |
| 1338 | #endif |
| 1339 | #if HEDLEY_GCC_HAS_WARNING("-Wvariadic-macros",4,0,0) |
| 1340 | # if defined(__clang__) |
| 1341 | # pragma clang diagnostic ignored "-Wvariadic-macros" |
| 1342 | # elif defined(HEDLEY_GCC_VERSION) |
| 1343 | # pragma GCC diagnostic ignored "-Wvariadic-macros" |
| 1344 | # endif |
| 1345 | #endif |
| 1346 | #if defined(HEDLEY_NON_NULL) |
| 1347 | # undef HEDLEY_NON_NULL |
| 1348 | #endif |
| 1349 | #if \ |
| 1350 | HEDLEY_HAS_ATTRIBUTE(nonnull) || \ |
| 1351 | HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ |
| 1352 | HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ |
| 1353 | HEDLEY_ARM_VERSION_CHECK(4,1,0) |
| 1354 | # define HEDLEY_NON_NULL(...) __attribute__((__nonnull__(__VA_ARGS__))) |
| 1355 | #else |
| 1356 | # define HEDLEY_NON_NULL(...) |
| 1357 | #endif |
| 1358 | HEDLEY_DIAGNOSTIC_POP |
| 1359 | |
| 1360 | #if defined(HEDLEY_PRINTF_FORMAT) |
| 1361 | # undef HEDLEY_PRINTF_FORMAT |
| 1362 | #endif |
| 1363 | #if defined(__MINGW32__) && HEDLEY_GCC_HAS_ATTRIBUTE(format,4,4,0) && !defined(__USE_MINGW_ANSI_STDIO) |
| 1364 | # define HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(ms_printf, string_idx, first_to_check))) |
| 1365 | #elif defined(__MINGW32__) && HEDLEY_GCC_HAS_ATTRIBUTE(format,4,4,0) && defined(__USE_MINGW_ANSI_STDIO) |
| 1366 | # define HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(gnu_printf, string_idx, first_to_check))) |
| 1367 | #elif \ |
| 1368 | HEDLEY_HAS_ATTRIBUTE(format) || \ |
| 1369 | HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ |
| 1370 | HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ |
| 1371 | HEDLEY_ARM_VERSION_CHECK(5,6,0) || \ |
| 1372 | HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ |
| 1373 | HEDLEY_TI_VERSION_CHECK(15,12,0) || \ |
| 1374 | (HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ |
| 1375 | HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ |
| 1376 | (HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ |
| 1377 | HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ |
| 1378 | (HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ |
| 1379 | HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ |
| 1380 | (HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ |
| 1381 | HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ |
| 1382 | HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ |
| 1383 | HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ |
| 1384 | HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) |
| 1385 | # define HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __attribute__((__format__(__printf__, string_idx, first_to_check))) |
| 1386 | #elif HEDLEY_PELLES_VERSION_CHECK(6,0,0) |
| 1387 | # define HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) __declspec(vaformat(printf,string_idx,first_to_check)) |
| 1388 | #else |
| 1389 | # define HEDLEY_PRINTF_FORMAT(string_idx,first_to_check) |
| 1390 | #endif |
| 1391 | |
| 1392 | #if defined(HEDLEY_CONSTEXPR) |
| 1393 | # undef HEDLEY_CONSTEXPR |
| 1394 | #endif |
| 1395 | #if defined(__cplusplus) |
| 1396 | # if __cplusplus >= 201103L |
| 1397 | # define HEDLEY_CONSTEXPR HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(constexpr) |
| 1398 | # endif |
| 1399 | #endif |
| 1400 | #if !defined(HEDLEY_CONSTEXPR) |
| 1401 | # define HEDLEY_CONSTEXPR |
| 1402 | #endif |
| 1403 | |
| 1404 | #if defined(HEDLEY_PREDICT) |
| 1405 | # undef HEDLEY_PREDICT |
| 1406 | #endif |
| 1407 | #if defined(HEDLEY_LIKELY) |
| 1408 | # undef HEDLEY_LIKELY |
| 1409 | #endif |
| 1410 | #if defined(HEDLEY_UNLIKELY) |
| 1411 | # undef HEDLEY_UNLIKELY |
| 1412 | #endif |
| 1413 | #if defined(HEDLEY_UNPREDICTABLE) |
| 1414 | # undef HEDLEY_UNPREDICTABLE |
| 1415 | #endif |
| 1416 | #if HEDLEY_HAS_BUILTIN(__builtin_unpredictable) |
| 1417 | # define HEDLEY_UNPREDICTABLE(expr) __builtin_unpredictable((expr)) |
| 1418 | #endif |
| 1419 | #if \ |
| 1420 | (HEDLEY_HAS_BUILTIN(__builtin_expect_with_probability) && !defined(HEDLEY_PGI_VERSION) && !defined(HEDLEY_INTEL_VERSION)) || \ |
| 1421 | HEDLEY_GCC_VERSION_CHECK(9,0,0) || \ |
| 1422 | HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) |
| 1423 | # define HEDLEY_PREDICT(expr, value, probability) __builtin_expect_with_probability( (expr), (value), (probability)) |
| 1424 | # define HEDLEY_PREDICT_TRUE(expr, probability) __builtin_expect_with_probability(!!(expr), 1 , (probability)) |
| 1425 | # define HEDLEY_PREDICT_FALSE(expr, probability) __builtin_expect_with_probability(!!(expr), 0 , (probability)) |
| 1426 | # define HEDLEY_LIKELY(expr) __builtin_expect (!!(expr), 1 ) |
| 1427 | # define HEDLEY_UNLIKELY(expr) __builtin_expect (!!(expr), 0 ) |
| 1428 | #elif \ |
| 1429 | (HEDLEY_HAS_BUILTIN(__builtin_expect) && !defined(HEDLEY_INTEL_CL_VERSION)) || \ |
| 1430 | HEDLEY_GCC_VERSION_CHECK(3,0,0) || \ |
| 1431 | HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ |
| 1432 | (HEDLEY_SUNPRO_VERSION_CHECK(5,15,0) && defined(__cplusplus)) || \ |
| 1433 | HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ |
| 1434 | HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ |
| 1435 | HEDLEY_TI_VERSION_CHECK(15,12,0) || \ |
| 1436 | HEDLEY_TI_ARMCL_VERSION_CHECK(4,7,0) || \ |
| 1437 | HEDLEY_TI_CL430_VERSION_CHECK(3,1,0) || \ |
| 1438 | HEDLEY_TI_CL2000_VERSION_CHECK(6,1,0) || \ |
| 1439 | HEDLEY_TI_CL6X_VERSION_CHECK(6,1,0) || \ |
| 1440 | HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ |
| 1441 | HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ |
| 1442 | HEDLEY_TINYC_VERSION_CHECK(0,9,27) || \ |
| 1443 | HEDLEY_CRAY_VERSION_CHECK(8,1,0) || \ |
| 1444 | HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) |
| 1445 | # define HEDLEY_PREDICT(expr, expected, probability) \ |
| 1446 | (((probability) >= 0.9) ? __builtin_expect((expr), (expected)) : (HEDLEY_STATIC_CAST(void, expected), (expr))) |
| 1447 | # define HEDLEY_PREDICT_TRUE(expr, probability) \ |
| 1448 | (__extension__ ({ \ |
| 1449 | double hedley_probability_ = (probability); \ |
| 1450 | ((hedley_probability_ >= 0.9) ? __builtin_expect(!!(expr), 1) : ((hedley_probability_ <= 0.1) ? __builtin_expect(!!(expr), 0) : !!(expr))); \ |
| 1451 | })) |
| 1452 | # define HEDLEY_PREDICT_FALSE(expr, probability) \ |
| 1453 | (__extension__ ({ \ |
| 1454 | double hedley_probability_ = (probability); \ |
| 1455 | ((hedley_probability_ >= 0.9) ? __builtin_expect(!!(expr), 0) : ((hedley_probability_ <= 0.1) ? __builtin_expect(!!(expr), 1) : !!(expr))); \ |
| 1456 | })) |
| 1457 | # define HEDLEY_LIKELY(expr) __builtin_expect(!!(expr), 1) |
| 1458 | # define HEDLEY_UNLIKELY(expr) __builtin_expect(!!(expr), 0) |
| 1459 | #else |
| 1460 | # define HEDLEY_PREDICT(expr, expected, probability) (HEDLEY_STATIC_CAST(void, expected), (expr)) |
| 1461 | # define HEDLEY_PREDICT_TRUE(expr, probability) (!!(expr)) |
| 1462 | # define HEDLEY_PREDICT_FALSE(expr, probability) (!!(expr)) |
| 1463 | # define HEDLEY_LIKELY(expr) (!!(expr)) |
| 1464 | # define HEDLEY_UNLIKELY(expr) (!!(expr)) |
| 1465 | #endif |
| 1466 | #if !defined(HEDLEY_UNPREDICTABLE) |
| 1467 | # define HEDLEY_UNPREDICTABLE(expr) HEDLEY_PREDICT(expr, 1, 0.5) |
| 1468 | #endif |
| 1469 | |
| 1470 | #if defined(HEDLEY_MALLOC) |
| 1471 | # undef HEDLEY_MALLOC |
| 1472 | #endif |
| 1473 | #if \ |
| 1474 | HEDLEY_HAS_ATTRIBUTE(malloc) || \ |
| 1475 | HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ |
| 1476 | HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ |
| 1477 | HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ |
| 1478 | HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ |
| 1479 | HEDLEY_IBM_VERSION_CHECK(12,1,0) || \ |
| 1480 | HEDLEY_TI_VERSION_CHECK(15,12,0) || \ |
| 1481 | (HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ |
| 1482 | HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ |
| 1483 | (HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ |
| 1484 | HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ |
| 1485 | (HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ |
| 1486 | HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ |
| 1487 | (HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ |
| 1488 | HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ |
| 1489 | HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ |
| 1490 | HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ |
| 1491 | HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) |
| 1492 | # define HEDLEY_MALLOC __attribute__((__malloc__)) |
| 1493 | #elif HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) |
| 1494 | # define HEDLEY_MALLOC _Pragma("returns_new_memory") |
| 1495 | #elif \ |
| 1496 | HEDLEY_MSVC_VERSION_CHECK(14,0,0) || \ |
| 1497 | HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) |
| 1498 | # define HEDLEY_MALLOC __declspec(restrict) |
| 1499 | #else |
| 1500 | # define HEDLEY_MALLOC |
| 1501 | #endif |
| 1502 | |
| 1503 | #if defined(HEDLEY_PURE) |
| 1504 | # undef HEDLEY_PURE |
| 1505 | #endif |
| 1506 | #if \ |
| 1507 | HEDLEY_HAS_ATTRIBUTE(pure) || \ |
| 1508 | HEDLEY_GCC_VERSION_CHECK(2,96,0) || \ |
| 1509 | HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ |
| 1510 | HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ |
| 1511 | HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ |
| 1512 | HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ |
| 1513 | HEDLEY_TI_VERSION_CHECK(15,12,0) || \ |
| 1514 | (HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ |
| 1515 | HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ |
| 1516 | (HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ |
| 1517 | HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ |
| 1518 | (HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ |
| 1519 | HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ |
| 1520 | (HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ |
| 1521 | HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ |
| 1522 | HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ |
| 1523 | HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ |
| 1524 | HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ |
| 1525 | HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) |
| 1526 | # define HEDLEY_PURE __attribute__((__pure__)) |
| 1527 | #elif HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) |
| 1528 | # define HEDLEY_PURE _Pragma("does_not_write_global_data") |
| 1529 | #elif defined(__cplusplus) && \ |
| 1530 | ( \ |
| 1531 | HEDLEY_TI_CL430_VERSION_CHECK(2,0,1) || \ |
| 1532 | HEDLEY_TI_CL6X_VERSION_CHECK(4,0,0) || \ |
| 1533 | HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) \ |
| 1534 | ) |
| 1535 | # define HEDLEY_PURE _Pragma("FUNC_IS_PURE;") |
| 1536 | #else |
| 1537 | # define HEDLEY_PURE |
| 1538 | #endif |
| 1539 | |
| 1540 | #if defined(HEDLEY_CONST) |
| 1541 | # undef HEDLEY_CONST |
| 1542 | #endif |
| 1543 | #if \ |
| 1544 | HEDLEY_HAS_ATTRIBUTE(const) || \ |
| 1545 | HEDLEY_GCC_VERSION_CHECK(2,5,0) || \ |
| 1546 | HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ |
| 1547 | HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ |
| 1548 | HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ |
| 1549 | HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ |
| 1550 | HEDLEY_TI_VERSION_CHECK(15,12,0) || \ |
| 1551 | (HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ |
| 1552 | HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ |
| 1553 | (HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ |
| 1554 | HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ |
| 1555 | (HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ |
| 1556 | HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ |
| 1557 | (HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ |
| 1558 | HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ |
| 1559 | HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ |
| 1560 | HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ |
| 1561 | HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ |
| 1562 | HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) |
| 1563 | # define HEDLEY_CONST __attribute__((__const__)) |
| 1564 | #elif \ |
| 1565 | HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) |
| 1566 | # define HEDLEY_CONST _Pragma("no_side_effect") |
| 1567 | #else |
| 1568 | # define HEDLEY_CONST HEDLEY_PURE |
| 1569 | #endif |
| 1570 | |
| 1571 | #if defined(HEDLEY_RESTRICT) |
| 1572 | # undef HEDLEY_RESTRICT |
| 1573 | #endif |
| 1574 | #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && !defined(__cplusplus) |
| 1575 | # define HEDLEY_RESTRICT restrict |
| 1576 | #elif \ |
| 1577 | HEDLEY_GCC_VERSION_CHECK(3,1,0) || \ |
| 1578 | HEDLEY_MSVC_VERSION_CHECK(14,0,0) || \ |
| 1579 | HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ |
| 1580 | HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) || \ |
| 1581 | HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ |
| 1582 | HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ |
| 1583 | HEDLEY_PGI_VERSION_CHECK(17,10,0) || \ |
| 1584 | HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ |
| 1585 | HEDLEY_TI_CL2000_VERSION_CHECK(6,2,4) || \ |
| 1586 | HEDLEY_TI_CL6X_VERSION_CHECK(8,1,0) || \ |
| 1587 | HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ |
| 1588 | (HEDLEY_SUNPRO_VERSION_CHECK(5,14,0) && defined(__cplusplus)) || \ |
| 1589 | HEDLEY_IAR_VERSION_CHECK(8,0,0) || \ |
| 1590 | defined(__clang__) || \ |
| 1591 | HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) |
| 1592 | # define HEDLEY_RESTRICT __restrict |
| 1593 | #elif HEDLEY_SUNPRO_VERSION_CHECK(5,3,0) && !defined(__cplusplus) |
| 1594 | # define HEDLEY_RESTRICT _Restrict |
| 1595 | #else |
| 1596 | # define HEDLEY_RESTRICT |
| 1597 | #endif |
| 1598 | |
| 1599 | #if defined(HEDLEY_INLINE) |
| 1600 | # undef HEDLEY_INLINE |
| 1601 | #endif |
| 1602 | #if \ |
| 1603 | (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) || \ |
| 1604 | (defined(__cplusplus) && (__cplusplus >= 199711L)) |
| 1605 | # define HEDLEY_INLINE inline |
| 1606 | #elif \ |
| 1607 | defined(HEDLEY_GCC_VERSION) || \ |
| 1608 | HEDLEY_ARM_VERSION_CHECK(6,2,0) |
| 1609 | # define HEDLEY_INLINE __inline__ |
| 1610 | #elif \ |
| 1611 | HEDLEY_MSVC_VERSION_CHECK(12,0,0) || \ |
| 1612 | HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) || \ |
| 1613 | HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ |
| 1614 | HEDLEY_TI_ARMCL_VERSION_CHECK(5,1,0) || \ |
| 1615 | HEDLEY_TI_CL430_VERSION_CHECK(3,1,0) || \ |
| 1616 | HEDLEY_TI_CL2000_VERSION_CHECK(6,2,0) || \ |
| 1617 | HEDLEY_TI_CL6X_VERSION_CHECK(8,0,0) || \ |
| 1618 | HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ |
| 1619 | HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ |
| 1620 | HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) |
| 1621 | # define HEDLEY_INLINE __inline |
| 1622 | #else |
| 1623 | # define HEDLEY_INLINE |
| 1624 | #endif |
| 1625 | |
| 1626 | #if defined(HEDLEY_ALWAYS_INLINE) |
| 1627 | # undef HEDLEY_ALWAYS_INLINE |
| 1628 | #endif |
| 1629 | #if \ |
| 1630 | HEDLEY_HAS_ATTRIBUTE(always_inline) || \ |
| 1631 | HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ |
| 1632 | HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ |
| 1633 | HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ |
| 1634 | HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ |
| 1635 | HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ |
| 1636 | HEDLEY_TI_VERSION_CHECK(15,12,0) || \ |
| 1637 | (HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ |
| 1638 | HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ |
| 1639 | (HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ |
| 1640 | HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ |
| 1641 | (HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ |
| 1642 | HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ |
| 1643 | (HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ |
| 1644 | HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ |
| 1645 | HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ |
| 1646 | HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ |
| 1647 | HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) || \ |
| 1648 | HEDLEY_IAR_VERSION_CHECK(8,10,0) |
| 1649 | # define HEDLEY_ALWAYS_INLINE __attribute__((__always_inline__)) HEDLEY_INLINE |
| 1650 | #elif \ |
| 1651 | HEDLEY_MSVC_VERSION_CHECK(12,0,0) || \ |
| 1652 | HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) |
| 1653 | # define HEDLEY_ALWAYS_INLINE __forceinline |
| 1654 | #elif defined(__cplusplus) && \ |
| 1655 | ( \ |
| 1656 | HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ |
| 1657 | HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ |
| 1658 | HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ |
| 1659 | HEDLEY_TI_CL6X_VERSION_CHECK(6,1,0) || \ |
| 1660 | HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ |
| 1661 | HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) \ |
| 1662 | ) |
| 1663 | # define HEDLEY_ALWAYS_INLINE _Pragma("FUNC_ALWAYS_INLINE;") |
| 1664 | #elif HEDLEY_IAR_VERSION_CHECK(8,0,0) |
| 1665 | # define HEDLEY_ALWAYS_INLINE _Pragma("inline=forced") |
| 1666 | #else |
| 1667 | # define HEDLEY_ALWAYS_INLINE HEDLEY_INLINE |
| 1668 | #endif |
| 1669 | |
| 1670 | #if defined(HEDLEY_NEVER_INLINE) |
| 1671 | # undef HEDLEY_NEVER_INLINE |
| 1672 | #endif |
| 1673 | #if \ |
| 1674 | HEDLEY_HAS_ATTRIBUTE(noinline) || \ |
| 1675 | HEDLEY_GCC_VERSION_CHECK(4,0,0) || \ |
| 1676 | HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ |
| 1677 | HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ |
| 1678 | HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ |
| 1679 | HEDLEY_IBM_VERSION_CHECK(10,1,0) || \ |
| 1680 | HEDLEY_TI_VERSION_CHECK(15,12,0) || \ |
| 1681 | (HEDLEY_TI_ARMCL_VERSION_CHECK(4,8,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ |
| 1682 | HEDLEY_TI_ARMCL_VERSION_CHECK(5,2,0) || \ |
| 1683 | (HEDLEY_TI_CL2000_VERSION_CHECK(6,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ |
| 1684 | HEDLEY_TI_CL2000_VERSION_CHECK(6,4,0) || \ |
| 1685 | (HEDLEY_TI_CL430_VERSION_CHECK(4,0,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ |
| 1686 | HEDLEY_TI_CL430_VERSION_CHECK(4,3,0) || \ |
| 1687 | (HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ |
| 1688 | HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) || \ |
| 1689 | HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ |
| 1690 | HEDLEY_TI_CLPRU_VERSION_CHECK(2,1,0) || \ |
| 1691 | HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) || \ |
| 1692 | HEDLEY_IAR_VERSION_CHECK(8,10,0) |
| 1693 | # define HEDLEY_NEVER_INLINE __attribute__((__noinline__)) |
| 1694 | #elif \ |
| 1695 | HEDLEY_MSVC_VERSION_CHECK(13,10,0) || \ |
| 1696 | HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) |
| 1697 | # define HEDLEY_NEVER_INLINE __declspec(noinline) |
| 1698 | #elif HEDLEY_PGI_VERSION_CHECK(10,2,0) |
| 1699 | # define HEDLEY_NEVER_INLINE _Pragma("noinline") |
| 1700 | #elif HEDLEY_TI_CL6X_VERSION_CHECK(6,0,0) && defined(__cplusplus) |
| 1701 | # define HEDLEY_NEVER_INLINE _Pragma("FUNC_CANNOT_INLINE;") |
| 1702 | #elif HEDLEY_IAR_VERSION_CHECK(8,0,0) |
| 1703 | # define HEDLEY_NEVER_INLINE _Pragma("inline=never") |
| 1704 | #elif HEDLEY_COMPCERT_VERSION_CHECK(3,2,0) |
| 1705 | # define HEDLEY_NEVER_INLINE __attribute((noinline)) |
| 1706 | #elif HEDLEY_PELLES_VERSION_CHECK(9,0,0) |
| 1707 | # define HEDLEY_NEVER_INLINE __declspec(noinline) |
| 1708 | #else |
| 1709 | # define HEDLEY_NEVER_INLINE |
| 1710 | #endif |
| 1711 | |
| 1712 | #if defined(HEDLEY_PRIVATE) |
| 1713 | # undef HEDLEY_PRIVATE |
| 1714 | #endif |
| 1715 | #if defined(HEDLEY_PUBLIC) |
| 1716 | # undef HEDLEY_PUBLIC |
| 1717 | #endif |
| 1718 | #if defined(HEDLEY_IMPORT) |
| 1719 | # undef HEDLEY_IMPORT |
| 1720 | #endif |
| 1721 | #if defined(_WIN32) || defined(__CYGWIN__) |
| 1722 | # define HEDLEY_PRIVATE |
| 1723 | # define HEDLEY_PUBLIC __declspec(dllexport) |
| 1724 | # define HEDLEY_IMPORT __declspec(dllimport) |
| 1725 | #else |
| 1726 | # if \ |
| 1727 | HEDLEY_HAS_ATTRIBUTE(visibility) || \ |
| 1728 | HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ |
| 1729 | HEDLEY_SUNPRO_VERSION_CHECK(5,11,0) || \ |
| 1730 | HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ |
| 1731 | HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ |
| 1732 | HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ |
| 1733 | ( \ |
| 1734 | defined(__TI_EABI__) && \ |
| 1735 | ( \ |
| 1736 | (HEDLEY_TI_CL6X_VERSION_CHECK(7,2,0) && defined(__TI_GNU_ATTRIBUTE_SUPPORT__)) || \ |
| 1737 | HEDLEY_TI_CL6X_VERSION_CHECK(7,5,0) \ |
| 1738 | ) \ |
| 1739 | ) || \ |
| 1740 | HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) |
| 1741 | # define HEDLEY_PRIVATE __attribute__((__visibility__("hidden"))) |
| 1742 | # define HEDLEY_PUBLIC __attribute__((__visibility__("default"))) |
| 1743 | # else |
| 1744 | # define HEDLEY_PRIVATE |
| 1745 | # define HEDLEY_PUBLIC |
| 1746 | # endif |
| 1747 | # define HEDLEY_IMPORT extern |
| 1748 | #endif |
| 1749 | |
| 1750 | #if defined(HEDLEY_NO_THROW) |
| 1751 | # undef HEDLEY_NO_THROW |
| 1752 | #endif |
| 1753 | #if \ |
| 1754 | HEDLEY_HAS_ATTRIBUTE(nothrow) || \ |
| 1755 | HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ |
| 1756 | HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ |
| 1757 | HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) |
| 1758 | # define HEDLEY_NO_THROW __attribute__((__nothrow__)) |
| 1759 | #elif \ |
| 1760 | HEDLEY_MSVC_VERSION_CHECK(13,1,0) || \ |
| 1761 | HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) || \ |
| 1762 | HEDLEY_ARM_VERSION_CHECK(4,1,0) |
| 1763 | # define HEDLEY_NO_THROW __declspec(nothrow) |
| 1764 | #else |
| 1765 | # define HEDLEY_NO_THROW |
| 1766 | #endif |
| 1767 | |
| 1768 | #if defined(HEDLEY_FALL_THROUGH) |
| 1769 | # undef HEDLEY_FALL_THROUGH |
| 1770 | #endif |
| 1771 | #if defined(HEDLEY_INTEL_VERSION) |
| 1772 | # define HEDLEY_FALL_THROUGH |
| 1773 | #elif \ |
| 1774 | HEDLEY_HAS_ATTRIBUTE(fallthrough) || \ |
| 1775 | HEDLEY_GCC_VERSION_CHECK(7,0,0) || \ |
| 1776 | HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) |
| 1777 | # define HEDLEY_FALL_THROUGH __attribute__((__fallthrough__)) |
| 1778 | #elif HEDLEY_HAS_CPP_ATTRIBUTE_NS(clang,fallthrough) |
| 1779 | # define HEDLEY_FALL_THROUGH HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[clang::fallthrough]]) |
| 1780 | #elif HEDLEY_HAS_CPP_ATTRIBUTE(fallthrough) |
| 1781 | # define HEDLEY_FALL_THROUGH HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_([[fallthrough]]) |
| 1782 | #elif defined(__fallthrough) /* SAL */ |
| 1783 | # define HEDLEY_FALL_THROUGH __fallthrough |
| 1784 | #else |
| 1785 | # define HEDLEY_FALL_THROUGH |
| 1786 | #endif |
| 1787 | |
| 1788 | #if defined(HEDLEY_RETURNS_NON_NULL) |
| 1789 | # undef HEDLEY_RETURNS_NON_NULL |
| 1790 | #endif |
| 1791 | #if \ |
| 1792 | HEDLEY_HAS_ATTRIBUTE(returns_nonnull) || \ |
| 1793 | HEDLEY_GCC_VERSION_CHECK(4,9,0) || \ |
| 1794 | HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) |
| 1795 | # define HEDLEY_RETURNS_NON_NULL __attribute__((__returns_nonnull__)) |
| 1796 | #elif defined(_Ret_notnull_) /* SAL */ |
| 1797 | # define HEDLEY_RETURNS_NON_NULL _Ret_notnull_ |
| 1798 | #else |
| 1799 | # define HEDLEY_RETURNS_NON_NULL |
| 1800 | #endif |
| 1801 | |
| 1802 | #if defined(HEDLEY_ARRAY_PARAM) |
| 1803 | # undef HEDLEY_ARRAY_PARAM |
| 1804 | #endif |
| 1805 | #if \ |
| 1806 | defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && \ |
| 1807 | !defined(__STDC_NO_VLA__) && \ |
| 1808 | !defined(__cplusplus) && \ |
| 1809 | !defined(HEDLEY_PGI_VERSION) && \ |
| 1810 | !defined(HEDLEY_TINYC_VERSION) |
| 1811 | # define HEDLEY_ARRAY_PARAM(name) (name) |
| 1812 | #else |
| 1813 | # define HEDLEY_ARRAY_PARAM(name) |
| 1814 | #endif |
| 1815 | |
| 1816 | #if defined(HEDLEY_IS_CONSTANT) |
| 1817 | # undef HEDLEY_IS_CONSTANT |
| 1818 | #endif |
| 1819 | #if defined(HEDLEY_REQUIRE_CONSTEXPR) |
| 1820 | # undef HEDLEY_REQUIRE_CONSTEXPR |
| 1821 | #endif |
| 1822 | /* HEDLEY_IS_CONSTEXPR_ is for |
| 1823 | HEDLEY INTERNAL USE ONLY. API subject to change without notice. */ |
| 1824 | #if defined(HEDLEY_IS_CONSTEXPR_) |
| 1825 | # undef HEDLEY_IS_CONSTEXPR_ |
| 1826 | #endif |
| 1827 | #if \ |
| 1828 | HEDLEY_HAS_BUILTIN(__builtin_constant_p) || \ |
| 1829 | HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ |
| 1830 | HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ |
| 1831 | HEDLEY_TINYC_VERSION_CHECK(0,9,19) || \ |
| 1832 | HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ |
| 1833 | HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ |
| 1834 | HEDLEY_TI_CL6X_VERSION_CHECK(6,1,0) || \ |
| 1835 | (HEDLEY_SUNPRO_VERSION_CHECK(5,10,0) && !defined(__cplusplus)) || \ |
| 1836 | HEDLEY_CRAY_VERSION_CHECK(8,1,0) || \ |
| 1837 | HEDLEY_MCST_LCC_VERSION_CHECK(1,25,10) |
| 1838 | # define HEDLEY_IS_CONSTANT(expr) __builtin_constant_p(expr) |
| 1839 | #endif |
| 1840 | #if !defined(__cplusplus) |
| 1841 | # if \ |
| 1842 | HEDLEY_HAS_BUILTIN(__builtin_types_compatible_p) || \ |
| 1843 | HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ |
| 1844 | HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ |
| 1845 | HEDLEY_IBM_VERSION_CHECK(13,1,0) || \ |
| 1846 | HEDLEY_CRAY_VERSION_CHECK(8,1,0) || \ |
| 1847 | HEDLEY_ARM_VERSION_CHECK(5,4,0) || \ |
| 1848 | HEDLEY_TINYC_VERSION_CHECK(0,9,24) |
| 1849 | # if defined(__INTPTR_TYPE__) |
| 1850 | # define HEDLEY_IS_CONSTEXPR_(expr) __builtin_types_compatible_p(__typeof__((1 ? (void*) ((__INTPTR_TYPE__) ((expr) * 0)) : (int*) 0)), int*) |
| 1851 | # else |
| 1852 | # include <stdint.h> |
| 1853 | # define HEDLEY_IS_CONSTEXPR_(expr) __builtin_types_compatible_p(__typeof__((1 ? (void*) ((intptr_t) ((expr) * 0)) : (int*) 0)), int*) |
| 1854 | # endif |
| 1855 | # elif \ |
| 1856 | ( \ |
| 1857 | defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) && \ |
| 1858 | !defined(HEDLEY_SUNPRO_VERSION) && \ |
| 1859 | !defined(HEDLEY_PGI_VERSION) && \ |
| 1860 | !defined(HEDLEY_IAR_VERSION)) || \ |
| 1861 | (HEDLEY_HAS_EXTENSION(c_generic_selections) && !defined(HEDLEY_IAR_VERSION)) || \ |
| 1862 | HEDLEY_GCC_VERSION_CHECK(4,9,0) || \ |
| 1863 | HEDLEY_INTEL_VERSION_CHECK(17,0,0) || \ |
| 1864 | HEDLEY_IBM_VERSION_CHECK(12,1,0) || \ |
| 1865 | HEDLEY_ARM_VERSION_CHECK(5,3,0) |
| 1866 | # if defined(__INTPTR_TYPE__) |
| 1867 | # define HEDLEY_IS_CONSTEXPR_(expr) _Generic((1 ? (void*) ((__INTPTR_TYPE__) ((expr) * 0)) : (int*) 0), int*: 1, void*: 0) |
| 1868 | # else |
| 1869 | # include <stdint.h> |
| 1870 | # define HEDLEY_IS_CONSTEXPR_(expr) _Generic((1 ? (void*) ((intptr_t) * 0) : (int*) 0), int*: 1, void*: 0) |
| 1871 | # endif |
| 1872 | # elif \ |
| 1873 | defined(HEDLEY_GCC_VERSION) || \ |
| 1874 | defined(HEDLEY_INTEL_VERSION) || \ |
| 1875 | defined(HEDLEY_TINYC_VERSION) || \ |
| 1876 | defined(HEDLEY_TI_ARMCL_VERSION) || \ |
| 1877 | HEDLEY_TI_CL430_VERSION_CHECK(18,12,0) || \ |
| 1878 | defined(HEDLEY_TI_CL2000_VERSION) || \ |
| 1879 | defined(HEDLEY_TI_CL6X_VERSION) || \ |
| 1880 | defined(HEDLEY_TI_CL7X_VERSION) || \ |
| 1881 | defined(HEDLEY_TI_CLPRU_VERSION) || \ |
| 1882 | defined(__clang__) |
| 1883 | # define HEDLEY_IS_CONSTEXPR_(expr) ( \ |
| 1884 | sizeof(void) != \ |
| 1885 | sizeof(*( \ |
| 1886 | 1 ? \ |
| 1887 | ((void*) ((expr) * 0L) ) : \ |
| 1888 | ((struct { char v[sizeof(void) * 2]; } *) 1) \ |
| 1889 | ) \ |
| 1890 | ) \ |
| 1891 | ) |
| 1892 | # endif |
| 1893 | #endif |
| 1894 | #if defined(HEDLEY_IS_CONSTEXPR_) |
| 1895 | # if !defined(HEDLEY_IS_CONSTANT) |
| 1896 | # define HEDLEY_IS_CONSTANT(expr) HEDLEY_IS_CONSTEXPR_(expr) |
| 1897 | # endif |
| 1898 | # define HEDLEY_REQUIRE_CONSTEXPR(expr) (HEDLEY_IS_CONSTEXPR_(expr) ? (expr) : (-1)) |
| 1899 | #else |
| 1900 | # if !defined(HEDLEY_IS_CONSTANT) |
| 1901 | # define HEDLEY_IS_CONSTANT(expr) (0) |
| 1902 | # endif |
| 1903 | # define HEDLEY_REQUIRE_CONSTEXPR(expr) (expr) |
| 1904 | #endif |
| 1905 | |
| 1906 | #if defined(HEDLEY_BEGIN_C_DECLS) |
| 1907 | # undef HEDLEY_BEGIN_C_DECLS |
| 1908 | #endif |
| 1909 | #if defined(HEDLEY_END_C_DECLS) |
| 1910 | # undef HEDLEY_END_C_DECLS |
| 1911 | #endif |
| 1912 | #if defined(HEDLEY_C_DECL) |
| 1913 | # undef HEDLEY_C_DECL |
| 1914 | #endif |
| 1915 | #if defined(__cplusplus) |
| 1916 | # define HEDLEY_BEGIN_C_DECLS extern "C" { |
| 1917 | # define HEDLEY_END_C_DECLS } |
| 1918 | # define HEDLEY_C_DECL extern "C" |
| 1919 | #else |
| 1920 | # define HEDLEY_BEGIN_C_DECLS |
| 1921 | # define HEDLEY_END_C_DECLS |
| 1922 | # define HEDLEY_C_DECL |
| 1923 | #endif |
| 1924 | |
| 1925 | #if defined(HEDLEY_STATIC_ASSERT) |
| 1926 | # undef HEDLEY_STATIC_ASSERT |
| 1927 | #endif |
| 1928 | #if \ |
| 1929 | !defined(__cplusplus) && ( \ |
| 1930 | (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)) || \ |
| 1931 | (HEDLEY_HAS_FEATURE(c_static_assert) && !defined(HEDLEY_INTEL_CL_VERSION)) || \ |
| 1932 | HEDLEY_GCC_VERSION_CHECK(6,0,0) || \ |
| 1933 | HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ |
| 1934 | defined(_Static_assert) \ |
| 1935 | ) |
| 1936 | # define HEDLEY_STATIC_ASSERT(expr, message) _Static_assert(expr, message) |
| 1937 | #elif \ |
| 1938 | (defined(__cplusplus) && (__cplusplus >= 201103L)) || \ |
| 1939 | HEDLEY_MSVC_VERSION_CHECK(16,0,0) || \ |
| 1940 | HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) |
| 1941 | # define HEDLEY_STATIC_ASSERT(expr, message) HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(static_assert(expr, message)) |
| 1942 | #else |
| 1943 | # define HEDLEY_STATIC_ASSERT(expr, message) |
| 1944 | #endif |
| 1945 | |
| 1946 | #if defined(HEDLEY_NULL) |
| 1947 | # undef HEDLEY_NULL |
| 1948 | #endif |
| 1949 | #if defined(__cplusplus) |
| 1950 | # if __cplusplus >= 201103L |
| 1951 | # define HEDLEY_NULL HEDLEY_DIAGNOSTIC_DISABLE_CPP98_COMPAT_WRAP_(nullptr) |
| 1952 | # elif defined(NULL) |
| 1953 | # define HEDLEY_NULL NULL |
| 1954 | # else |
| 1955 | # define HEDLEY_NULL HEDLEY_STATIC_CAST(void*, 0) |
| 1956 | # endif |
| 1957 | #elif defined(NULL) |
| 1958 | # define HEDLEY_NULL NULL |
| 1959 | #else |
| 1960 | # define HEDLEY_NULL ((void*) 0) |
| 1961 | #endif |
| 1962 | |
| 1963 | #if defined(HEDLEY_MESSAGE) |
| 1964 | # undef HEDLEY_MESSAGE |
| 1965 | #endif |
| 1966 | #if HEDLEY_HAS_WARNING("-Wunknown-pragmas") |
| 1967 | # define HEDLEY_MESSAGE(msg) \ |
| 1968 | HEDLEY_DIAGNOSTIC_PUSH \ |
| 1969 | HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \ |
| 1970 | HEDLEY_PRAGMA(message msg) \ |
| 1971 | HEDLEY_DIAGNOSTIC_POP |
| 1972 | #elif \ |
| 1973 | HEDLEY_GCC_VERSION_CHECK(4,4,0) || \ |
| 1974 | HEDLEY_INTEL_VERSION_CHECK(13,0,0) |
| 1975 | # define HEDLEY_MESSAGE(msg) HEDLEY_PRAGMA(message msg) |
| 1976 | #elif HEDLEY_CRAY_VERSION_CHECK(5,0,0) |
| 1977 | # define HEDLEY_MESSAGE(msg) HEDLEY_PRAGMA(_CRI message msg) |
| 1978 | #elif HEDLEY_IAR_VERSION_CHECK(8,0,0) |
| 1979 | # define HEDLEY_MESSAGE(msg) HEDLEY_PRAGMA(message(msg)) |
| 1980 | #elif HEDLEY_PELLES_VERSION_CHECK(2,0,0) |
| 1981 | # define HEDLEY_MESSAGE(msg) HEDLEY_PRAGMA(message(msg)) |
| 1982 | #else |
| 1983 | # define HEDLEY_MESSAGE(msg) |
| 1984 | #endif |
| 1985 | |
| 1986 | #if defined(HEDLEY_WARNING) |
| 1987 | # undef HEDLEY_WARNING |
| 1988 | #endif |
| 1989 | #if HEDLEY_HAS_WARNING("-Wunknown-pragmas") |
| 1990 | # define HEDLEY_WARNING(msg) \ |
| 1991 | HEDLEY_DIAGNOSTIC_PUSH \ |
| 1992 | HEDLEY_DIAGNOSTIC_DISABLE_UNKNOWN_PRAGMAS \ |
| 1993 | HEDLEY_PRAGMA(clang warning msg) \ |
| 1994 | HEDLEY_DIAGNOSTIC_POP |
| 1995 | #elif \ |
| 1996 | HEDLEY_GCC_VERSION_CHECK(4,8,0) || \ |
| 1997 | HEDLEY_PGI_VERSION_CHECK(18,4,0) || \ |
| 1998 | HEDLEY_INTEL_VERSION_CHECK(13,0,0) |
| 1999 | # define HEDLEY_WARNING(msg) HEDLEY_PRAGMA(GCC warning msg) |
| 2000 | #elif \ |
| 2001 | HEDLEY_MSVC_VERSION_CHECK(15,0,0) || \ |
| 2002 | HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) |
| 2003 | # define HEDLEY_WARNING(msg) HEDLEY_PRAGMA(message(msg)) |
| 2004 | #else |
| 2005 | # define HEDLEY_WARNING(msg) HEDLEY_MESSAGE(msg) |
| 2006 | #endif |
| 2007 | |
| 2008 | #if defined(HEDLEY_REQUIRE) |
| 2009 | # undef HEDLEY_REQUIRE |
| 2010 | #endif |
| 2011 | #if defined(HEDLEY_REQUIRE_MSG) |
| 2012 | # undef HEDLEY_REQUIRE_MSG |
| 2013 | #endif |
| 2014 | #if HEDLEY_HAS_ATTRIBUTE(diagnose_if) |
| 2015 | # if HEDLEY_HAS_WARNING("-Wgcc-compat") |
| 2016 | # define HEDLEY_REQUIRE(expr) \ |
| 2017 | HEDLEY_DIAGNOSTIC_PUSH \ |
| 2018 | _Pragma("clang diagnostic ignored \"-Wgcc-compat\"") \ |
| 2019 | __attribute__((diagnose_if(!(expr), #expr, "error"))) \ |
| 2020 | HEDLEY_DIAGNOSTIC_POP |
| 2021 | # define HEDLEY_REQUIRE_MSG(expr,msg) \ |
| 2022 | HEDLEY_DIAGNOSTIC_PUSH \ |
| 2023 | _Pragma("clang diagnostic ignored \"-Wgcc-compat\"") \ |
| 2024 | __attribute__((diagnose_if(!(expr), msg, "error"))) \ |
| 2025 | HEDLEY_DIAGNOSTIC_POP |
| 2026 | # else |
| 2027 | # define HEDLEY_REQUIRE(expr) __attribute__((diagnose_if(!(expr), #expr, "error"))) |
| 2028 | # define HEDLEY_REQUIRE_MSG(expr,msg) __attribute__((diagnose_if(!(expr), msg, "error"))) |
| 2029 | # endif |
| 2030 | #else |
| 2031 | # define HEDLEY_REQUIRE(expr) |
| 2032 | # define HEDLEY_REQUIRE_MSG(expr,msg) |
| 2033 | #endif |
| 2034 | |
| 2035 | #if defined(HEDLEY_FLAGS) |
| 2036 | # undef HEDLEY_FLAGS |
| 2037 | #endif |
| 2038 | #if HEDLEY_HAS_ATTRIBUTE(flag_enum) && (!defined(__cplusplus) || HEDLEY_HAS_WARNING("-Wbitfield-enum-conversion")) |
| 2039 | # define HEDLEY_FLAGS __attribute__((__flag_enum__)) |
| 2040 | #else |
| 2041 | # define HEDLEY_FLAGS |
| 2042 | #endif |
| 2043 | |
| 2044 | #if defined(HEDLEY_FLAGS_CAST) |
| 2045 | # undef HEDLEY_FLAGS_CAST |
| 2046 | #endif |
| 2047 | #if HEDLEY_INTEL_VERSION_CHECK(19,0,0) |
| 2048 | # define HEDLEY_FLAGS_CAST(T, expr) (__extension__ ({ \ |
| 2049 | HEDLEY_DIAGNOSTIC_PUSH \ |
| 2050 | _Pragma("warning(disable:188)") \ |
| 2051 | ((T) (expr)); \ |
| 2052 | HEDLEY_DIAGNOSTIC_POP \ |
| 2053 | })) |
| 2054 | #else |
| 2055 | # define HEDLEY_FLAGS_CAST(T, expr) HEDLEY_STATIC_CAST(T, expr) |
| 2056 | #endif |
| 2057 | |
| 2058 | #if defined(HEDLEY_EMPTY_BASES) |
| 2059 | # undef HEDLEY_EMPTY_BASES |
| 2060 | #endif |
| 2061 | #if \ |
| 2062 | (HEDLEY_MSVC_VERSION_CHECK(19,0,23918) && !HEDLEY_MSVC_VERSION_CHECK(20,0,0)) || \ |
| 2063 | HEDLEY_INTEL_CL_VERSION_CHECK(2021,1,0) |
| 2064 | # define HEDLEY_EMPTY_BASES __declspec(empty_bases) |
| 2065 | #else |
| 2066 | # define HEDLEY_EMPTY_BASES |
| 2067 | #endif |
| 2068 | |
| 2069 | /* Remaining macros are deprecated. */ |
| 2070 | |
| 2071 | #if defined(HEDLEY_GCC_NOT_CLANG_VERSION_CHECK) |
| 2072 | # undef HEDLEY_GCC_NOT_CLANG_VERSION_CHECK |
| 2073 | #endif |
| 2074 | #if defined(__clang__) |
| 2075 | # define HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major,minor,patch) (0) |
| 2076 | #else |
| 2077 | # define HEDLEY_GCC_NOT_CLANG_VERSION_CHECK(major,minor,patch) HEDLEY_GCC_VERSION_CHECK(major,minor,patch) |
| 2078 | #endif |
| 2079 | |
| 2080 | #if defined(HEDLEY_CLANG_HAS_ATTRIBUTE) |
| 2081 | # undef HEDLEY_CLANG_HAS_ATTRIBUTE |
| 2082 | #endif |
| 2083 | #define HEDLEY_CLANG_HAS_ATTRIBUTE(attribute) HEDLEY_HAS_ATTRIBUTE(attribute) |
| 2084 | |
| 2085 | #if defined(HEDLEY_CLANG_HAS_CPP_ATTRIBUTE) |
| 2086 | # undef HEDLEY_CLANG_HAS_CPP_ATTRIBUTE |
| 2087 | #endif |
| 2088 | #define HEDLEY_CLANG_HAS_CPP_ATTRIBUTE(attribute) HEDLEY_HAS_CPP_ATTRIBUTE(attribute) |
| 2089 | |
| 2090 | #if defined(HEDLEY_CLANG_HAS_BUILTIN) |
| 2091 | # undef HEDLEY_CLANG_HAS_BUILTIN |
| 2092 | #endif |
| 2093 | #define HEDLEY_CLANG_HAS_BUILTIN(builtin) HEDLEY_HAS_BUILTIN(builtin) |
| 2094 | |
| 2095 | #if defined(HEDLEY_CLANG_HAS_FEATURE) |
| 2096 | # undef HEDLEY_CLANG_HAS_FEATURE |
| 2097 | #endif |
| 2098 | #define HEDLEY_CLANG_HAS_FEATURE(feature) HEDLEY_HAS_FEATURE(feature) |
| 2099 | |
| 2100 | #if defined(HEDLEY_CLANG_HAS_EXTENSION) |
| 2101 | # undef HEDLEY_CLANG_HAS_EXTENSION |
| 2102 | #endif |
| 2103 | #define HEDLEY_CLANG_HAS_EXTENSION(extension) HEDLEY_HAS_EXTENSION(extension) |
| 2104 | |
| 2105 | #if defined(HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE) |
| 2106 | # undef HEDLEY_CLANG_HAS_DECLSPEC_DECLSPEC_ATTRIBUTE |
| 2107 | #endif |
| 2108 | #define HEDLEY_CLANG_HAS_DECLSPEC_ATTRIBUTE(attribute) HEDLEY_HAS_DECLSPEC_ATTRIBUTE(attribute) |
| 2109 | |
| 2110 | #if defined(HEDLEY_CLANG_HAS_WARNING) |
| 2111 | # undef HEDLEY_CLANG_HAS_WARNING |
| 2112 | #endif |
| 2113 | #define HEDLEY_CLANG_HAS_WARNING(warning) HEDLEY_HAS_WARNING(warning) |
| 2114 | |
| 2115 | #endif /* !defined(HEDLEY_VERSION) || (HEDLEY_VERSION < X) */ |
| 2116 | /* :: End simde/hedley.h :: */ |
| 2117 | |
| 2118 | #define SIMDE_VERSION_MAJOR 0 |
| 2119 | #define SIMDE_VERSION_MINOR 8 |
| 2120 | #define SIMDE_VERSION_MICRO 2 |
| 2121 | #define SIMDE_VERSION HEDLEY_VERSION_ENCODE(SIMDE_VERSION_MAJOR, SIMDE_VERSION_MINOR, SIMDE_VERSION_MICRO) |
| 2122 | // Also update meson.build in the root directory of the repository |
| 2123 | |
| 2124 | #include <stddef.h> |
| 2125 | #include <stdint.h> |
| 2126 | |
| 2127 | /* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */ |
| 2128 | /* 71fd833d9666141edcd1d3c109a80e228303d8d7 */ |
| 2129 | /* :: Begin simde/simde-detect-clang.h :: */ |
| 2130 | /* Detect Clang Version |
| 2131 | * Created by Evan Nemerson <evan@nemerson.com> |
| 2132 | * |
| 2133 | * To the extent possible under law, the author(s) have dedicated all |
| 2134 | * copyright and related and neighboring rights to this software to |
| 2135 | * the public domain worldwide. This software is distributed without |
| 2136 | * any warranty. |
| 2137 | * |
| 2138 | * For details, see <http://creativecommons.org/publicdomain/zero/1.0/>. |
| 2139 | * SPDX-License-Identifier: CC0-1.0 |
| 2140 | */ |
| 2141 | |
| 2142 | /* This file was originally part of SIMDe |
| 2143 | * (<https://github.com/simd-everywhere/simde>). You're free to do with it as |
| 2144 | * you please, but I do have a few small requests: |
| 2145 | * |
| 2146 | * * If you make improvements, please submit them back to SIMDe |
| 2147 | * (at <https://github.com/simd-everywhere/simde/issues>) so others can |
| 2148 | * benefit from them. |
| 2149 | * * Please keep a link to SIMDe intact so people know where to submit |
| 2150 | * improvements. |
| 2151 | * * If you expose it publicly, please change the SIMDE_ prefix to |
| 2152 | * something specific to your project. |
| 2153 | * |
| 2154 | * The version numbers clang exposes (in the ___clang_major__, |
| 2155 | * __clang_minor__, and __clang_patchlevel__ macros) are unreliable. |
| 2156 | * Vendors such as Apple will define these values to their version |
| 2157 | * numbers; for example, "Apple Clang 4.0" is really clang 3.1, but |
| 2158 | * __clang_major__ and __clang_minor__ are defined to 4 and 0 |
| 2159 | * respectively, instead of 3 and 1. |
| 2160 | * |
| 2161 | * The solution is *usually* to use clang's feature detection macros |
| 2162 | * (<https://clang.llvm.org/docs/LanguageExtensions.html#feature-checking-macros>) |
| 2163 | * to determine if the feature you're interested in is available. This |
| 2164 | * generally works well, and it should probably be the first thing you |
| 2165 | * try. Unfortunately, it's not possible to check for everything. In |
| 2166 | * particular, compiler bugs. |
| 2167 | * |
| 2168 | * This file just uses the feature checking macros to detect features |
| 2169 | * added in specific versions of clang to identify which version of |
| 2170 | * clang the compiler is based on. |
| 2171 | * |
| 2172 | * Right now it only goes back to 3.6, but I'm happy to accept patches |
| 2173 | * to go back further. And, of course, newer versions are welcome if |
| 2174 | * they're not already present, and if you find a way to detect a point |
| 2175 | * release that would be great, too! |
| 2176 | */ |
| 2177 | |
| 2178 | #if !defined(SIMDE_DETECT_CLANG_H) |
| 2179 | #define SIMDE_DETECT_CLANG_H 1 |
| 2180 | |
| 2181 | /* Attempt to detect the upstream clang version number. I usually only |
| 2182 | * worry about major version numbers (at least for 4.0+), but if you |
| 2183 | * need more resolution I'm happy to accept patches that are able to |
| 2184 | * detect minor versions as well. That said, you'll probably have a |
| 2185 | * hard time with detection since AFAIK most minor releases don't add |
| 2186 | * anything we can detect. Updated based on |
| 2187 | * https://github.com/google/highway/blob/438c705a295176b96a50336527bb3e7ea365ffac/hwy/detect_compiler_arch.h#L73 |
| 2188 | * - would welcome patches/updates there as well. |
| 2189 | */ |
| 2190 | |
| 2191 | #if defined(__clang__) && !defined(SIMDE_DETECT_CLANG_VERSION) |
| 2192 | # if __has_warning("-Wmissing-designated-field-initializers") |
| 2193 | # define SIMDE_DETECT_CLANG_VERSION 190000 |
| 2194 | # elif __has_warning("-Woverriding-option") |
| 2195 | # define SIMDE_DETECT_CLANG_VERSION 180000 |
| 2196 | # elif __has_attribute(unsafe_buffer_usage) // no new warnings in 17.0 |
| 2197 | # define SIMDE_DETECT_CLANG_VERSION 170000 |
| 2198 | # elif __has_attribute(nouwtable) // no new warnings in 16.0 |
| 2199 | # define SIMDE_DETECT_CLANG_VERSION 160000 |
| 2200 | # elif __has_warning("-Warray-parameter") |
| 2201 | # define SIMDE_DETECT_CLANG_VERSION 150000 |
| 2202 | # elif __has_warning("-Wbitwise-instead-of-logical") |
| 2203 | # define SIMDE_DETECT_CLANG_VERSION 140000 |
| 2204 | # elif __has_warning("-Waix-compat") |
| 2205 | # define SIMDE_DETECT_CLANG_VERSION 130000 |
| 2206 | # elif __has_warning("-Wformat-insufficient-args") |
| 2207 | # define SIMDE_DETECT_CLANG_VERSION 120000 |
| 2208 | # elif __has_warning("-Wimplicit-const-int-float-conversion") |
| 2209 | # define SIMDE_DETECT_CLANG_VERSION 110000 |
| 2210 | # elif __has_warning("-Wmisleading-indentation") |
| 2211 | # define SIMDE_DETECT_CLANG_VERSION 100000 |
| 2212 | # elif defined(__FILE_NAME__) |
| 2213 | # define SIMDE_DETECT_CLANG_VERSION 90000 |
| 2214 | # elif __has_warning("-Wextra-semi-stmt") || __has_builtin(__builtin_rotateleft32) |
| 2215 | # define SIMDE_DETECT_CLANG_VERSION 80000 |
| 2216 | // For reasons unknown, Xcode 10.3 (Apple LLVM version 10.0.1) is apparently |
| 2217 | // based on Clang 7, but does not support the warning we test. |
| 2218 | // See https://en.wikipedia.org/wiki/Xcode#Toolchain_versions and |
| 2219 | // https://trac.macports.org/wiki/XcodeVersionInfo. |
| 2220 | # elif __has_warning("-Wc++98-compat-extra-semi") || \ |
| 2221 | (defined(__apple_build_version__) && __apple_build_version__ >= 10010000) |
| 2222 | # define SIMDE_DETECT_CLANG_VERSION 70000 |
| 2223 | # elif __has_warning("-Wpragma-pack") |
| 2224 | # define SIMDE_DETECT_CLANG_VERSION 60000 |
| 2225 | # elif __has_warning("-Wbitfield-enum-conversion") |
| 2226 | # define SIMDE_DETECT_CLANG_VERSION 50000 |
| 2227 | # elif __has_attribute(diagnose_if) |
| 2228 | # define SIMDE_DETECT_CLANG_VERSION 40000 |
| 2229 | # elif __has_warning("-Wcomma") |
| 2230 | # define SIMDE_DETECT_CLANG_VERSION 39000 |
| 2231 | # elif __has_warning("-Wdouble-promotion") |
| 2232 | # define SIMDE_DETECT_CLANG_VERSION 38000 |
| 2233 | # elif __has_warning("-Wshift-negative-value") |
| 2234 | # define SIMDE_DETECT_CLANG_VERSION 37000 |
| 2235 | # elif __has_warning("-Wambiguous-ellipsis") |
| 2236 | # define SIMDE_DETECT_CLANG_VERSION 36000 |
| 2237 | # else |
| 2238 | # define SIMDE_DETECT_CLANG_VERSION 1 |
| 2239 | # endif |
| 2240 | #endif /* defined(__clang__) && !defined(SIMDE_DETECT_CLANG_VERSION) */ |
| 2241 | |
| 2242 | /* The SIMDE_DETECT_CLANG_VERSION_CHECK macro is pretty |
| 2243 | * straightforward; it returns true if the compiler is a derivative |
| 2244 | * of clang >= the specified version. |
| 2245 | * |
| 2246 | * Since this file is often (primarily?) useful for working around bugs |
| 2247 | * it is also helpful to have a macro which returns true if only if the |
| 2248 | * compiler is a version of clang *older* than the specified version to |
| 2249 | * make it a bit easier to ifdef regions to add code for older versions, |
| 2250 | * such as pragmas to disable a specific warning. */ |
| 2251 | |
| 2252 | #if defined(SIMDE_DETECT_CLANG_VERSION) |
| 2253 | # define SIMDE_DETECT_CLANG_VERSION_CHECK(major, minor, revision) (SIMDE_DETECT_CLANG_VERSION >= ((major * 10000) + (minor * 1000) + (revision))) |
| 2254 | # define SIMDE_DETECT_CLANG_VERSION_NOT(major, minor, revision) (SIMDE_DETECT_CLANG_VERSION < ((major * 10000) + (minor * 1000) + (revision))) |
| 2255 | #else |
| 2256 | # define SIMDE_DETECT_CLANG_VERSION_CHECK(major, minor, revision) (0) |
| 2257 | # define SIMDE_DETECT_CLANG_VERSION_NOT(major, minor, revision) (0) |
| 2258 | #endif |
| 2259 | |
| 2260 | #endif /* !defined(SIMDE_DETECT_CLANG_H) */ |
| 2261 | /* :: End simde/simde-detect-clang.h :: */ |
| 2262 | /* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */ |
| 2263 | /* 71fd833d9666141edcd1d3c109a80e228303d8d7 */ |
| 2264 | /* :: Begin simde/simde-arch.h :: */ |
| 2265 | /* Architecture detection |
| 2266 | * Created by Evan Nemerson <evan@nemerson.com> |
| 2267 | * |
| 2268 | * To the extent possible under law, the authors have waived all |
| 2269 | * copyright and related or neighboring rights to this code. For |
| 2270 | * details, see the Creative Commons Zero 1.0 Universal license at |
| 2271 | * <https://creativecommons.org/publicdomain/zero/1.0/> |
| 2272 | * |
| 2273 | * SPDX-License-Identifier: CC0-1.0 |
| 2274 | * |
| 2275 | * Different compilers define different preprocessor macros for the |
| 2276 | * same architecture. This is an attempt to provide a single |
| 2277 | * interface which is usable on any compiler. |
| 2278 | * |
| 2279 | * In general, a macro named SIMDE_ARCH_* is defined for each |
| 2280 | * architecture the CPU supports. When there are multiple possible |
| 2281 | * versions, we try to define the macro to the target version. For |
| 2282 | * example, if you want to check for i586+, you could do something |
| 2283 | * like: |
| 2284 | * |
| 2285 | * #if defined(SIMDE_ARCH_X86) && (SIMDE_ARCH_X86 >= 5) |
| 2286 | * ... |
| 2287 | * #endif |
| 2288 | * |
| 2289 | * You could also just check that SIMDE_ARCH_X86 >= 5 without checking |
| 2290 | * if it's defined first, but some compilers may emit a warning about |
| 2291 | * an undefined macro being used (e.g., GCC with -Wundef). |
| 2292 | * |
| 2293 | * This was originally created for SIMDe |
| 2294 | * <https://github.com/simd-everywhere/simde> (hence the prefix), but this |
| 2295 | * header has no dependencies and may be used anywhere. It is |
| 2296 | * originally based on information from |
| 2297 | * <https://sourceforge.net/p/predef/wiki/Architectures/>, though it |
| 2298 | * has been enhanced with additional information. |
| 2299 | * |
| 2300 | * If you improve this file, or find a bug, please file the issue at |
| 2301 | * <https://github.com/simd-everywhere/simde/issues>. If you copy this into |
| 2302 | * your project, even if you change the prefix, please keep the links |
| 2303 | * to SIMDe intact so others know where to report issues, submit |
| 2304 | * enhancements, and find the latest version. */ |
| 2305 | |
| 2306 | #if !defined(SIMDE_ARCH_H) |
| 2307 | #define SIMDE_ARCH_H |
| 2308 | |
| 2309 | /* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */ |
| 2310 | /* 71fd833d9666141edcd1d3c109a80e228303d8d7 */ |
| 2311 | |
| 2312 | /* Alpha |
| 2313 | <https://en.wikipedia.org/wiki/DEC_Alpha> */ |
| 2314 | #if defined(__alpha__) || defined(__alpha) || defined(_M_ALPHA) |
| 2315 | # if defined(__alpha_ev6__) |
| 2316 | # define SIMDE_ARCH_ALPHA 6 |
| 2317 | # elif defined(__alpha_ev5__) |
| 2318 | # define SIMDE_ARCH_ALPHA 5 |
| 2319 | # elif defined(__alpha_ev4__) |
| 2320 | # define SIMDE_ARCH_ALPHA 4 |
| 2321 | # else |
| 2322 | # define SIMDE_ARCH_ALPHA 1 |
| 2323 | # endif |
| 2324 | #endif |
| 2325 | #if defined(SIMDE_ARCH_ALPHA) |
| 2326 | # define SIMDE_ARCH_ALPHA_CHECK(version) ((version) <= SIMDE_ARCH_ALPHA) |
| 2327 | #else |
| 2328 | # define SIMDE_ARCH_ALPHA_CHECK(version) (0) |
| 2329 | #endif |
| 2330 | |
| 2331 | /* Atmel AVR |
| 2332 | <https://en.wikipedia.org/wiki/Atmel_AVR> */ |
| 2333 | #if defined(__AVR_ARCH__) |
| 2334 | # define SIMDE_ARCH_AVR __AVR_ARCH__ |
| 2335 | #endif |
| 2336 | |
| 2337 | /* AMD64 / x86_64 |
| 2338 | <https://en.wikipedia.org/wiki/X86-64> */ |
| 2339 | #if defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || defined(__x86_64) || defined(_M_X64) || defined(_M_AMD64) |
| 2340 | # if !defined(_M_ARM64EC) |
| 2341 | # define SIMDE_ARCH_AMD64 1000 |
| 2342 | # endif |
| 2343 | #endif |
| 2344 | |
| 2345 | /* ARM |
| 2346 | <https://en.wikipedia.org/wiki/ARM_architecture> */ |
| 2347 | #if defined(__ARM_ARCH) |
| 2348 | # if __ARM_ARCH > 100 |
| 2349 | # define SIMDE_ARCH_ARM (__ARM_ARCH) |
| 2350 | # else |
| 2351 | # define SIMDE_ARCH_ARM (__ARM_ARCH * 100) |
| 2352 | # endif |
| 2353 | #elif defined(_M_ARM) |
| 2354 | # if _M_ARM > 100 |
| 2355 | # define SIMDE_ARCH_ARM (_M_ARM) |
| 2356 | # else |
| 2357 | # define SIMDE_ARCH_ARM (_M_ARM * 100) |
| 2358 | # endif |
| 2359 | #elif defined(_M_ARM64) || defined(_M_ARM64EC) |
| 2360 | # define SIMDE_ARCH_ARM 800 |
| 2361 | #elif defined(__arm__) || defined(__thumb__) || defined(__TARGET_ARCH_ARM) || defined(_ARM) || defined(_M_ARM) || defined(_M_ARM) |
| 2362 | # define SIMDE_ARCH_ARM 1 |
| 2363 | #endif |
| 2364 | #if defined(SIMDE_ARCH_ARM) |
| 2365 | # define SIMDE_ARCH_ARM_CHECK(major, minor) (((major * 100) + (minor)) <= SIMDE_ARCH_ARM) |
| 2366 | #else |
| 2367 | # define SIMDE_ARCH_ARM_CHECK(major, minor) (0) |
| 2368 | #endif |
| 2369 | |
| 2370 | /* AArch64 |
| 2371 | <https://en.wikipedia.org/wiki/ARM_architecture> */ |
| 2372 | #if defined(__aarch64__) || defined(_M_ARM64) || defined(_M_ARM64EC) |
| 2373 | # define SIMDE_ARCH_AARCH64 1000 |
| 2374 | #endif |
| 2375 | #if defined(SIMDE_ARCH_AARCH64) |
| 2376 | # define SIMDE_ARCH_AARCH64_CHECK(version) ((version) <= SIMDE_ARCH_AARCH64) |
| 2377 | #else |
| 2378 | # define SIMDE_ARCH_AARCH64_CHECK(version) (0) |
| 2379 | #endif |
| 2380 | |
| 2381 | /* ARM SIMD ISA extensions */ |
| 2382 | #if defined(__ARM_NEON) || defined(SIMDE_ARCH_AARCH64) |
| 2383 | # if defined(SIMDE_ARCH_AARCH64) |
| 2384 | # define SIMDE_ARCH_ARM_NEON SIMDE_ARCH_AARCH64 |
| 2385 | # elif defined(SIMDE_ARCH_ARM) |
| 2386 | # define SIMDE_ARCH_ARM_NEON SIMDE_ARCH_ARM |
| 2387 | # endif |
| 2388 | #endif |
| 2389 | #if defined(__ARM_FEATURE_AES) && __ARM_FEATURE_AES |
| 2390 | # define SIMDE_ARCH_ARM_AES |
| 2391 | #endif |
| 2392 | #if defined(__ARM_FEATURE_COMPLEX) && __ARM_FEATURE_COMPLEX |
| 2393 | # define SIMDE_ARCH_ARM_COMPLEX |
| 2394 | #endif |
| 2395 | #if defined(__ARM_FEATURE_CRYPTO) && __ARM_FEATURE_CRYPTO |
| 2396 | # define SIMDE_ARCH_ARM_CRYPTO |
| 2397 | #endif |
| 2398 | #if defined(__ARM_FEATURE_DOTPROD) && __ARM_FEATURE_DOTPROD |
| 2399 | # define SIMDE_ARCH_ARM_DOTPROD |
| 2400 | #endif |
| 2401 | #if defined(__ARM_FEATURE_FMA) && __ARM_FEATURE_FMA |
| 2402 | # define SIMDE_ARCH_ARM_FMA |
| 2403 | #endif |
| 2404 | #if defined(__ARM_FEATURE_FP16_FML) && __ARM_FEATURE_FP16_FML |
| 2405 | # define SIMDE_ARCH_ARM_FP16_FML |
| 2406 | #endif |
| 2407 | #if defined(__ARM_FEATURE_FRINT) && __ARM_FEATURE_FRINT |
| 2408 | # define SIMDE_ARCH_ARM_FRINT |
| 2409 | #endif |
| 2410 | #if defined(__ARM_FEATURE_MATMUL_INT8) && __ARM_FEATURE_MATMUL_INT8 |
| 2411 | # define SIMDE_ARCH_ARM_MATMUL_INT8 |
| 2412 | #endif |
| 2413 | #if defined(__ARM_FEATURE_SHA2) && __ARM_FEATURE_SHA2 && !defined(__APPLE_CC__) |
| 2414 | # define SIMDE_ARCH_ARM_SHA2 |
| 2415 | #endif |
| 2416 | #if defined(__ARM_FEATURE_SHA3) && __ARM_FEATURE_SHA3 |
| 2417 | # define SIMDE_ARCH_ARM_SHA3 |
| 2418 | #endif |
| 2419 | #if defined(__ARM_FEATURE_SHA512) && __ARM_FEATURE_SHA512 |
| 2420 | # define SIMDE_ARCH_ARM_SHA512 |
| 2421 | #endif |
| 2422 | #if defined(__ARM_FEATURE_SM3) && __ARM_FEATURE_SM3 |
| 2423 | # define SIMDE_ARCH_ARM_SM3 |
| 2424 | #endif |
| 2425 | #if defined(__ARM_FEATURE_SM4) && __ARM_FEATURE_SM4 |
| 2426 | # define SIMDE_ARCH_ARM_SM4 |
| 2427 | #endif |
| 2428 | #if defined(__ARM_FEATURE_SVE) && __ARM_FEATURE_SVE |
| 2429 | # define SIMDE_ARCH_ARM_SVE |
| 2430 | #endif |
| 2431 | #if defined(__ARM_FEATURE_QRDMX) && __ARM_FEATURE_QRDMX |
| 2432 | # define SIMDE_ARCH_ARM_QRDMX |
| 2433 | #endif |
| 2434 | |
| 2435 | /* Blackfin |
| 2436 | <https://en.wikipedia.org/wiki/Blackfin> */ |
| 2437 | #if defined(__bfin) || defined(__BFIN__) || defined(__bfin__) |
| 2438 | # define SIMDE_ARCH_BLACKFIN 1 |
| 2439 | #endif |
| 2440 | |
| 2441 | /* CRIS |
| 2442 | <https://en.wikipedia.org/wiki/ETRAX_CRIS> */ |
| 2443 | #if defined(__CRIS_arch_version) |
| 2444 | # define SIMDE_ARCH_CRIS __CRIS_arch_version |
| 2445 | #elif defined(__cris__) || defined(__cris) || defined(__CRIS) || defined(__CRIS__) |
| 2446 | # define SIMDE_ARCH_CRIS 1 |
| 2447 | #endif |
| 2448 | |
| 2449 | /* Convex |
| 2450 | <https://en.wikipedia.org/wiki/Convex_Computer> */ |
| 2451 | #if defined(__convex_c38__) |
| 2452 | # define SIMDE_ARCH_CONVEX 38 |
| 2453 | #elif defined(__convex_c34__) |
| 2454 | # define SIMDE_ARCH_CONVEX 34 |
| 2455 | #elif defined(__convex_c32__) |
| 2456 | # define SIMDE_ARCH_CONVEX 32 |
| 2457 | #elif defined(__convex_c2__) |
| 2458 | # define SIMDE_ARCH_CONVEX 2 |
| 2459 | #elif defined(__convex__) |
| 2460 | # define SIMDE_ARCH_CONVEX 1 |
| 2461 | #endif |
| 2462 | #if defined(SIMDE_ARCH_CONVEX) |
| 2463 | # define SIMDE_ARCH_CONVEX_CHECK(version) ((version) <= SIMDE_ARCH_CONVEX) |
| 2464 | #else |
| 2465 | # define SIMDE_ARCH_CONVEX_CHECK(version) (0) |
| 2466 | #endif |
| 2467 | |
| 2468 | /* Adapteva Epiphany |
| 2469 | <https://en.wikipedia.org/wiki/Adapteva_Epiphany> */ |
| 2470 | #if defined(__epiphany__) |
| 2471 | # define SIMDE_ARCH_EPIPHANY 1 |
| 2472 | #endif |
| 2473 | |
| 2474 | /* Fujitsu FR-V |
| 2475 | <https://en.wikipedia.org/wiki/FR-V_(microprocessor)> */ |
| 2476 | #if defined(__frv__) |
| 2477 | # define SIMDE_ARCH_FRV 1 |
| 2478 | #endif |
| 2479 | |
| 2480 | /* H8/300 |
| 2481 | <https://en.wikipedia.org/wiki/H8_Family> */ |
| 2482 | #if defined(__H8300__) |
| 2483 | # define SIMDE_ARCH_H8300 |
| 2484 | #endif |
| 2485 | |
| 2486 | /* Elbrus (8S, 8SV and successors) |
| 2487 | <https://en.wikipedia.org/wiki/Elbrus-8S> */ |
| 2488 | #if defined(__e2k__) |
| 2489 | # define SIMDE_ARCH_E2K |
| 2490 | #endif |
| 2491 | |
| 2492 | /* HP/PA / PA-RISC |
| 2493 | <https://en.wikipedia.org/wiki/PA-RISC> */ |
| 2494 | #if defined(__PA8000__) || defined(__HPPA20__) || defined(__RISC2_0__) || defined(_PA_RISC2_0) |
| 2495 | # define SIMDE_ARCH_HPPA 20 |
| 2496 | #elif defined(__PA7100__) || defined(__HPPA11__) || defined(_PA_RISC1_1) |
| 2497 | # define SIMDE_ARCH_HPPA 11 |
| 2498 | #elif defined(_PA_RISC1_0) |
| 2499 | # define SIMDE_ARCH_HPPA 10 |
| 2500 | #elif defined(__hppa__) || defined(__HPPA__) || defined(__hppa) |
| 2501 | # define SIMDE_ARCH_HPPA 1 |
| 2502 | #endif |
| 2503 | #if defined(SIMDE_ARCH_HPPA) |
| 2504 | # define SIMDE_ARCH_HPPA_CHECK(version) ((version) <= SIMDE_ARCH_HPPA) |
| 2505 | #else |
| 2506 | # define SIMDE_ARCH_HPPA_CHECK(version) (0) |
| 2507 | #endif |
| 2508 | |
| 2509 | /* x86 |
| 2510 | <https://en.wikipedia.org/wiki/X86> */ |
| 2511 | #if defined(_M_IX86) |
| 2512 | # define SIMDE_ARCH_X86 (_M_IX86 / 100) |
| 2513 | #elif defined(__I86__) |
| 2514 | # define SIMDE_ARCH_X86 __I86__ |
| 2515 | #elif defined(i686) || defined(__i686) || defined(__i686__) |
| 2516 | # define SIMDE_ARCH_X86 6 |
| 2517 | #elif defined(i586) || defined(__i586) || defined(__i586__) |
| 2518 | # define SIMDE_ARCH_X86 5 |
| 2519 | #elif defined(i486) || defined(__i486) || defined(__i486__) |
| 2520 | # define SIMDE_ARCH_X86 4 |
| 2521 | #elif defined(i386) || defined(__i386) || defined(__i386__) |
| 2522 | # define SIMDE_ARCH_X86 3 |
| 2523 | #elif defined(_X86_) || defined(__X86__) || defined(__THW_INTEL__) |
| 2524 | # define SIMDE_ARCH_X86 3 |
| 2525 | #endif |
| 2526 | #if defined(SIMDE_ARCH_X86) |
| 2527 | # define SIMDE_ARCH_X86_CHECK(version) ((version) <= SIMDE_ARCH_X86) |
| 2528 | #else |
| 2529 | # define SIMDE_ARCH_X86_CHECK(version) (0) |
| 2530 | #endif |
| 2531 | |
| 2532 | /* SIMD ISA extensions for x86/x86_64 and Elbrus */ |
| 2533 | #if defined(SIMDE_ARCH_X86) || defined(SIMDE_ARCH_AMD64) || defined(SIMDE_ARCH_E2K) |
| 2534 | # if defined(_M_IX86_FP) |
| 2535 | # define SIMDE_ARCH_X86_MMX |
| 2536 | # if (_M_IX86_FP >= 1) |
| 2537 | # define SIMDE_ARCH_X86_SSE 1 |
| 2538 | # endif |
| 2539 | # if (_M_IX86_FP >= 2) |
| 2540 | # define SIMDE_ARCH_X86_SSE2 1 |
| 2541 | # endif |
| 2542 | # elif defined(_M_X64) |
| 2543 | # define SIMDE_ARCH_X86_SSE 1 |
| 2544 | # define SIMDE_ARCH_X86_SSE2 1 |
| 2545 | # else |
| 2546 | # if defined(__MMX__) |
| 2547 | # define SIMDE_ARCH_X86_MMX 1 |
| 2548 | # endif |
| 2549 | # if defined(__SSE__) |
| 2550 | # define SIMDE_ARCH_X86_SSE 1 |
| 2551 | # endif |
| 2552 | # if defined(__SSE2__) |
| 2553 | # define SIMDE_ARCH_X86_SSE2 1 |
| 2554 | # endif |
| 2555 | # endif |
| 2556 | # if defined(__SSE3__) |
| 2557 | # define SIMDE_ARCH_X86_SSE3 1 |
| 2558 | # endif |
| 2559 | # if defined(__SSSE3__) |
| 2560 | # define SIMDE_ARCH_X86_SSSE3 1 |
| 2561 | # endif |
| 2562 | # if defined(__SSE4_1__) |
| 2563 | # define SIMDE_ARCH_X86_SSE4_1 1 |
| 2564 | # endif |
| 2565 | # if defined(__SSE4_2__) |
| 2566 | # define SIMDE_ARCH_X86_SSE4_2 1 |
| 2567 | # endif |
| 2568 | # if defined(__XOP__) |
| 2569 | # define SIMDE_ARCH_X86_XOP 1 |
| 2570 | # endif |
| 2571 | # if defined(__AVX__) |
| 2572 | # define SIMDE_ARCH_X86_AVX 1 |
| 2573 | # if !defined(SIMDE_ARCH_X86_SSE3) |
| 2574 | # define SIMDE_ARCH_X86_SSE3 1 |
| 2575 | # endif |
| 2576 | # if !defined(SIMDE_ARCH_X86_SSE4_1) |
| 2577 | # define SIMDE_ARCH_X86_SSE4_1 1 |
| 2578 | # endif |
| 2579 | # if !defined(SIMDE_ARCH_X86_SSE4_2) |
| 2580 | # define SIMDE_ARCH_X86_SSE4_2 1 |
| 2581 | # endif |
| 2582 | # endif |
| 2583 | # if defined(__AVX2__) |
| 2584 | # define SIMDE_ARCH_X86_AVX2 1 |
| 2585 | # if defined(_MSC_VER) |
| 2586 | # define SIMDE_ARCH_X86_FMA 1 |
| 2587 | # endif |
| 2588 | # endif |
| 2589 | # if defined(__FMA__) |
| 2590 | # define SIMDE_ARCH_X86_FMA 1 |
| 2591 | # if !defined(SIMDE_ARCH_X86_AVX) |
| 2592 | # define SIMDE_ARCH_X86_AVX 1 |
| 2593 | # endif |
| 2594 | # endif |
| 2595 | # if defined(__AVX512VP2INTERSECT__) |
| 2596 | # define SIMDE_ARCH_X86_AVX512VP2INTERSECT 1 |
| 2597 | # endif |
| 2598 | # if defined(__AVX512BITALG__) |
| 2599 | # define SIMDE_ARCH_X86_AVX512BITALG 1 |
| 2600 | # endif |
| 2601 | # if defined(__AVX512VPOPCNTDQ__) |
| 2602 | # define SIMDE_ARCH_X86_AVX512VPOPCNTDQ 1 |
| 2603 | # endif |
| 2604 | # if defined(__AVX512VBMI__) |
| 2605 | # define SIMDE_ARCH_X86_AVX512VBMI 1 |
| 2606 | # endif |
| 2607 | # if defined(__AVX512VBMI2__) |
| 2608 | # define SIMDE_ARCH_X86_AVX512VBMI2 1 |
| 2609 | # endif |
| 2610 | # if defined(__AVX512VNNI__) |
| 2611 | # define SIMDE_ARCH_X86_AVX512VNNI 1 |
| 2612 | # endif |
| 2613 | # if defined(__AVX5124VNNIW__) |
| 2614 | # define SIMDE_ARCH_X86_AVX5124VNNIW 1 |
| 2615 | # endif |
| 2616 | # if defined(__AVX512BW__) |
| 2617 | # define SIMDE_ARCH_X86_AVX512BW 1 |
| 2618 | # endif |
| 2619 | # if defined(__AVX512BF16__) |
| 2620 | # define SIMDE_ARCH_X86_AVX512BF16 1 |
| 2621 | # endif |
| 2622 | # if defined(__AVX512CD__) |
| 2623 | # define SIMDE_ARCH_X86_AVX512CD 1 |
| 2624 | # endif |
| 2625 | # if defined(__AVX512DQ__) |
| 2626 | # define SIMDE_ARCH_X86_AVX512DQ 1 |
| 2627 | # endif |
| 2628 | # if defined(__AVX512F__) |
| 2629 | # define SIMDE_ARCH_X86_AVX512F 1 |
| 2630 | # endif |
| 2631 | # if defined(__AVX512VL__) |
| 2632 | # define SIMDE_ARCH_X86_AVX512VL 1 |
| 2633 | # endif |
| 2634 | # if defined(__AVX512FP16__) |
| 2635 | # define SIMDE_ARCH_X86_AVX512FP16 1 |
| 2636 | # endif |
| 2637 | # if defined(__GFNI__) |
| 2638 | # define SIMDE_ARCH_X86_GFNI 1 |
| 2639 | # endif |
| 2640 | # if defined(__PCLMUL__) |
| 2641 | # define SIMDE_ARCH_X86_PCLMUL 1 |
| 2642 | # endif |
| 2643 | # if defined(__VPCLMULQDQ__) |
| 2644 | # define SIMDE_ARCH_X86_VPCLMULQDQ 1 |
| 2645 | # endif |
| 2646 | # if defined(__F16C__) || (defined(HEDLEY_MSVC_VERSION) && HEDLEY_MSVC_VERSION_CHECK(19,30,0) && defined(SIMDE_ARCH_X86_AVX2) ) |
| 2647 | # define SIMDE_ARCH_X86_F16C 1 |
| 2648 | # endif |
| 2649 | # if defined(__AES__) |
| 2650 | # define SIMDE_ARCH_X86_AES 1 |
| 2651 | # endif |
| 2652 | #endif |
| 2653 | |
| 2654 | /* Itanium |
| 2655 | <https://en.wikipedia.org/wiki/Itanium> */ |
| 2656 | #if defined(__ia64__) || defined(_IA64) || defined(__IA64__) || defined(__ia64) || defined(_M_IA64) || defined(__itanium__) |
| 2657 | # define SIMDE_ARCH_IA64 1 |
| 2658 | #endif |
| 2659 | |
| 2660 | /* Renesas M32R |
| 2661 | <https://en.wikipedia.org/wiki/M32R> */ |
| 2662 | #if defined(__m32r__) || defined(__M32R__) |
| 2663 | # define SIMDE_ARCH_M32R |
| 2664 | #endif |
| 2665 | |
| 2666 | /* Motorola 68000 |
| 2667 | <https://en.wikipedia.org/wiki/Motorola_68000> */ |
| 2668 | #if defined(__mc68060__) || defined(__MC68060__) |
| 2669 | # define SIMDE_ARCH_M68K 68060 |
| 2670 | #elif defined(__mc68040__) || defined(__MC68040__) |
| 2671 | # define SIMDE_ARCH_M68K 68040 |
| 2672 | #elif defined(__mc68030__) || defined(__MC68030__) |
| 2673 | # define SIMDE_ARCH_M68K 68030 |
| 2674 | #elif defined(__mc68020__) || defined(__MC68020__) |
| 2675 | # define SIMDE_ARCH_M68K 68020 |
| 2676 | #elif defined(__mc68010__) || defined(__MC68010__) |
| 2677 | # define SIMDE_ARCH_M68K 68010 |
| 2678 | #elif defined(__mc68000__) || defined(__MC68000__) |
| 2679 | # define SIMDE_ARCH_M68K 68000 |
| 2680 | #endif |
| 2681 | #if defined(SIMDE_ARCH_M68K) |
| 2682 | # define SIMDE_ARCH_M68K_CHECK(version) ((version) <= SIMDE_ARCH_M68K) |
| 2683 | #else |
| 2684 | # define SIMDE_ARCH_M68K_CHECK(version) (0) |
| 2685 | #endif |
| 2686 | |
| 2687 | /* Xilinx MicroBlaze |
| 2688 | <https://en.wikipedia.org/wiki/MicroBlaze> */ |
| 2689 | #if defined(__MICROBLAZE__) || defined(__microblaze__) |
| 2690 | # define SIMDE_ARCH_MICROBLAZE |
| 2691 | #endif |
| 2692 | |
| 2693 | /* MIPS |
| 2694 | <https://en.wikipedia.org/wiki/MIPS_architecture> */ |
| 2695 | #if defined(_MIPS_ISA_MIPS64R2) |
| 2696 | # define SIMDE_ARCH_MIPS 642 |
| 2697 | #elif defined(_MIPS_ISA_MIPS64) |
| 2698 | # define SIMDE_ARCH_MIPS 640 |
| 2699 | #elif defined(_MIPS_ISA_MIPS32R2) |
| 2700 | # define SIMDE_ARCH_MIPS 322 |
| 2701 | #elif defined(_MIPS_ISA_MIPS32) |
| 2702 | # define SIMDE_ARCH_MIPS 320 |
| 2703 | #elif defined(_MIPS_ISA_MIPS4) |
| 2704 | # define SIMDE_ARCH_MIPS 4 |
| 2705 | #elif defined(_MIPS_ISA_MIPS3) |
| 2706 | # define SIMDE_ARCH_MIPS 3 |
| 2707 | #elif defined(_MIPS_ISA_MIPS2) |
| 2708 | # define SIMDE_ARCH_MIPS 2 |
| 2709 | #elif defined(_MIPS_ISA_MIPS1) |
| 2710 | # define SIMDE_ARCH_MIPS 1 |
| 2711 | #elif defined(_MIPS_ISA_MIPS) || defined(__mips) || defined(__MIPS__) |
| 2712 | # define SIMDE_ARCH_MIPS 1 |
| 2713 | #endif |
| 2714 | #if defined(SIMDE_ARCH_MIPS) |
| 2715 | # define SIMDE_ARCH_MIPS_CHECK(version) ((version) <= SIMDE_ARCH_MIPS) |
| 2716 | #else |
| 2717 | # define SIMDE_ARCH_MIPS_CHECK(version) (0) |
| 2718 | #endif |
| 2719 | |
| 2720 | #if defined(__mips_loongson_mmi) |
| 2721 | # define SIMDE_ARCH_MIPS_LOONGSON_MMI 1 |
| 2722 | #endif |
| 2723 | |
| 2724 | #if defined(__mips_msa) |
| 2725 | # define SIMDE_ARCH_MIPS_MSA 1 |
| 2726 | #endif |
| 2727 | |
| 2728 | /* Matsushita MN10300 |
| 2729 | <https://en.wikipedia.org/wiki/MN103> */ |
| 2730 | #if defined(__MN10300__) || defined(__mn10300__) |
| 2731 | # define SIMDE_ARCH_MN10300 1 |
| 2732 | #endif |
| 2733 | |
| 2734 | /* POWER |
| 2735 | <https://en.wikipedia.org/wiki/IBM_POWER_Instruction_Set_Architecture> */ |
| 2736 | #if defined(_M_PPC) |
| 2737 | # define SIMDE_ARCH_POWER _M_PPC |
| 2738 | #elif defined(_ARCH_PWR9) |
| 2739 | # define SIMDE_ARCH_POWER 900 |
| 2740 | #elif defined(_ARCH_PWR8) |
| 2741 | # define SIMDE_ARCH_POWER 800 |
| 2742 | #elif defined(_ARCH_PWR7) |
| 2743 | # define SIMDE_ARCH_POWER 700 |
| 2744 | #elif defined(_ARCH_PWR6) |
| 2745 | # define SIMDE_ARCH_POWER 600 |
| 2746 | #elif defined(_ARCH_PWR5) |
| 2747 | # define SIMDE_ARCH_POWER 500 |
| 2748 | #elif defined(_ARCH_PWR4) |
| 2749 | # define SIMDE_ARCH_POWER 400 |
| 2750 | #elif defined(_ARCH_440) || defined(__ppc440__) |
| 2751 | # define SIMDE_ARCH_POWER 440 |
| 2752 | #elif defined(_ARCH_450) || defined(__ppc450__) |
| 2753 | # define SIMDE_ARCH_POWER 450 |
| 2754 | #elif defined(_ARCH_601) || defined(__ppc601__) |
| 2755 | # define SIMDE_ARCH_POWER 601 |
| 2756 | #elif defined(_ARCH_603) || defined(__ppc603__) |
| 2757 | # define SIMDE_ARCH_POWER 603 |
| 2758 | #elif defined(_ARCH_604) || defined(__ppc604__) |
| 2759 | # define SIMDE_ARCH_POWER 604 |
| 2760 | #elif defined(_ARCH_605) || defined(__ppc605__) |
| 2761 | # define SIMDE_ARCH_POWER 605 |
| 2762 | #elif defined(_ARCH_620) || defined(__ppc620__) |
| 2763 | # define SIMDE_ARCH_POWER 620 |
| 2764 | #elif defined(__powerpc) || defined(__powerpc__) || defined(__POWERPC__) || defined(__ppc__) || defined(__PPC__) || defined(_ARCH_PPC) || defined(__ppc) |
| 2765 | # define SIMDE_ARCH_POWER 1 |
| 2766 | #endif |
| 2767 | #if defined(SIMDE_ARCH_POWER) |
| 2768 | #define SIMDE_ARCH_POWER_CHECK(version) ((version) <= SIMDE_ARCH_POWER) |
| 2769 | #else |
| 2770 | #define SIMDE_ARCH_POWER_CHECK(version) (0) |
| 2771 | #endif |
| 2772 | |
| 2773 | #if defined(__ALTIVEC__) |
| 2774 | # define SIMDE_ARCH_POWER_ALTIVEC SIMDE_ARCH_POWER |
| 2775 | #define SIMDE_ARCH_POWER_ALTIVEC_CHECK(version) ((version) <= SIMDE_ARCH_POWER) |
| 2776 | #else |
| 2777 | #define SIMDE_ARCH_POWER_ALTIVEC_CHECK(version) (0) |
| 2778 | #endif |
| 2779 | |
| 2780 | /* RISC-V |
| 2781 | <https://en.wikipedia.org/wiki/RISC-V> */ |
| 2782 | #if defined(__riscv) || defined(__riscv__) |
| 2783 | # if __riscv_xlen == 64 |
| 2784 | # define SIMDE_ARCH_RISCV64 |
| 2785 | # elif __riscv_xlen == 32 |
| 2786 | # define SIMDE_ARCH_RISCV32 |
| 2787 | # endif |
| 2788 | #endif |
| 2789 | |
| 2790 | /* RISC-V SIMD ISA extensions */ |
| 2791 | #if defined(__riscv_zve32x) |
| 2792 | # define SIMDE_ARCH_RISCV_ZVE32X 1 |
| 2793 | #endif |
| 2794 | #if defined(__riscv_zve32f) |
| 2795 | # define SIMDE_ARCH_RISCV_ZVE32F 1 |
| 2796 | #endif |
| 2797 | #if defined(__riscv_zve64x) |
| 2798 | # define SIMDE_ARCH_RISCV_ZVE64X 1 |
| 2799 | #endif |
| 2800 | #if defined(__riscv_zve64f) |
| 2801 | # define SIMDE_ARCH_RISCV_ZVE64F 1 |
| 2802 | #endif |
| 2803 | #if defined(__riscv_zve64d) |
| 2804 | # define SIMDE_ARCH_RISCV_ZVE64D 1 |
| 2805 | #endif |
| 2806 | #if defined(__riscv_v) |
| 2807 | # define SIMDE_ARCH_RISCV_V 1 |
| 2808 | #endif |
| 2809 | #if defined(__riscv_zvfh) |
| 2810 | # define SIMDE_ARCH_RISCV_ZVFH 1 |
| 2811 | #endif |
| 2812 | #if defined(__riscv_zvfhmin) |
| 2813 | # define SIMDE_ARCH_RISCV_ZVFHMIN 1 |
| 2814 | #endif |
| 2815 | |
| 2816 | /* SPARC |
| 2817 | <https://en.wikipedia.org/wiki/SPARC> */ |
| 2818 | #if defined(__sparc_v9__) || defined(__sparcv9) |
| 2819 | # define SIMDE_ARCH_SPARC 9 |
| 2820 | #elif defined(__sparc_v8__) || defined(__sparcv8) |
| 2821 | # define SIMDE_ARCH_SPARC 8 |
| 2822 | #elif defined(__sparc_v7__) || defined(__sparcv7) |
| 2823 | # define SIMDE_ARCH_SPARC 7 |
| 2824 | #elif defined(__sparc_v6__) || defined(__sparcv6) |
| 2825 | # define SIMDE_ARCH_SPARC 6 |
| 2826 | #elif defined(__sparc_v5__) || defined(__sparcv5) |
| 2827 | # define SIMDE_ARCH_SPARC 5 |
| 2828 | #elif defined(__sparc_v4__) || defined(__sparcv4) |
| 2829 | # define SIMDE_ARCH_SPARC 4 |
| 2830 | #elif defined(__sparc_v3__) || defined(__sparcv3) |
| 2831 | # define SIMDE_ARCH_SPARC 3 |
| 2832 | #elif defined(__sparc_v2__) || defined(__sparcv2) |
| 2833 | # define SIMDE_ARCH_SPARC 2 |
| 2834 | #elif defined(__sparc_v1__) || defined(__sparcv1) |
| 2835 | # define SIMDE_ARCH_SPARC 1 |
| 2836 | #elif defined(__sparc__) || defined(__sparc) |
| 2837 | # define SIMDE_ARCH_SPARC 1 |
| 2838 | #endif |
| 2839 | #if defined(SIMDE_ARCH_SPARC) |
| 2840 | #define SIMDE_ARCH_SPARC_CHECK(version) ((version) <= SIMDE_ARCH_SPARC) |
| 2841 | #else |
| 2842 | #define SIMDE_ARCH_SPARC_CHECK(version) (0) |
| 2843 | #endif |
| 2844 | |
| 2845 | /* SuperH |
| 2846 | <https://en.wikipedia.org/wiki/SuperH> */ |
| 2847 | #if defined(__sh5__) || defined(__SH5__) |
| 2848 | # define SIMDE_ARCH_SUPERH 5 |
| 2849 | #elif defined(__sh4__) || defined(__SH4__) |
| 2850 | # define SIMDE_ARCH_SUPERH 4 |
| 2851 | #elif defined(__sh3__) || defined(__SH3__) |
| 2852 | # define SIMDE_ARCH_SUPERH 3 |
| 2853 | #elif defined(__sh2__) || defined(__SH2__) |
| 2854 | # define SIMDE_ARCH_SUPERH 2 |
| 2855 | #elif defined(__sh1__) || defined(__SH1__) |
| 2856 | # define SIMDE_ARCH_SUPERH 1 |
| 2857 | #elif defined(__sh__) || defined(__SH__) |
| 2858 | # define SIMDE_ARCH_SUPERH 1 |
| 2859 | #endif |
| 2860 | |
| 2861 | /* IBM System z |
| 2862 | <https://en.wikipedia.org/wiki/IBM_System_z> */ |
| 2863 | #if defined(__370__) || defined(__THW_370__) || defined(__s390__) || defined(__s390x__) || defined(__zarch__) || defined(__SYSC_ZARCH__) |
| 2864 | # define SIMDE_ARCH_ZARCH __ARCH__ |
| 2865 | #endif |
| 2866 | #if defined(SIMDE_ARCH_ZARCH) |
| 2867 | #define SIMDE_ARCH_ZARCH_CHECK(version) ((version) <= SIMDE_ARCH_ZARCH) |
| 2868 | #else |
| 2869 | #define SIMDE_ARCH_ZARCH_CHECK(version) (0) |
| 2870 | #endif |
| 2871 | |
| 2872 | #if defined(SIMDE_ARCH_ZARCH) && defined(__VEC__) |
| 2873 | #define SIMDE_ARCH_ZARCH_ZVECTOR SIMDE_ARCH_ZARCH |
| 2874 | #endif |
| 2875 | |
| 2876 | /* TMS320 DSP |
| 2877 | <https://en.wikipedia.org/wiki/Texas_Instruments_TMS320> */ |
| 2878 | #if defined(_TMS320C6740) || defined(__TMS320C6740__) |
| 2879 | # define SIMDE_ARCH_TMS320 6740 |
| 2880 | #elif defined(_TMS320C6700_PLUS) || defined(__TMS320C6700_PLUS__) |
| 2881 | # define SIMDE_ARCH_TMS320 6701 |
| 2882 | #elif defined(_TMS320C6700) || defined(__TMS320C6700__) |
| 2883 | # define SIMDE_ARCH_TMS320 6700 |
| 2884 | #elif defined(_TMS320C6600) || defined(__TMS320C6600__) |
| 2885 | # define SIMDE_ARCH_TMS320 6600 |
| 2886 | #elif defined(_TMS320C6400_PLUS) || defined(__TMS320C6400_PLUS__) |
| 2887 | # define SIMDE_ARCH_TMS320 6401 |
| 2888 | #elif defined(_TMS320C6400) || defined(__TMS320C6400__) |
| 2889 | # define SIMDE_ARCH_TMS320 6400 |
| 2890 | #elif defined(_TMS320C6200) || defined(__TMS320C6200__) |
| 2891 | # define SIMDE_ARCH_TMS320 6200 |
| 2892 | #elif defined(_TMS320C55X) || defined(__TMS320C55X__) |
| 2893 | # define SIMDE_ARCH_TMS320 550 |
| 2894 | #elif defined(_TMS320C54X) || defined(__TMS320C54X__) |
| 2895 | # define SIMDE_ARCH_TMS320 540 |
| 2896 | #elif defined(_TMS320C28X) || defined(__TMS320C28X__) |
| 2897 | # define SIMDE_ARCH_TMS320 280 |
| 2898 | #endif |
| 2899 | #if defined(SIMDE_ARCH_TMS320) |
| 2900 | #define SIMDE_ARCH_TMS320_CHECK(version) ((version) <= SIMDE_ARCH_TMS320) |
| 2901 | #else |
| 2902 | #define SIMDE_ARCH_TMS320_CHECK(version) (0) |
| 2903 | #endif |
| 2904 | |
| 2905 | /* WebAssembly */ |
| 2906 | #if defined(__wasm__) |
| 2907 | # define SIMDE_ARCH_WASM 1 |
| 2908 | #endif |
| 2909 | |
| 2910 | #if defined(SIMDE_ARCH_WASM) && defined(__wasm_simd128__) |
| 2911 | # define SIMDE_ARCH_WASM_SIMD128 |
| 2912 | #endif |
| 2913 | |
| 2914 | #if defined(SIMDE_ARCH_WASM) && defined(__wasm_relaxed_simd__) |
| 2915 | # define SIMDE_ARCH_WASM_RELAXED_SIMD |
| 2916 | #endif |
| 2917 | |
| 2918 | /* Xtensa |
| 2919 | <https://en.wikipedia.org/wiki/> */ |
| 2920 | #if defined(__xtensa__) || defined(__XTENSA__) |
| 2921 | # define SIMDE_ARCH_XTENSA 1 |
| 2922 | #endif |
| 2923 | |
| 2924 | /* Availability of 16-bit floating-point arithmetic intrinsics */ |
| 2925 | #if defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) |
| 2926 | # define SIMDE_ARCH_ARM_NEON_FP16 |
| 2927 | #endif |
| 2928 | |
| 2929 | /* Availability of 16-bit brain floating-point arithmetic intrinsics */ |
| 2930 | #if defined(__ARM_FEATURE_BF16_VECTOR_ARITHMETIC) |
| 2931 | # define SIMDE_ARCH_ARM_NEON_BF16 |
| 2932 | #endif |
| 2933 | |
| 2934 | /* LoongArch |
| 2935 | <https://en.wikipedia.org/wiki/Loongson#LoongArch> */ |
| 2936 | #if defined(__loongarch32) |
| 2937 | # define SIMDE_ARCH_LOONGARCH 1 |
| 2938 | #elif defined(__loongarch64) |
| 2939 | # define SIMDE_ARCH_LOONGARCH 2 |
| 2940 | #endif |
| 2941 | |
| 2942 | /* LSX: LoongArch 128-bits SIMD extension */ |
| 2943 | #if defined(__loongarch_sx) |
| 2944 | # define SIMDE_ARCH_LOONGARCH_LSX 1 |
| 2945 | #endif |
| 2946 | |
| 2947 | /* LASX: LoongArch 256-bits SIMD extension */ |
| 2948 | #if defined(__loongarch_asx) |
| 2949 | # define SIMDE_ARCH_LOONGARCH_LASX 2 |
| 2950 | #endif |
| 2951 | |
| 2952 | #endif /* !defined(SIMDE_ARCH_H) */ |
| 2953 | /* :: End simde/simde-arch.h :: */ |
| 2954 | /* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */ |
| 2955 | /* 71fd833d9666141edcd1d3c109a80e228303d8d7 */ |
| 2956 | /* :: Begin simde/simde-features.h :: */ |
| 2957 | /* SPDX-License-Identifier: MIT |
| 2958 | * |
| 2959 | * Permission is hereby granted, free of charge, to any person |
| 2960 | * obtaining a copy of this software and associated documentation |
| 2961 | * files (the "Software"), to deal in the Software without |
| 2962 | * restriction, including without limitation the rights to use, copy, |
| 2963 | * modify, merge, publish, distribute, sublicense, and/or sell copies |
| 2964 | * of the Software, and to permit persons to whom the Software is |
| 2965 | * furnished to do so, subject to the following conditions: |
| 2966 | * |
| 2967 | * The above copyright notice and this permission notice shall be |
| 2968 | * included in all copies or substantial portions of the Software. |
| 2969 | * |
| 2970 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 2971 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 2972 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 2973 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS |
| 2974 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN |
| 2975 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 2976 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 2977 | * SOFTWARE. |
| 2978 | * |
| 2979 | * Copyright: |
| 2980 | * 2020 Evan Nemerson <evan@nemerson.com> |
| 2981 | * 2023 Ju-Hung Li <jhlee@pllab.cs.nthu.edu.tw> (Copyright owned by NTHU pllab) |
| 2982 | */ |
| 2983 | |
| 2984 | /* simde-arch.h is used to determine which features are available according |
| 2985 | to the compiler. However, we want to make it possible to forcibly enable |
| 2986 | or disable APIs */ |
| 2987 | |
| 2988 | #if !defined(SIMDE_FEATURES_H) |
| 2989 | #define SIMDE_FEATURES_H |
| 2990 | |
| 2991 | /* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */ |
| 2992 | /* 71fd833d9666141edcd1d3c109a80e228303d8d7 */ |
| 2993 | /* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */ |
| 2994 | /* 71fd833d9666141edcd1d3c109a80e228303d8d7 */ |
| 2995 | /* :: Begin simde/simde-diagnostic.h :: */ |
| 2996 | /* SPDX-License-Identifier: MIT |
| 2997 | * |
| 2998 | * Permission is hereby granted, free of charge, to any person |
| 2999 | * obtaining a copy of this software and associated documentation |
| 3000 | * files (the "Software"), to deal in the Software without |
| 3001 | * restriction, including without limitation the rights to use, copy, |
| 3002 | * modify, merge, publish, distribute, sublicense, and/or sell copies |
| 3003 | * of the Software, and to permit persons to whom the Software is |
| 3004 | * furnished to do so, subject to the following conditions: |
| 3005 | * |
| 3006 | * The above copyright notice and this permission notice shall be |
| 3007 | * included in all copies or substantial portions of the Software. |
| 3008 | * |
| 3009 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 3010 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 3011 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 3012 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS |
| 3013 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN |
| 3014 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 3015 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 3016 | * SOFTWARE. |
| 3017 | * |
| 3018 | * Copyright: |
| 3019 | * 2017-2020 Evan Nemerson <evan@nemerson.com> |
| 3020 | */ |
| 3021 | |
| 3022 | /* SIMDe targets a very wide range of standards and compilers, and our |
| 3023 | * goal is to compile cleanly even with extremely aggressive warnings |
| 3024 | * (i.e., -Weverything in clang, -Wextra in GCC, /W4 for MSVC, etc.) |
| 3025 | * treated as errors. |
| 3026 | * |
| 3027 | * While our preference is to resolve the underlying issue a given |
| 3028 | * diagnostic is warning us about, sometimes that's not possible. |
| 3029 | * Fixing a warning in one compiler may cause problems in another. |
| 3030 | * Sometimes a warning doesn't really apply to us (false positives), |
| 3031 | * and sometimes adhering to a warning would mean dropping a feature |
| 3032 | * we *know* the compiler supports since we have tested specifically |
| 3033 | * for the compiler or feature. |
| 3034 | * |
| 3035 | * When practical, warnings are only disabled for specific code. For |
| 3036 | * a list of warnings which are enabled by default in all SIMDe code, |
| 3037 | * see SIMDE_DISABLE_UNWANTED_DIAGNOSTICS. Note that we restore the |
| 3038 | * warning stack when SIMDe is done parsing, so code which includes |
| 3039 | * SIMDe is not deprived of these warnings. |
| 3040 | */ |
| 3041 | |
| 3042 | #if !defined(SIMDE_DIAGNOSTIC_H) |
| 3043 | #define SIMDE_DIAGNOSTIC_H |
| 3044 | |
| 3045 | /* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */ |
| 3046 | /* 71fd833d9666141edcd1d3c109a80e228303d8d7 */ |
| 3047 | /* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */ |
| 3048 | /* 71fd833d9666141edcd1d3c109a80e228303d8d7 */ |
| 3049 | /* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */ |
| 3050 | /* 71fd833d9666141edcd1d3c109a80e228303d8d7 */ |
| 3051 | |
| 3052 | /* This is only to help us implement functions like _mm_undefined_ps. */ |
| 3053 | #if defined(SIMDE_DIAGNOSTIC_DISABLE_UNINITIALIZED_) |
| 3054 | #undef SIMDE_DIAGNOSTIC_DISABLE_UNINITIALIZED_ |
| 3055 | #endif |
| 3056 | #if HEDLEY_HAS_WARNING("-Wuninitialized") |
| 3057 | #define SIMDE_DIAGNOSTIC_DISABLE_UNINITIALIZED_ _Pragma("clang diagnostic ignored \"-Wuninitialized\"") |
| 3058 | #elif HEDLEY_GCC_VERSION_CHECK(4,2,0) |
| 3059 | #define SIMDE_DIAGNOSTIC_DISABLE_UNINITIALIZED_ _Pragma("GCC diagnostic ignored \"-Wuninitialized\"") |
| 3060 | #elif HEDLEY_PGI_VERSION_CHECK(19,10,0) |
| 3061 | #define SIMDE_DIAGNOSTIC_DISABLE_UNINITIALIZED_ _Pragma("diag_suppress 549") |
| 3062 | #elif HEDLEY_SUNPRO_VERSION_CHECK(5,14,0) && defined(__cplusplus) |
| 3063 | #define SIMDE_DIAGNOSTIC_DISABLE_UNINITIALIZED_ _Pragma("error_messages(off,SEC_UNINITIALIZED_MEM_READ,SEC_UNDEFINED_RETURN_VALUE,unassigned)") |
| 3064 | #elif HEDLEY_SUNPRO_VERSION_CHECK(5,14,0) |
| 3065 | #define SIMDE_DIAGNOSTIC_DISABLE_UNINITIALIZED_ _Pragma("error_messages(off,SEC_UNINITIALIZED_MEM_READ,SEC_UNDEFINED_RETURN_VALUE)") |
| 3066 | #elif HEDLEY_SUNPRO_VERSION_CHECK(5,12,0) && defined(__cplusplus) |
| 3067 | #define SIMDE_DIAGNOSTIC_DISABLE_UNINITIALIZED_ _Pragma("error_messages(off,unassigned)") |
| 3068 | #elif \ |
| 3069 | HEDLEY_TI_VERSION_CHECK(16,9,9) || \ |
| 3070 | HEDLEY_TI_CL6X_VERSION_CHECK(8,0,0) || \ |
| 3071 | HEDLEY_TI_CL7X_VERSION_CHECK(1,2,0) || \ |
| 3072 | HEDLEY_TI_CLPRU_VERSION_CHECK(2,3,2) |
| 3073 | #define SIMDE_DIAGNOSTIC_DISABLE_UNINITIALIZED_ _Pragma("diag_suppress 551") |
| 3074 | #elif HEDLEY_INTEL_VERSION_CHECK(13,0,0) |
| 3075 | #define SIMDE_DIAGNOSTIC_DISABLE_UNINITIALIZED_ _Pragma("warning(disable:592)") |
| 3076 | #elif HEDLEY_MSVC_VERSION_CHECK(19,0,0) && !defined(__MSVC_RUNTIME_CHECKS) |
| 3077 | #define SIMDE_DIAGNOSTIC_DISABLE_UNINITIALIZED_ __pragma(warning(disable:4700)) |
| 3078 | #endif |
| 3079 | |
| 3080 | /* GCC emits a lot of "notes" about the ABI being different for things |
| 3081 | * in newer versions of GCC. We don't really care because all our |
| 3082 | * functions are inlined and don't generate ABI. */ |
| 3083 | #if HEDLEY_GCC_VERSION_CHECK(7,0,0) |
| 3084 | #define SIMDE_DIAGNOSTIC_DISABLE_PSABI_ _Pragma("GCC diagnostic ignored \"-Wpsabi\"") |
| 3085 | #else |
| 3086 | #define SIMDE_DIAGNOSTIC_DISABLE_PSABI_ |
| 3087 | #endif |
| 3088 | |
| 3089 | /* Since MMX uses x87 FP registers, you're supposed to call _mm_empty() |
| 3090 | * after each MMX function before any floating point instructions. |
| 3091 | * Some compilers warn about functions which use MMX functions but |
| 3092 | * don't call _mm_empty(). However, since SIMDe is implementyng the |
| 3093 | * MMX API we shouldn't be calling _mm_empty(); we leave it to the |
| 3094 | * caller to invoke simde_mm_empty(). */ |
| 3095 | #if HEDLEY_INTEL_VERSION_CHECK(19,0,0) |
| 3096 | #define SIMDE_DIAGNOSTIC_DISABLE_NO_EMMS_INSTRUCTION_ _Pragma("warning(disable:13200 13203)") |
| 3097 | #elif defined(HEDLEY_MSVC_VERSION) |
| 3098 | #define SIMDE_DIAGNOSTIC_DISABLE_NO_EMMS_INSTRUCTION_ __pragma(warning(disable:4799)) |
| 3099 | #else |
| 3100 | #define SIMDE_DIAGNOSTIC_DISABLE_NO_EMMS_INSTRUCTION_ |
| 3101 | #endif |
| 3102 | |
| 3103 | /* Intel is pushing people to use OpenMP SIMD instead of Cilk+, so they |
| 3104 | * emit a diagnostic if you use #pragma simd instead of |
| 3105 | * #pragma omp simd. SIMDe supports OpenMP SIMD, you just need to |
| 3106 | * compile with -qopenmp or -qopenmp-simd and define |
| 3107 | * SIMDE_ENABLE_OPENMP. Cilk+ is just a fallback. */ |
| 3108 | #if HEDLEY_INTEL_VERSION_CHECK(18,0,0) |
| 3109 | #define SIMDE_DIAGNOSTIC_DISABLE_SIMD_PRAGMA_DEPRECATED_ _Pragma("warning(disable:3948)") |
| 3110 | #else |
| 3111 | #define SIMDE_DIAGNOSTIC_DISABLE_SIMD_PRAGMA_DEPRECATED_ |
| 3112 | #endif |
| 3113 | |
| 3114 | /* MSVC emits a diagnostic when we call a function (like |
| 3115 | * simde_mm_set_epi32) while initializing a struct. We currently do |
| 3116 | * this a *lot* in the tests. */ |
| 3117 | #if \ |
| 3118 | defined(HEDLEY_MSVC_VERSION) |
| 3119 | #define SIMDE_DIAGNOSTIC_DISABLE_NON_CONSTANT_AGGREGATE_INITIALIZER_ __pragma(warning(disable:4204)) |
| 3120 | #else |
| 3121 | #define SIMDE_DIAGNOSTIC_DISABLE_NON_CONSTANT_AGGREGATE_INITIALIZER_ |
| 3122 | #endif |
| 3123 | |
| 3124 | /* This warning needs a lot of work. It is triggered if all you do is |
| 3125 | * pass the value to memcpy/__builtin_memcpy, or if you initialize a |
| 3126 | * member of the union, even if that member takes up the entire union. |
| 3127 | * Last tested with clang-10, hopefully things will improve in the |
| 3128 | * future; if clang fixes this I'd love to enable it. */ |
| 3129 | #if \ |
| 3130 | HEDLEY_HAS_WARNING("-Wconditional-uninitialized") |
| 3131 | #define SIMDE_DIAGNOSTIC_DISABLE_CONDITIONAL_UNINITIALIZED_ _Pragma("clang diagnostic ignored \"-Wconditional-uninitialized\"") |
| 3132 | #else |
| 3133 | #define SIMDE_DIAGNOSTIC_DISABLE_CONDITIONAL_UNINITIALIZED_ |
| 3134 | #endif |
| 3135 | |
| 3136 | /* This warning is meant to catch things like `0.3 + 0.4 == 0.7`, which |
| 3137 | * will is false. However, SIMDe uses these operations exclusively |
| 3138 | * for things like _mm_cmpeq_ps, for which we really do want to check |
| 3139 | * for equality (or inequality). |
| 3140 | * |
| 3141 | * If someone wants to put together a SIMDE_FLOAT_EQUAL(a, op, b) macro |
| 3142 | * which just wraps a check in some code do disable this diagnostic I'd |
| 3143 | * be happy to accept it. */ |
| 3144 | #if \ |
| 3145 | HEDLEY_HAS_WARNING("-Wfloat-equal") || \ |
| 3146 | HEDLEY_GCC_VERSION_CHECK(3,0,0) |
| 3147 | #define SIMDE_DIAGNOSTIC_DISABLE_FLOAT_EQUAL_ _Pragma("GCC diagnostic ignored \"-Wfloat-equal\"") |
| 3148 | #else |
| 3149 | #define SIMDE_DIAGNOSTIC_DISABLE_FLOAT_EQUAL_ |
| 3150 | #endif |
| 3151 | |
| 3152 | /* This is because we use HEDLEY_STATIC_ASSERT for static assertions. |
| 3153 | * If Hedley can't find an implementation it will preprocess to |
| 3154 | * nothing, which means there will be a trailing semi-colon. */ |
| 3155 | #if HEDLEY_HAS_WARNING("-Wextra-semi") |
| 3156 | #define SIMDE_DIAGNOSTIC_DISABLE_EXTRA_SEMI_ _Pragma("clang diagnostic ignored \"-Wextra-semi\"") |
| 3157 | #elif HEDLEY_GCC_VERSION_CHECK(8,1,0) && defined(__cplusplus) |
| 3158 | #define SIMDE_DIAGNOSTIC_DISABLE_EXTRA_SEMI_ _Pragma("GCC diagnostic ignored \"-Wextra-semi\"") |
| 3159 | #else |
| 3160 | #define SIMDE_DIAGNOSTIC_DISABLE_EXTRA_SEMI_ |
| 3161 | #endif |
| 3162 | |
| 3163 | /* We do use a few variadic macros, which technically aren't available |
| 3164 | * until C99 and C++11, but every compiler I'm aware of has supported |
| 3165 | * them for much longer. That said, usage is isolated to the test |
| 3166 | * suite and compilers known to support them. */ |
| 3167 | #if HEDLEY_HAS_WARNING("-Wvariadic-macros") || HEDLEY_GCC_VERSION_CHECK(4,0,0) |
| 3168 | #if HEDLEY_HAS_WARNING("-Wc++98-compat-pedantic") |
| 3169 | #define SIMDE_DIAGNOSTIC_DISABLE_VARIADIC_MACROS_ \ |
| 3170 | _Pragma("clang diagnostic ignored \"-Wvariadic-macros\"") \ |
| 3171 | _Pragma("clang diagnostic ignored \"-Wc++98-compat-pedantic\"") |
| 3172 | #else |
| 3173 | #define SIMDE_DIAGNOSTIC_DISABLE_VARIADIC_MACROS_ _Pragma("GCC diagnostic ignored \"-Wvariadic-macros\"") |
| 3174 | #endif |
| 3175 | #else |
| 3176 | #define SIMDE_DIAGNOSTIC_DISABLE_VARIADIC_MACROS_ |
| 3177 | #endif |
| 3178 | |
| 3179 | /* emscripten requires us to use a __wasm_unimplemented_simd128__ macro |
| 3180 | * before we can access certain SIMD intrinsics, but this diagnostic |
| 3181 | * warns about it being a reserved name. It is a reserved name, but |
| 3182 | * it's reserved for the compiler and we are using it to convey |
| 3183 | * information to the compiler. |
| 3184 | * |
| 3185 | * This is also used when enabling native aliases since we don't get to |
| 3186 | * choose the macro names. */ |
| 3187 | #if HEDLEY_HAS_WARNING("-Wreserved-id-macro") |
| 3188 | #define SIMDE_DIAGNOSTIC_DISABLE_RESERVED_ID_MACRO_ _Pragma("clang diagnostic ignored \"-Wreserved-id-macro\"") |
| 3189 | #else |
| 3190 | #define SIMDE_DIAGNOSTIC_DISABLE_RESERVED_ID_MACRO_ |
| 3191 | #endif |
| 3192 | |
| 3193 | /* Similar to above; types like simde__m128i are reserved due to the |
| 3194 | * double underscore, but we didn't choose them, Intel did. */ |
| 3195 | #if HEDLEY_HAS_WARNING("-Wreserved-identifier") |
| 3196 | #define SIMDE_DIAGNOSTIC_DISABLE_RESERVED_ID_ _Pragma("clang diagnostic ignored \"-Wreserved-identifier\"") |
| 3197 | #else |
| 3198 | #define SIMDE_DIAGNOSTIC_DISABLE_RESERVED_ID_ |
| 3199 | #endif |
| 3200 | |
| 3201 | /* clang 3.8 warns about the packed attribute being unnecessary when |
| 3202 | * used in the _mm_loadu_* functions. That *may* be true for version |
| 3203 | * 3.8, but for later versions it is crucial in order to make unaligned |
| 3204 | * access safe. */ |
| 3205 | #if HEDLEY_HAS_WARNING("-Wpacked") |
| 3206 | #define SIMDE_DIAGNOSTIC_DISABLE_PACKED_ _Pragma("clang diagnostic ignored \"-Wpacked\"") |
| 3207 | #else |
| 3208 | #define SIMDE_DIAGNOSTIC_DISABLE_PACKED_ |
| 3209 | #endif |
| 3210 | |
| 3211 | /* Triggered when assigning a float to a double implicitly. We use |
| 3212 | * explicit casts in SIMDe, this is only used in the test suite. */ |
| 3213 | #if HEDLEY_HAS_WARNING("-Wdouble-promotion") |
| 3214 | #define SIMDE_DIAGNOSTIC_DISABLE_DOUBLE_PROMOTION_ _Pragma("clang diagnostic ignored \"-Wdouble-promotion\"") |
| 3215 | #else |
| 3216 | #define SIMDE_DIAGNOSTIC_DISABLE_DOUBLE_PROMOTION_ |
| 3217 | #endif |
| 3218 | |
| 3219 | /* Several compilers treat conformant array parameters as VLAs. We |
| 3220 | * test to make sure we're in C mode (C++ doesn't support CAPs), and |
| 3221 | * that the version of the standard supports CAPs. We also reject |
| 3222 | * some buggy compilers like MSVC (the logic is in Hedley if you want |
| 3223 | * to take a look), but with certain warnings enabled some compilers |
| 3224 | * still like to emit a diagnostic. */ |
| 3225 | #if HEDLEY_HAS_WARNING("-Wvla") |
| 3226 | #define SIMDE_DIAGNOSTIC_DISABLE_VLA_ _Pragma("clang diagnostic ignored \"-Wvla\"") |
| 3227 | #elif HEDLEY_GCC_VERSION_CHECK(4,3,0) |
| 3228 | #define SIMDE_DIAGNOSTIC_DISABLE_VLA_ _Pragma("GCC diagnostic ignored \"-Wvla\"") |
| 3229 | #else |
| 3230 | #define SIMDE_DIAGNOSTIC_DISABLE_VLA_ |
| 3231 | #endif |
| 3232 | |
| 3233 | /* If you add an unused attribute to a function and don't use it, clang |
| 3234 | * may emit this. */ |
| 3235 | #if HEDLEY_HAS_WARNING("-Wused-but-marked-unused") |
| 3236 | #define SIMDE_DIAGNOSTIC_DISABLE_USED_BUT_MARKED_UNUSED_ _Pragma("clang diagnostic ignored \"-Wused-but-marked-unused\"") |
| 3237 | #else |
| 3238 | #define SIMDE_DIAGNOSTIC_DISABLE_USED_BUT_MARKED_UNUSED_ |
| 3239 | #endif |
| 3240 | |
| 3241 | #if HEDLEY_HAS_WARNING("-Wpass-failed") |
| 3242 | #define SIMDE_DIAGNOSTIC_DISABLE_PASS_FAILED_ _Pragma("clang diagnostic ignored \"-Wpass-failed\"") |
| 3243 | #else |
| 3244 | #define SIMDE_DIAGNOSTIC_DISABLE_PASS_FAILED_ |
| 3245 | #endif |
| 3246 | |
| 3247 | #if HEDLEY_HAS_WARNING("-Wpadded") |
| 3248 | #define SIMDE_DIAGNOSTIC_DISABLE_PADDED_ _Pragma("clang diagnostic ignored \"-Wpadded\"") |
| 3249 | #elif HEDLEY_MSVC_VERSION_CHECK(19,0,0) /* Likely goes back further */ |
| 3250 | #define SIMDE_DIAGNOSTIC_DISABLE_PADDED_ __pragma(warning(disable:4324)) |
| 3251 | #else |
| 3252 | #define SIMDE_DIAGNOSTIC_DISABLE_PADDED_ |
| 3253 | #endif |
| 3254 | |
| 3255 | #if HEDLEY_HAS_WARNING("-Wzero-as-null-pointer-constant") |
| 3256 | #define SIMDE_DIAGNOSTIC_DISABLE_ZERO_AS_NULL_POINTER_CONSTANT_ _Pragma("clang diagnostic ignored \"-Wzero-as-null-pointer-constant\"") |
| 3257 | #else |
| 3258 | #define SIMDE_DIAGNOSTIC_DISABLE_ZERO_AS_NULL_POINTER_CONSTANT_ |
| 3259 | #endif |
| 3260 | |
| 3261 | #if HEDLEY_HAS_WARNING("-Wold-style-cast") |
| 3262 | #define SIMDE_DIAGNOSTIC_DISABLE_OLD_STYLE_CAST_ _Pragma("clang diagnostic ignored \"-Wold-style-cast\"") |
| 3263 | #else |
| 3264 | #define SIMDE_DIAGNOSTIC_DISABLE_OLD_STYLE_CAST_ |
| 3265 | #endif |
| 3266 | |
| 3267 | #if HEDLEY_HAS_WARNING("-Wcast-function-type") || HEDLEY_GCC_VERSION_CHECK(8,0,0) |
| 3268 | #define SIMDE_DIAGNOSTIC_DISABLE_CAST_FUNCTION_TYPE_ _Pragma("GCC diagnostic ignored \"-Wcast-function-type\"") |
| 3269 | #else |
| 3270 | #define SIMDE_DIAGNOSTIC_DISABLE_CAST_FUNCTION_TYPE_ |
| 3271 | #endif |
| 3272 | |
| 3273 | /* clang will emit this warning when we use C99 extensions when not in |
| 3274 | * C99 mode, even though it does support this. In such cases we check |
| 3275 | * the compiler and version first, so we know it's not a problem. */ |
| 3276 | #if HEDLEY_HAS_WARNING("-Wc99-extensions") |
| 3277 | #define SIMDE_DIAGNOSTIC_DISABLE_C99_EXTENSIONS_ _Pragma("clang diagnostic ignored \"-Wc99-extensions\"") |
| 3278 | #else |
| 3279 | #define SIMDE_DIAGNOSTIC_DISABLE_C99_EXTENSIONS_ |
| 3280 | #endif |
| 3281 | |
| 3282 | /* Similar problm as above; we rely on some basic C99 support, but clang |
| 3283 | * has started warning obut this even in C17 mode with -Weverything. */ |
| 3284 | #if HEDLEY_HAS_WARNING("-Wdeclaration-after-statement") |
| 3285 | #define SIMDE_DIAGNOSTIC_DISABLE_DECLARATION_AFTER_STATEMENT_ _Pragma("clang diagnostic ignored \"-Wdeclaration-after-statement\"") |
| 3286 | #else |
| 3287 | #define SIMDE_DIAGNOSTIC_DISABLE_DECLARATION_AFTER_STATEMENT_ |
| 3288 | #endif |
| 3289 | |
| 3290 | /* https://github.com/simd-everywhere/simde/issues/277 */ |
| 3291 | #if defined(HEDLEY_GCC_VERSION) && HEDLEY_GCC_VERSION_CHECK(4,6,0) && !HEDLEY_GCC_VERSION_CHECK(6,4,0) && defined(__cplusplus) |
| 3292 | #define SIMDE_DIAGNOSTIC_DISABLE_BUGGY_UNUSED_BUT_SET_VARIBALE_ _Pragma("GCC diagnostic ignored \"-Wunused-but-set-variable\"") |
| 3293 | #else |
| 3294 | #define SIMDE_DIAGNOSTIC_DISABLE_BUGGY_UNUSED_BUT_SET_VARIBALE_ |
| 3295 | #endif |
| 3296 | |
| 3297 | /* This is the warning that you normally define _CRT_SECURE_NO_WARNINGS |
| 3298 | * to silence, but you have to do that before including anything and |
| 3299 | * that would require reordering includes. */ |
| 3300 | #if defined(_MSC_VER) |
| 3301 | #define SIMDE_DIAGNOSTIC_DISABLE_ANNEX_K_ __pragma(warning(disable:4996)) |
| 3302 | #else |
| 3303 | #define SIMDE_DIAGNOSTIC_DISABLE_ANNEX_K_ |
| 3304 | #endif |
| 3305 | |
| 3306 | /* Some compilers, such as clang, may use `long long` for 64-bit |
| 3307 | * integers, but `long long` triggers a diagnostic with |
| 3308 | * -Wc++98-compat-pedantic which says 'long long' is incompatible with |
| 3309 | * C++98. */ |
| 3310 | #if HEDLEY_HAS_WARNING("-Wc++98-compat-pedantic") |
| 3311 | #if HEDLEY_HAS_WARNING("-Wc++11-long-long") |
| 3312 | #define SIMDE_DIAGNOSTIC_DISABLE_CPP98_COMPAT_PEDANTIC_ \ |
| 3313 | _Pragma("clang diagnostic ignored \"-Wc++98-compat-pedantic\"") \ |
| 3314 | _Pragma("clang diagnostic ignored \"-Wc++11-long-long\"") |
| 3315 | #else |
| 3316 | #define SIMDE_DIAGNOSTIC_DISABLE_CPP98_COMPAT_PEDANTIC_ _Pragma("clang diagnostic ignored \"-Wc++98-compat-pedantic\"") |
| 3317 | #endif |
| 3318 | #else |
| 3319 | #define SIMDE_DIAGNOSTIC_DISABLE_CPP98_COMPAT_PEDANTIC_ |
| 3320 | #endif |
| 3321 | |
| 3322 | /* Some problem as above */ |
| 3323 | #if HEDLEY_HAS_WARNING("-Wc++11-long-long") |
| 3324 | #define SIMDE_DIAGNOSTIC_DISABLE_CPP11_LONG_LONG_ _Pragma("clang diagnostic ignored \"-Wc++11-long-long\"") |
| 3325 | #else |
| 3326 | #define SIMDE_DIAGNOSTIC_DISABLE_CPP11_LONG_LONG_ |
| 3327 | #endif |
| 3328 | |
| 3329 | /* emscripten emits this whenever stdin/stdout/stderr is used in a |
| 3330 | * macro. */ |
| 3331 | #if HEDLEY_HAS_WARNING("-Wdisabled-macro-expansion") |
| 3332 | #define SIMDE_DIAGNOSTIC_DISABLE_DISABLED_MACRO_EXPANSION_ _Pragma("clang diagnostic ignored \"-Wdisabled-macro-expansion\"") |
| 3333 | #else |
| 3334 | #define SIMDE_DIAGNOSTIC_DISABLE_DISABLED_MACRO_EXPANSION_ |
| 3335 | #endif |
| 3336 | |
| 3337 | /* Clang uses C11 generic selections to implement some AltiVec |
| 3338 | * functions, which triggers this diagnostic when not compiling |
| 3339 | * in C11 mode */ |
| 3340 | #if HEDLEY_HAS_WARNING("-Wc11-extensions") |
| 3341 | #define SIMDE_DIAGNOSTIC_DISABLE_C11_EXTENSIONS_ _Pragma("clang diagnostic ignored \"-Wc11-extensions\"") |
| 3342 | #else |
| 3343 | #define SIMDE_DIAGNOSTIC_DISABLE_C11_EXTENSIONS_ |
| 3344 | #endif |
| 3345 | |
| 3346 | /* Clang sometimes triggers this warning in macros in the AltiVec and |
| 3347 | * NEON headers, or due to missing functions. */ |
| 3348 | #if HEDLEY_HAS_WARNING("-Wvector-conversion") |
| 3349 | #define SIMDE_DIAGNOSTIC_DISABLE_VECTOR_CONVERSION_ _Pragma("clang diagnostic ignored \"-Wvector-conversion\"") |
| 3350 | /* For NEON, the situation with -Wvector-conversion in clang < 10 is |
| 3351 | * bad enough that we just disable the warning altogether. On x86, |
| 3352 | * clang has similar issues on several sse4.2+ intrinsics before 3.8. */ |
| 3353 | #if \ |
| 3354 | (defined(SIMDE_ARCH_ARM) && SIMDE_DETECT_CLANG_VERSION_NOT(10,0,0)) || \ |
| 3355 | SIMDE_DETECT_CLANG_VERSION_NOT(3,8,0) |
| 3356 | #define SIMDE_DIAGNOSTIC_DISABLE_BUGGY_VECTOR_CONVERSION_ SIMDE_DIAGNOSTIC_DISABLE_VECTOR_CONVERSION_ |
| 3357 | #endif |
| 3358 | #else |
| 3359 | #define SIMDE_DIAGNOSTIC_DISABLE_VECTOR_CONVERSION_ |
| 3360 | #endif |
| 3361 | #if !defined(SIMDE_DIAGNOSTIC_DISABLE_BUGGY_VECTOR_CONVERSION_) |
| 3362 | #define SIMDE_DIAGNOSTIC_DISABLE_BUGGY_VECTOR_CONVERSION_ |
| 3363 | #endif |
| 3364 | |
| 3365 | /* Prior to 5.0, clang didn't support disabling diagnostics in |
| 3366 | * statement exprs. As a result, some macros we use don't |
| 3367 | * properly silence warnings. */ |
| 3368 | #if SIMDE_DETECT_CLANG_VERSION_NOT(5,0,0) && HEDLEY_HAS_WARNING("-Wcast-qual") && HEDLEY_HAS_WARNING("-Wcast-align") |
| 3369 | #define SIMDE_DIAGNOSTIC_DISABLE_BUGGY_CASTS_ _Pragma("clang diagnostic ignored \"-Wcast-qual\"") _Pragma("clang diagnostic ignored \"-Wcast-align\"") |
| 3370 | #elif SIMDE_DETECT_CLANG_VERSION_NOT(5,0,0) && HEDLEY_HAS_WARNING("-Wcast-qual") |
| 3371 | #define SIMDE_DIAGNOSTIC_DISABLE_BUGGY_CASTS_ _Pragma("clang diagnostic ignored \"-Wcast-qual\"") |
| 3372 | #elif SIMDE_DETECT_CLANG_VERSION_NOT(5,0,0) && HEDLEY_HAS_WARNING("-Wcast-align") |
| 3373 | #define SIMDE_DIAGNOSTIC_DISABLE_BUGGY_CASTS_ _Pragma("clang diagnostic ignored \"-Wcast-align\"") |
| 3374 | #else |
| 3375 | #define SIMDE_DIAGNOSTIC_DISABLE_BUGGY_CASTS_ |
| 3376 | #endif |
| 3377 | |
| 3378 | /* SLEEF triggers this a *lot* in their headers */ |
| 3379 | #if HEDLEY_HAS_WARNING("-Wignored-qualifiers") |
| 3380 | #define SIMDE_DIAGNOSTIC_DISABLE_IGNORED_QUALIFIERS_ _Pragma("clang diagnostic ignored \"-Wignored-qualifiers\"") |
| 3381 | #elif HEDLEY_GCC_VERSION_CHECK(4,3,0) |
| 3382 | #define SIMDE_DIAGNOSTIC_DISABLE_IGNORED_QUALIFIERS_ _Pragma("GCC diagnostic ignored \"-Wignored-qualifiers\"") |
| 3383 | #else |
| 3384 | #define SIMDE_DIAGNOSTIC_DISABLE_IGNORED_QUALIFIERS_ |
| 3385 | #endif |
| 3386 | |
| 3387 | /* GCC emits this under some circumstances when using __int128 */ |
| 3388 | #if HEDLEY_GCC_VERSION_CHECK(4,8,0) |
| 3389 | #define SIMDE_DIAGNOSTIC_DISABLE_PEDANTIC_ _Pragma("GCC diagnostic ignored \"-Wpedantic\"") |
| 3390 | #else |
| 3391 | #define SIMDE_DIAGNOSTIC_DISABLE_PEDANTIC_ |
| 3392 | #endif |
| 3393 | |
| 3394 | /* MSVC doesn't like (__assume(0), code) and will warn about code being |
| 3395 | * unreachable, but we want it there because not all compilers |
| 3396 | * understand the unreachable macro and will complain if it is missing. |
| 3397 | * I'm planning on adding a new macro to Hedley to handle this a bit |
| 3398 | * more elegantly, but until then... */ |
| 3399 | #if defined(HEDLEY_MSVC_VERSION) |
| 3400 | #define SIMDE_DIAGNOSTIC_DISABLE_UNREACHABLE_ __pragma(warning(disable:4702)) |
| 3401 | #elif defined(__clang__) |
| 3402 | #define SIMDE_DIAGNOSTIC_DISABLE_UNREACHABLE_ HEDLEY_PRAGMA(clang diagnostic ignored "-Wunreachable-code") |
| 3403 | #else |
| 3404 | #define SIMDE_DIAGNOSTIC_DISABLE_UNREACHABLE_ |
| 3405 | #endif |
| 3406 | |
| 3407 | /* This is a false positive from GCC in a few places. */ |
| 3408 | #if HEDLEY_GCC_VERSION_CHECK(4,7,0) |
| 3409 | #define SIMDE_DIAGNOSTIC_DISABLE_MAYBE_UNINITIAZILED_ _Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") |
| 3410 | #else |
| 3411 | #define SIMDE_DIAGNOSTIC_DISABLE_MAYBE_UNINITIAZILED_ |
| 3412 | #endif |
| 3413 | |
| 3414 | #if defined(SIMDE_ENABLE_NATIVE_ALIASES) |
| 3415 | #define SIMDE_DISABLE_UNWANTED_DIAGNOSTICS_NATIVE_ALIASES_ \ |
| 3416 | SIMDE_DIAGNOSTIC_DISABLE_RESERVED_ID_MACRO_ |
| 3417 | #else |
| 3418 | #define SIMDE_DISABLE_UNWANTED_DIAGNOSTICS_NATIVE_ALIASES_ |
| 3419 | #endif |
| 3420 | |
| 3421 | /* Some native functions on E2K with instruction set < v6 are declared |
| 3422 | * as deprecated due to inefficiency. Still they are more efficient |
| 3423 | * than SIMDe implementation. So we're using them, and switching off |
| 3424 | * these deprecation warnings. */ |
| 3425 | #if defined(HEDLEY_MCST_LCC_VERSION) |
| 3426 | # define SIMDE_LCC_DISABLE_DEPRECATED_WARNINGS _Pragma("diag_suppress 1215,1444") |
| 3427 | # define SIMDE_LCC_REVERT_DEPRECATED_WARNINGS _Pragma("diag_default 1215,1444") |
| 3428 | #else |
| 3429 | # define SIMDE_LCC_DISABLE_DEPRECATED_WARNINGS |
| 3430 | # define SIMDE_LCC_REVERT_DEPRECATED_WARNINGS |
| 3431 | #endif |
| 3432 | |
| 3433 | #define SIMDE_DISABLE_UNWANTED_DIAGNOSTICS \ |
| 3434 | HEDLEY_DIAGNOSTIC_DISABLE_UNUSED_FUNCTION \ |
| 3435 | SIMDE_DISABLE_UNWANTED_DIAGNOSTICS_NATIVE_ALIASES_ \ |
| 3436 | SIMDE_DIAGNOSTIC_DISABLE_PSABI_ \ |
| 3437 | SIMDE_DIAGNOSTIC_DISABLE_NO_EMMS_INSTRUCTION_ \ |
| 3438 | SIMDE_DIAGNOSTIC_DISABLE_SIMD_PRAGMA_DEPRECATED_ \ |
| 3439 | SIMDE_DIAGNOSTIC_DISABLE_CONDITIONAL_UNINITIALIZED_ \ |
| 3440 | SIMDE_DIAGNOSTIC_DISABLE_DECLARATION_AFTER_STATEMENT_ \ |
| 3441 | SIMDE_DIAGNOSTIC_DISABLE_FLOAT_EQUAL_ \ |
| 3442 | SIMDE_DIAGNOSTIC_DISABLE_NON_CONSTANT_AGGREGATE_INITIALIZER_ \ |
| 3443 | SIMDE_DIAGNOSTIC_DISABLE_EXTRA_SEMI_ \ |
| 3444 | SIMDE_DIAGNOSTIC_DISABLE_VLA_ \ |
| 3445 | SIMDE_DIAGNOSTIC_DISABLE_USED_BUT_MARKED_UNUSED_ \ |
| 3446 | SIMDE_DIAGNOSTIC_DISABLE_PASS_FAILED_ \ |
| 3447 | SIMDE_DIAGNOSTIC_DISABLE_CPP98_COMPAT_PEDANTIC_ \ |
| 3448 | SIMDE_DIAGNOSTIC_DISABLE_CPP11_LONG_LONG_ \ |
| 3449 | SIMDE_DIAGNOSTIC_DISABLE_BUGGY_UNUSED_BUT_SET_VARIBALE_ \ |
| 3450 | SIMDE_DIAGNOSTIC_DISABLE_BUGGY_CASTS_ \ |
| 3451 | SIMDE_DIAGNOSTIC_DISABLE_BUGGY_VECTOR_CONVERSION_ \ |
| 3452 | SIMDE_DIAGNOSTIC_DISABLE_RESERVED_ID_ |
| 3453 | |
| 3454 | #endif /* !defined(SIMDE_DIAGNOSTIC_H) */ |
| 3455 | /* :: End simde/simde-diagnostic.h :: */ |
| 3456 | |
| 3457 | #if !defined(SIMDE_X86_SVML_NATIVE) && !defined(SIMDE_X86_SVML_NO_NATIVE) && !defined(SIMDE_NO_NATIVE) |
| 3458 | #if defined(SIMDE_ARCH_X86_SVML) |
| 3459 | #define SIMDE_X86_SVML_NATIVE |
| 3460 | #endif |
| 3461 | #endif |
| 3462 | |
| 3463 | #if !defined(SIMDE_X86_AVX512VP2INTERSECT_NATIVE) && !defined(SIMDE_X86_AVX512VP2INTERSECT_NO_NATIVE) && !defined(SIMDE_NO_NATIVE) |
| 3464 | #if defined(SIMDE_ARCH_X86_AVX512VP2INTERSECT) |
| 3465 | #define SIMDE_X86_AVX512VP2INTERSECT_NATIVE |
| 3466 | #endif |
| 3467 | #endif |
| 3468 | #if defined(SIMDE_X86_AVX512VP2INTERSECT_NATIVE) && !defined(SIMDE_X86_AVX512F_NATIVE) |
| 3469 | #define SIMDE_X86_AVX512F_NATIVE |
| 3470 | #endif |
| 3471 | |
| 3472 | #if !defined(SIMDE_X86_AVX512VPOPCNTDQ_NATIVE) && !defined(SIMDE_X86_AVX512VPOPCNTDQ_NO_NATIVE) && !defined(SIMDE_NO_NATIVE) |
| 3473 | #if defined(SIMDE_ARCH_X86_AVX512VPOPCNTDQ) |
| 3474 | #define SIMDE_X86_AVX512VPOPCNTDQ_NATIVE |
| 3475 | #endif |
| 3476 | #endif |
| 3477 | #if defined(SIMDE_X86_AVX512VPOPCNTDQ_NATIVE) && !defined(SIMDE_X86_AVX512F_NATIVE) |
| 3478 | #define SIMDE_X86_AVX512F_NATIVE |
| 3479 | #endif |
| 3480 | |
| 3481 | #if !defined(SIMDE_X86_AVX512BITALG_NATIVE) && !defined(SIMDE_X86_AVX512BITALG_NO_NATIVE) && !defined(SIMDE_NO_NATIVE) |
| 3482 | #if defined(SIMDE_ARCH_X86_AVX512BITALG) |
| 3483 | #define SIMDE_X86_AVX512BITALG_NATIVE |
| 3484 | #endif |
| 3485 | #endif |
| 3486 | #if defined(SIMDE_X86_AVX512BITALG_NATIVE) && !defined(SIMDE_X86_AVX512F_NATIVE) |
| 3487 | #define SIMDE_X86_AVX512F_NATIVE |
| 3488 | #endif |
| 3489 | |
| 3490 | #if !defined(SIMDE_X86_AVX512VBMI_NATIVE) && !defined(SIMDE_X86_AVX512VBMI_NO_NATIVE) && !defined(SIMDE_NO_NATIVE) |
| 3491 | #if defined(SIMDE_ARCH_X86_AVX512VBMI) |
| 3492 | #define SIMDE_X86_AVX512VBMI_NATIVE |
| 3493 | #endif |
| 3494 | #endif |
| 3495 | #if defined(SIMDE_X86_AVX512VBMI_NATIVE) && !defined(SIMDE_X86_AVX512F_NATIVE) |
| 3496 | #define SIMDE_X86_AVX512F_NATIVE |
| 3497 | #endif |
| 3498 | |
| 3499 | #if !defined(SIMDE_X86_AVX512VBMI2_NATIVE) && !defined(SIMDE_X86_AVX512VBMI2_NO_NATIVE) && !defined(SIMDE_NO_NATIVE) |
| 3500 | #if defined(SIMDE_ARCH_X86_AVX512VBMI2) |
| 3501 | #define SIMDE_X86_AVX512VBMI2_NATIVE |
| 3502 | #endif |
| 3503 | #endif |
| 3504 | #if defined(SIMDE_X86_AVX512VBMI2_NATIVE) && !defined(SIMDE_X86_AVX512F_NATIVE) |
| 3505 | #define SIMDE_X86_AVX512F_NATIVE |
| 3506 | #endif |
| 3507 | |
| 3508 | #if !defined(SIMDE_X86_AVX512VNNI_NATIVE) && !defined(SIMDE_X86_AVX512VNNI_NO_NATIVE) && !defined(SIMDE_NO_NATIVE) |
| 3509 | #if defined(SIMDE_ARCH_X86_AVX512VNNI) |
| 3510 | #define SIMDE_X86_AVX512VNNI_NATIVE |
| 3511 | #endif |
| 3512 | #endif |
| 3513 | #if defined(SIMDE_X86_AVX512VNNI_NATIVE) && !defined(SIMDE_X86_AVX512F_NATIVE) |
| 3514 | #define SIMDE_X86_AVX512F_NATIVE |
| 3515 | #endif |
| 3516 | |
| 3517 | #if !defined(SIMDE_X86_AVX5124VNNIW_NATIVE) && !defined(SIMDE_X86_AVX5124VNNIW_NO_NATIVE) && !defined(SIMDE_NO_NATIVE) |
| 3518 | #if defined(SIMDE_ARCH_X86_AVX5124VNNIW) |
| 3519 | #define SIMDE_X86_AVX5124VNNIW_NATIVE |
| 3520 | #endif |
| 3521 | #endif |
| 3522 | #if defined(SIMDE_X86_AVX5124VNNIW_NATIVE) && !defined(SIMDE_X86_AVX512F_NATIVE) |
| 3523 | #define SIMDE_X86_AVX512F_NATIVE |
| 3524 | #endif |
| 3525 | |
| 3526 | #if !defined(SIMDE_X86_AVX512CD_NATIVE) && !defined(SIMDE_X86_AVX512CD_NO_NATIVE) && !defined(SIMDE_NO_NATIVE) |
| 3527 | #if defined(SIMDE_ARCH_X86_AVX512CD) |
| 3528 | #define SIMDE_X86_AVX512CD_NATIVE |
| 3529 | #endif |
| 3530 | #endif |
| 3531 | #if defined(SIMDE_X86_AVX512CD_NATIVE) && !defined(SIMDE_X86_AVX512F_NATIVE) |
| 3532 | #define SIMDE_X86_AVX512F_NATIVE |
| 3533 | #endif |
| 3534 | |
| 3535 | #if !defined(SIMDE_X86_AVX512DQ_NATIVE) && !defined(SIMDE_X86_AVX512DQ_NO_NATIVE) && !defined(SIMDE_NO_NATIVE) |
| 3536 | #if defined(SIMDE_ARCH_X86_AVX512DQ) |
| 3537 | #define SIMDE_X86_AVX512DQ_NATIVE |
| 3538 | #endif |
| 3539 | #endif |
| 3540 | #if defined(SIMDE_X86_AVX512DQ_NATIVE) && !defined(SIMDE_X86_AVX512F_NATIVE) |
| 3541 | #define SIMDE_X86_AVX512F_NATIVE |
| 3542 | #endif |
| 3543 | |
| 3544 | #if !defined(SIMDE_X86_AVX512VL_NATIVE) && !defined(SIMDE_X86_AVX512VL_NO_NATIVE) && !defined(SIMDE_NO_NATIVE) |
| 3545 | #if defined(SIMDE_ARCH_X86_AVX512VL) |
| 3546 | #define SIMDE_X86_AVX512VL_NATIVE |
| 3547 | #endif |
| 3548 | #endif |
| 3549 | #if defined(SIMDE_X86_AVX512VL_NATIVE) && !defined(SIMDE_X86_AVX512F_NATIVE) |
| 3550 | #define SIMDE_X86_AVX512F_NATIVE |
| 3551 | #endif |
| 3552 | |
| 3553 | #if !defined(SIMDE_X86_AVX512BW_NATIVE) && !defined(SIMDE_X86_AVX512BW_NO_NATIVE) && !defined(SIMDE_NO_NATIVE) |
| 3554 | #if defined(SIMDE_ARCH_X86_AVX512BW) |
| 3555 | #define SIMDE_X86_AVX512BW_NATIVE |
| 3556 | #endif |
| 3557 | #endif |
| 3558 | #if defined(SIMDE_X86_AVX512BW_NATIVE) && !defined(SIMDE_X86_AVX512F_NATIVE) |
| 3559 | #define SIMDE_X86_AVX512F_NATIVE |
| 3560 | #endif |
| 3561 | |
| 3562 | #if !defined(SIMDE_X86_AVX512FP16_NATIVE) && !defined(SIMDE_X86_AVX512FP16_NO_NATIVE) && !defined(SIMDE_NO_NATIVE) |
| 3563 | #if defined(SIMDE_ARCH_X86_AVX512FP16) |
| 3564 | #define SIMDE_X86_AVX512FP16_NATIVE |
| 3565 | #endif |
| 3566 | #endif |
| 3567 | #if defined(SIMDE_X86_AVX512BW_NATIVE) && !defined(SIMDE_X86_AVX512F_NATIVE) |
| 3568 | #define SIMDE_X86_AVX512F_NATIVE |
| 3569 | #endif |
| 3570 | |
| 3571 | #if !defined(SIMDE_X86_AVX512BF16_NATIVE) && !defined(SIMDE_X86_AVX512BF16_NO_NATIVE) && !defined(SIMDE_NO_NATIVE) |
| 3572 | #if defined(SIMDE_ARCH_X86_AVX512BF16) |
| 3573 | #define SIMDE_X86_AVX512BF16_NATIVE |
| 3574 | #endif |
| 3575 | #endif |
| 3576 | #if defined(SIMDE_X86_AVX512BF16_NATIVE) && !defined(SIMDE_X86_AVX512F_NATIVE) |
| 3577 | #define SIMDE_X86_AVX512F_NATIVE |
| 3578 | #endif |
| 3579 | |
| 3580 | #if !defined(SIMDE_X86_AVX512F_NATIVE) && !defined(SIMDE_X86_AVX512F_NO_NATIVE) && !defined(SIMDE_NO_NATIVE) |
| 3581 | #if defined(SIMDE_ARCH_X86_AVX512F) |
| 3582 | #define SIMDE_X86_AVX512F_NATIVE |
| 3583 | #endif |
| 3584 | #endif |
| 3585 | #if defined(SIMDE_X86_AVX512F_NATIVE) && !defined(SIMDE_X86_AVX2_NATIVE) |
| 3586 | #define SIMDE_X86_AVX2_NATIVE |
| 3587 | #endif |
| 3588 | |
| 3589 | #if !defined(SIMDE_X86_FMA_NATIVE) && !defined(SIMDE_X86_FMA_NO_NATIVE) && !defined(SIMDE_NO_NATIVE) |
| 3590 | #if defined(SIMDE_ARCH_X86_FMA) |
| 3591 | #define SIMDE_X86_FMA_NATIVE |
| 3592 | #endif |
| 3593 | #endif |
| 3594 | #if defined(SIMDE_X86_FMA_NATIVE) && !defined(SIMDE_X86_AVX_NATIVE) |
| 3595 | #define SIMDE_X86_AVX_NATIVE |
| 3596 | #endif |
| 3597 | |
| 3598 | #if !defined(SIMDE_X86_AVX2_NATIVE) && !defined(SIMDE_X86_AVX2_NO_NATIVE) && !defined(SIMDE_NO_NATIVE) |
| 3599 | #if defined(SIMDE_ARCH_X86_AVX2) |
| 3600 | #define SIMDE_X86_AVX2_NATIVE |
| 3601 | #endif |
| 3602 | #endif |
| 3603 | #if defined(SIMDE_X86_AVX2_NATIVE) && !defined(SIMDE_X86_AVX_NATIVE) |
| 3604 | #define SIMDE_X86_AVX_NATIVE |
| 3605 | #endif |
| 3606 | |
| 3607 | #if !defined(SIMDE_X86_AVX_NATIVE) && !defined(SIMDE_X86_AVX_NO_NATIVE) && !defined(SIMDE_NO_NATIVE) |
| 3608 | #if defined(SIMDE_ARCH_X86_AVX) |
| 3609 | #define SIMDE_X86_AVX_NATIVE |
| 3610 | #endif |
| 3611 | #endif |
| 3612 | #if defined(SIMDE_X86_AVX_NATIVE) && !defined(SIMDE_X86_SSE4_2_NATIVE) |
| 3613 | #define SIMDE_X86_SSE4_2_NATIVE |
| 3614 | #endif |
| 3615 | |
| 3616 | #if !defined(SIMDE_X86_XOP_NATIVE) && !defined(SIMDE_X86_XOP_NO_NATIVE) && !defined(SIMDE_NO_NATIVE) |
| 3617 | #if defined(SIMDE_ARCH_X86_XOP) |
| 3618 | #define SIMDE_X86_XOP_NATIVE |
| 3619 | #endif |
| 3620 | #endif |
| 3621 | #if defined(SIMDE_X86_XOP_NATIVE) && !defined(SIMDE_X86_SSE4_2_NATIVE) |
| 3622 | #define SIMDE_X86_SSE4_2_NATIVE |
| 3623 | #endif |
| 3624 | |
| 3625 | #if !defined(SIMDE_X86_SSE4_2_NATIVE) && !defined(SIMDE_X86_SSE4_2_NO_NATIVE) && !defined(SIMDE_NO_NATIVE) |
| 3626 | #if defined(SIMDE_ARCH_X86_SSE4_2) |
| 3627 | #define SIMDE_X86_SSE4_2_NATIVE |
| 3628 | #endif |
| 3629 | #endif |
| 3630 | #if defined(SIMDE_X86_SSE4_2_NATIVE) && !defined(SIMDE_X86_SSE4_1_NATIVE) |
| 3631 | #define SIMDE_X86_SSE4_1_NATIVE |
| 3632 | #endif |
| 3633 | |
| 3634 | #if !defined(SIMDE_X86_SSE4_1_NATIVE) && !defined(SIMDE_X86_SSE4_1_NO_NATIVE) && !defined(SIMDE_NO_NATIVE) |
| 3635 | #if defined(SIMDE_ARCH_X86_SSE4_1) |
| 3636 | #define SIMDE_X86_SSE4_1_NATIVE |
| 3637 | #endif |
| 3638 | #endif |
| 3639 | #if defined(SIMDE_X86_SSE4_1_NATIVE) && !defined(SIMDE_X86_SSSE3_NATIVE) |
| 3640 | #define SIMDE_X86_SSSE3_NATIVE |
| 3641 | #endif |
| 3642 | |
| 3643 | #if !defined(SIMDE_X86_SSSE3_NATIVE) && !defined(SIMDE_X86_SSSE3_NO_NATIVE) && !defined(SIMDE_NO_NATIVE) |
| 3644 | #if defined(SIMDE_ARCH_X86_SSSE3) |
| 3645 | #define SIMDE_X86_SSSE3_NATIVE |
| 3646 | #endif |
| 3647 | #endif |
| 3648 | #if defined(SIMDE_X86_SSSE3_NATIVE) && !defined(SIMDE_X86_SSE3_NATIVE) |
| 3649 | #define SIMDE_X86_SSE3_NATIVE |
| 3650 | #endif |
| 3651 | |
| 3652 | #if !defined(SIMDE_X86_SSE3_NATIVE) && !defined(SIMDE_X86_SSE3_NO_NATIVE) && !defined(SIMDE_NO_NATIVE) |
| 3653 | #if defined(SIMDE_ARCH_X86_SSE3) |
| 3654 | #define SIMDE_X86_SSE3_NATIVE |
| 3655 | #endif |
| 3656 | #endif |
| 3657 | #if defined(SIMDE_X86_SSE3_NATIVE) && !defined(SIMDE_X86_SSE2_NATIVE) |
| 3658 | #define SIMDE_X86_SSE2_NATIVE |
| 3659 | #endif |
| 3660 | |
| 3661 | #if !defined(SIMDE_X86_AES_NATIVE) && !defined(SIMDE_X86_AES_NO_NATIVE) && !defined(SIMDE_NO_NATIVE) |
| 3662 | #if defined(SIMDE_ARCH_X86_AES) |
| 3663 | #define SIMDE_X86_AES_NATIVE |
| 3664 | #endif |
| 3665 | #endif |
| 3666 | #if defined(SIMDE_X86_AES_NATIVE) && !defined(SIMDE_X86_SSE2_NATIVE) |
| 3667 | #define SIMDE_X86_SSE2_NATIVE |
| 3668 | #endif |
| 3669 | |
| 3670 | #if !defined(SIMDE_X86_SSE2_NATIVE) && !defined(SIMDE_X86_SSE2_NO_NATIVE) && !defined(SIMDE_NO_NATIVE) |
| 3671 | #if defined(SIMDE_ARCH_X86_SSE2) |
| 3672 | #define SIMDE_X86_SSE2_NATIVE |
| 3673 | #endif |
| 3674 | #endif |
| 3675 | #if defined(SIMDE_X86_SSE2_NATIVE) && !defined(SIMDE_X86_SSE_NATIVE) |
| 3676 | #define SIMDE_X86_SSE_NATIVE |
| 3677 | #endif |
| 3678 | |
| 3679 | #if !defined(SIMDE_X86_SSE_NATIVE) && !defined(SIMDE_X86_SSE_NO_NATIVE) && !defined(SIMDE_NO_NATIVE) |
| 3680 | #if defined(SIMDE_ARCH_X86_SSE) |
| 3681 | #define SIMDE_X86_SSE_NATIVE |
| 3682 | #endif |
| 3683 | #endif |
| 3684 | |
| 3685 | #if !defined(SIMDE_X86_MMX_NATIVE) && !defined(SIMDE_X86_MMX_NO_NATIVE) && !defined(SIMDE_NO_NATIVE) |
| 3686 | #if defined(SIMDE_ARCH_X86_MMX) |
| 3687 | #define SIMDE_X86_MMX_NATIVE |
| 3688 | #endif |
| 3689 | #endif |
| 3690 | |
| 3691 | #if !defined(SIMDE_X86_GFNI_NATIVE) && !defined(SIMDE_X86_GFNI_NO_NATIVE) && !defined(SIMDE_NO_NATIVE) |
| 3692 | #if defined(SIMDE_ARCH_X86_GFNI) |
| 3693 | #define SIMDE_X86_GFNI_NATIVE |
| 3694 | #endif |
| 3695 | #endif |
| 3696 | |
| 3697 | #if !defined(SIMDE_X86_PCLMUL_NATIVE) && !defined(SIMDE_X86_PCLMUL_NO_NATIVE) && !defined(SIMDE_NO_NATIVE) |
| 3698 | #if defined(SIMDE_ARCH_X86_PCLMUL) |
| 3699 | #define SIMDE_X86_PCLMUL_NATIVE |
| 3700 | #endif |
| 3701 | #endif |
| 3702 | |
| 3703 | #if !defined(SIMDE_X86_VPCLMULQDQ_NATIVE) && !defined(SIMDE_X86_VPCLMULQDQ_NO_NATIVE) && !defined(SIMDE_NO_NATIVE) |
| 3704 | #if defined(SIMDE_ARCH_X86_VPCLMULQDQ) |
| 3705 | #define SIMDE_X86_VPCLMULQDQ_NATIVE |
| 3706 | #endif |
| 3707 | #endif |
| 3708 | |
| 3709 | #if !defined(SIMDE_X86_F16C_NATIVE) && !defined(SIMDE_X86_F16C_NO_NATIVE) && !defined(SIMDE_NO_NATIVE) |
| 3710 | #if defined(SIMDE_ARCH_X86_F16C) |
| 3711 | #define SIMDE_X86_F16C_NATIVE |
| 3712 | #endif |
| 3713 | #endif |
| 3714 | |
| 3715 | #if !defined(SIMDE_X86_SVML_NATIVE) && !defined(SIMDE_X86_SVML_NO_NATIVE) && !defined(SIMDE_NO_NATIVE) |
| 3716 | #if defined(SIMDE_ARCH_X86) && (defined(__INTEL_COMPILER) || (HEDLEY_MSVC_VERSION_CHECK(14, 20, 0) && !defined(__clang__))) |
| 3717 | #define SIMDE_X86_SVML_NATIVE |
| 3718 | #endif |
| 3719 | #endif |
| 3720 | |
| 3721 | #if defined(HEDLEY_MSVC_VERSION) |
| 3722 | #pragma warning(push) |
| 3723 | #pragma warning(disable:4799) |
| 3724 | #endif |
| 3725 | |
| 3726 | #if \ |
| 3727 | defined(SIMDE_X86_AVX_NATIVE) || defined(SIMDE_X86_GFNI_NATIVE) || defined(SIMDE_X86_SVML_NATIVE) |
| 3728 | #include <immintrin.h> |
| 3729 | #elif defined(SIMDE_X86_SSE4_2_NATIVE) |
| 3730 | #include <nmmintrin.h> |
| 3731 | #elif defined(SIMDE_X86_SSE4_1_NATIVE) |
| 3732 | #include <smmintrin.h> |
| 3733 | #elif defined(SIMDE_X86_SSSE3_NATIVE) |
| 3734 | #include <tmmintrin.h> |
| 3735 | #elif defined(SIMDE_X86_SSE3_NATIVE) |
| 3736 | #include <pmmintrin.h> |
| 3737 | #elif defined(SIMDE_X86_SSE2_NATIVE) |
| 3738 | #include <emmintrin.h> |
| 3739 | #elif defined(SIMDE_X86_SSE_NATIVE) |
| 3740 | #include <xmmintrin.h> |
| 3741 | #elif defined(SIMDE_X86_MMX_NATIVE) |
| 3742 | #include <mmintrin.h> |
| 3743 | #endif |
| 3744 | |
| 3745 | #if defined(SIMDE_X86_XOP_NATIVE) |
| 3746 | #if defined(_MSC_VER) |
| 3747 | #include <intrin.h> |
| 3748 | #else |
| 3749 | #include <x86intrin.h> |
| 3750 | #endif |
| 3751 | #endif |
| 3752 | |
| 3753 | #if defined(SIMDE_X86_AES_NATIVE) |
| 3754 | #include <wmmintrin.h> |
| 3755 | #endif |
| 3756 | |
| 3757 | #if defined(HEDLEY_MSVC_VERSION) |
| 3758 | #pragma warning(pop) |
| 3759 | #endif |
| 3760 | |
| 3761 | #if !defined(SIMDE_ARM_NEON_A64V8_NATIVE) && !defined(SIMDE_ARM_NEON_A64V8_NO_NATIVE) && !defined(SIMDE_NO_NATIVE) |
| 3762 | #if defined(SIMDE_ARCH_ARM_NEON) && defined(SIMDE_ARCH_AARCH64) && SIMDE_ARCH_ARM_CHECK(8,0) |
| 3763 | #define SIMDE_ARM_NEON_A64V8_NATIVE |
| 3764 | #endif |
| 3765 | #endif |
| 3766 | #if defined(SIMDE_ARM_NEON_A64V8_NATIVE) && !defined(SIMDE_ARM_NEON_A32V8_NATIVE) |
| 3767 | #define SIMDE_ARM_NEON_A32V8_NATIVE |
| 3768 | #endif |
| 3769 | |
| 3770 | #if !defined(SIMDE_ARM_NEON_A32V8_NATIVE) && !defined(SIMDE_ARM_NEON_A32V8_NO_NATIVE) && !defined(SIMDE_NO_NATIVE) |
| 3771 | #if defined(SIMDE_ARCH_ARM_NEON) && SIMDE_ARCH_ARM_CHECK(8,0) && (__ARM_NEON_FP & 0x02) |
| 3772 | #define SIMDE_ARM_NEON_A32V8_NATIVE |
| 3773 | #endif |
| 3774 | #endif |
| 3775 | #if defined(__ARM_ACLE) |
| 3776 | #include <arm_acle.h> |
| 3777 | #endif |
| 3778 | #if defined(SIMDE_ARM_NEON_A32V8_NATIVE) && !defined(SIMDE_ARM_NEON_A32V7_NATIVE) |
| 3779 | #define SIMDE_ARM_NEON_A32V7_NATIVE |
| 3780 | #endif |
| 3781 | |
| 3782 | #if !defined(SIMDE_ARM_NEON_A32V7_NATIVE) && !defined(SIMDE_ARM_NEON_A32V7_NO_NATIVE) && !defined(SIMDE_NO_NATIVE) |
| 3783 | #if defined(SIMDE_ARCH_ARM_NEON) && SIMDE_ARCH_ARM_CHECK(7,0) |
| 3784 | #define SIMDE_ARM_NEON_A32V7_NATIVE |
| 3785 | #endif |
| 3786 | #endif |
| 3787 | #if defined(SIMDE_ARM_NEON_A32V7_NATIVE) |
| 3788 | #include <arm_neon.h> |
| 3789 | #if defined(__ARM_FEATURE_FP16_VECTOR_ARITHMETIC) |
| 3790 | #include <arm_fp16.h> |
| 3791 | #endif |
| 3792 | #endif |
| 3793 | |
| 3794 | #if !defined(SIMDE_ARM_SVE_NATIVE) && !defined(SIMDE_ARM_SVE_NO_NATIVE) && !defined(SIMDE_NO_NATIVE) |
| 3795 | #if defined(SIMDE_ARCH_ARM_SVE) |
| 3796 | #define SIMDE_ARM_SVE_NATIVE |
| 3797 | #include <arm_sve.h> |
| 3798 | #endif |
| 3799 | #endif |
| 3800 | |
| 3801 | #if !defined(SIMDE_RISCV_V_NATIVE) && !defined(SIMDE_RISCV_V_NO_NATIVE) && !defined(SIMDE_NO_NATIVE) |
| 3802 | #if defined(SIMDE_ARCH_RISCV_V) |
| 3803 | #define SIMDE_RISCV_V_NATIVE |
| 3804 | #endif |
| 3805 | #endif |
| 3806 | #if defined(SIMDE_RISCV_V_NATIVE) |
| 3807 | #include <riscv_vector.h> |
| 3808 | #endif |
| 3809 | |
| 3810 | #if !defined(SIMDE_WASM_SIMD128_NATIVE) && !defined(SIMDE_WASM_SIMD128_NO_NATIVE) && !defined(SIMDE_NO_NATIVE) |
| 3811 | #if defined(SIMDE_ARCH_WASM_SIMD128) |
| 3812 | #define SIMDE_WASM_SIMD128_NATIVE |
| 3813 | #endif |
| 3814 | #endif |
| 3815 | |
| 3816 | #if !defined(SIMDE_WASM_RELAXED_SIMD_NATIVE) && !defined(SIMDE_WASM_RELAXED_SIMD_NO_NATIVE) && !defined(SIMDE_NO_NATIVE) |
| 3817 | #if defined(SIMDE_ARCH_WASM_RELAXED_SIMD) |
| 3818 | #define SIMDE_WASM_RELAXED_SIMD_NATIVE |
| 3819 | #endif |
| 3820 | #endif |
| 3821 | #if defined(SIMDE_WASM_SIMD128_NATIVE) || defined(SIMDE_WASM_RELAXED_SIMD_NATIVE) |
| 3822 | #include <wasm_simd128.h> |
| 3823 | #endif |
| 3824 | |
| 3825 | #if !defined(SIMDE_POWER_ALTIVEC_P9_NATIVE) && !defined(SIMDE_POWER_ALTIVEC_P9_NO_NATIVE) && !defined(SIMDE_NO_NATIVE) |
| 3826 | #if SIMDE_ARCH_POWER_ALTIVEC_CHECK(900) |
| 3827 | #define SIMDE_POWER_ALTIVEC_P9_NATIVE |
| 3828 | #endif |
| 3829 | #endif |
| 3830 | #if defined(SIMDE_POWER_ALTIVEC_P9_NATIVE) && !defined(SIMDE_POWER_ALTIVEC_P8) |
| 3831 | #define SIMDE_POWER_ALTIVEC_P8_NATIVE |
| 3832 | #endif |
| 3833 | |
| 3834 | #if !defined(SIMDE_POWER_ALTIVEC_P8_NATIVE) && !defined(SIMDE_POWER_ALTIVEC_P8_NO_NATIVE) && !defined(SIMDE_NO_NATIVE) |
| 3835 | #if SIMDE_ARCH_POWER_ALTIVEC_CHECK(800) |
| 3836 | #define SIMDE_POWER_ALTIVEC_P8_NATIVE |
| 3837 | #endif |
| 3838 | #endif |
| 3839 | #if defined(SIMDE_POWER_ALTIVEC_P8_NATIVE) && !defined(SIMDE_POWER_ALTIVEC_P7) |
| 3840 | #define SIMDE_POWER_ALTIVEC_P7_NATIVE |
| 3841 | #endif |
| 3842 | |
| 3843 | #if !defined(SIMDE_POWER_ALTIVEC_P7_NATIVE) && !defined(SIMDE_POWER_ALTIVEC_P7_NO_NATIVE) && !defined(SIMDE_NO_NATIVE) |
| 3844 | #if SIMDE_ARCH_POWER_ALTIVEC_CHECK(700) |
| 3845 | #define SIMDE_POWER_ALTIVEC_P7_NATIVE |
| 3846 | #endif |
| 3847 | #endif |
| 3848 | #if defined(SIMDE_POWER_ALTIVEC_P7_NATIVE) && !defined(SIMDE_POWER_ALTIVEC_P6) |
| 3849 | #define SIMDE_POWER_ALTIVEC_P6_NATIVE |
| 3850 | #endif |
| 3851 | |
| 3852 | #if !defined(SIMDE_POWER_ALTIVEC_P6_NATIVE) && !defined(SIMDE_POWER_ALTIVEC_P6_NO_NATIVE) && !defined(SIMDE_NO_NATIVE) |
| 3853 | #if SIMDE_ARCH_POWER_ALTIVEC_CHECK(600) |
| 3854 | #define SIMDE_POWER_ALTIVEC_P6_NATIVE |
| 3855 | #endif |
| 3856 | #endif |
| 3857 | #if defined(SIMDE_POWER_ALTIVEC_P6_NATIVE) && !defined(SIMDE_POWER_ALTIVEC_P5) |
| 3858 | #define SIMDE_POWER_ALTIVEC_P5_NATIVE |
| 3859 | #endif |
| 3860 | |
| 3861 | #if !defined(SIMDE_POWER_ALTIVEC_P5_NATIVE) && !defined(SIMDE_POWER_ALTIVEC_P5_NO_NATIVE) && !defined(SIMDE_NO_NATIVE) |
| 3862 | #if SIMDE_ARCH_POWER_ALTIVEC_CHECK(500) |
| 3863 | #define SIMDE_POWER_ALTIVEC_P5_NATIVE |
| 3864 | #endif |
| 3865 | #endif |
| 3866 | |
| 3867 | #if !defined(SIMDE_ZARCH_ZVECTOR_15_NATIVE) && !defined(SIMDE_ZARCH_ZVECTOR_15_NO_NATIVE) && !defined(SIMDE_NO_NATIVE) |
| 3868 | #if SIMDE_ARCH_ZARCH_CHECK(13) && defined(SIMDE_ARCH_ZARCH_ZVECTOR) |
| 3869 | #define SIMDE_ZARCH_ZVECTOR_15_NATIVE |
| 3870 | #endif |
| 3871 | #endif |
| 3872 | |
| 3873 | #if !defined(SIMDE_ZARCH_ZVECTOR_14_NATIVE) && !defined(SIMDE_ZARCH_ZVECTOR_14_NO_NATIVE) && !defined(SIMDE_NO_NATIVE) |
| 3874 | #if SIMDE_ARCH_ZARCH_CHECK(12) && defined(SIMDE_ARCH_ZARCH_ZVECTOR) |
| 3875 | #define SIMDE_ZARCH_ZVECTOR_14_NATIVE |
| 3876 | #endif |
| 3877 | #endif |
| 3878 | |
| 3879 | #if !defined(SIMDE_ZARCH_ZVECTOR_13_NATIVE) && !defined(SIMDE_ZARCH_ZVECTOR_13_NO_NATIVE) && !defined(SIMDE_NO_NATIVE) |
| 3880 | #if SIMDE_ARCH_ZARCH_CHECK(11) && defined(SIMDE_ARCH_ZARCH_ZVECTOR) |
| 3881 | #define SIMDE_ZARCH_ZVECTOR_13_NATIVE |
| 3882 | #endif |
| 3883 | #endif |
| 3884 | |
| 3885 | #if defined(SIMDE_POWER_ALTIVEC_P6_NATIVE) || defined(SIMDE_ZARCH_ZVECTOR_13_NATIVE) |
| 3886 | /* AltiVec conflicts with lots of stuff. The bool keyword conflicts |
| 3887 | * with the bool keyword in C++ and the bool macro in C99+ (defined |
| 3888 | * in stdbool.h). The vector keyword conflicts with std::vector in |
| 3889 | * C++ if you are `using std;`. |
| 3890 | * |
| 3891 | * Luckily AltiVec allows you to use `__vector`/`__bool`/`__pixel` |
| 3892 | * instead, but altivec.h will unconditionally define |
| 3893 | * `vector`/`bool`/`pixel` so we need to work around that. |
| 3894 | * |
| 3895 | * Unfortunately this means that if your code uses AltiVec directly |
| 3896 | * it may break. If this is the case you'll want to define |
| 3897 | * `SIMDE_POWER_ALTIVEC_NO_UNDEF` before including SIMDe. Or, even |
| 3898 | * better, port your code to use the double-underscore versions. */ |
| 3899 | #if defined(bool) |
| 3900 | #undef bool |
| 3901 | #endif |
| 3902 | |
| 3903 | #if defined(SIMDE_POWER_ALTIVEC_P6_NATIVE) |
| 3904 | #include <altivec.h> |
| 3905 | |
| 3906 | #if !defined(SIMDE_POWER_ALTIVEC_NO_UNDEF) |
| 3907 | #if defined(vector) |
| 3908 | #undef vector |
| 3909 | #endif |
| 3910 | #if defined(pixel) |
| 3911 | #undef pixel |
| 3912 | #endif |
| 3913 | #if defined(bool) |
| 3914 | #undef bool |
| 3915 | #endif |
| 3916 | #endif /* !defined(SIMDE_POWER_ALTIVEC_NO_UNDEF) */ |
| 3917 | #elif defined(SIMDE_ZARCH_ZVECTOR_13_NATIVE) |
| 3918 | #include <vecintrin.h> |
| 3919 | #endif |
| 3920 | |
| 3921 | /* Use these intsead of vector/pixel/bool in SIMDe. */ |
| 3922 | #define SIMDE_POWER_ALTIVEC_VECTOR(T) __vector T |
| 3923 | #define SIMDE_POWER_ALTIVEC_PIXEL __pixel |
| 3924 | #define SIMDE_POWER_ALTIVEC_BOOL __bool |
| 3925 | |
| 3926 | /* Re-define bool if we're using stdbool.h */ |
| 3927 | #if !defined(__cplusplus) && defined(__bool_true_false_are_defined) && !defined(SIMDE_POWER_ALTIVEC_NO_UNDEF) |
| 3928 | #define bool _Bool |
| 3929 | #endif |
| 3930 | #endif |
| 3931 | |
| 3932 | #if !defined(SIMDE_MIPS_LOONGSON_MMI_NATIVE) && !defined(SIMDE_MIPS_LOONGSON_MMI_NO_NATIVE) && !defined(SIMDE_NO_NATIVE) |
| 3933 | #if defined(SIMDE_ARCH_MIPS_LOONGSON_MMI) |
| 3934 | #define SIMDE_MIPS_LOONGSON_MMI_NATIVE 1 |
| 3935 | #endif |
| 3936 | #endif |
| 3937 | #if defined(SIMDE_MIPS_LOONGSON_MMI_NATIVE) |
| 3938 | #include <loongson-mmiintrin.h> |
| 3939 | #endif |
| 3940 | |
| 3941 | #if !defined(SIMDE_MIPS_MSA_NATIVE) && !defined(SIMDE_MIPS_MSA_NO_NATIVE) && !defined(SIMDE_NO_NATIVE) |
| 3942 | #if defined(SIMDE_ARCH_MIPS_MSA) |
| 3943 | #define SIMDE_MIPS_MSA_NATIVE 1 |
| 3944 | #endif |
| 3945 | #endif |
| 3946 | #if defined(SIMDE_MIPS_MSA_NATIVE) |
| 3947 | #include <msa.h> |
| 3948 | #endif |
| 3949 | |
| 3950 | /* This is used to determine whether or not to fall back on a vector |
| 3951 | * function in an earlier ISA extensions, as well as whether |
| 3952 | * we expected any attempts at vectorization to be fruitful or if we |
| 3953 | * expect to always be running serial code. |
| 3954 | * |
| 3955 | * Note that, for some architectures (okay, *one* architecture) there |
| 3956 | * can be a split where some types are supported for one vector length |
| 3957 | * but others only for a shorter length. Therefore, it is possible to |
| 3958 | * provide separate values for float/int/double types. */ |
| 3959 | |
| 3960 | #if !defined(SIMDE_NATURAL_VECTOR_SIZE) |
| 3961 | #if defined(SIMDE_X86_AVX512F_NATIVE) |
| 3962 | #define SIMDE_NATURAL_VECTOR_SIZE (512) |
| 3963 | #elif defined(SIMDE_X86_AVX2_NATIVE) |
| 3964 | #define SIMDE_NATURAL_VECTOR_SIZE (256) |
| 3965 | #elif defined(SIMDE_X86_AVX_NATIVE) |
| 3966 | #define SIMDE_NATURAL_FLOAT_VECTOR_SIZE (256) |
| 3967 | #define SIMDE_NATURAL_INT_VECTOR_SIZE (128) |
| 3968 | #define SIMDE_NATURAL_DOUBLE_VECTOR_SIZE (128) |
| 3969 | #elif \ |
| 3970 | defined(SIMDE_X86_SSE2_NATIVE) || \ |
| 3971 | defined(SIMDE_ARM_NEON_A32V7_NATIVE) || \ |
| 3972 | defined(SIMDE_WASM_SIMD128_NATIVE) || \ |
| 3973 | defined(SIMDE_POWER_ALTIVEC_P5_NATIVE) || \ |
| 3974 | defined(SIMDE_ZARCH_ZVECTOR_13_NATIVE) || \ |
| 3975 | defined(SIMDE_MIPS_MSA_NATIVE) |
| 3976 | #define SIMDE_NATURAL_VECTOR_SIZE (128) |
| 3977 | #elif defined(SIMDE_X86_SSE_NATIVE) |
| 3978 | #define SIMDE_NATURAL_FLOAT_VECTOR_SIZE (128) |
| 3979 | #define SIMDE_NATURAL_INT_VECTOR_SIZE (64) |
| 3980 | #define SIMDE_NATURAL_DOUBLE_VECTOR_SIZE (0) |
| 3981 | #elif defined(SIMDE_RISCV_V_NATIVE) && defined(__riscv_v_fixed_vlen) |
| 3982 | //FIXME : SIMDE_NATURAL_VECTOR_SIZE == __riscv_v_fixed_vlen |
| 3983 | #define SIMDE_NATURAL_VECTOR_SIZE (128) |
| 3984 | #endif |
| 3985 | |
| 3986 | #if !defined(SIMDE_NATURAL_VECTOR_SIZE) |
| 3987 | #if defined(SIMDE_NATURAL_FLOAT_VECTOR_SIZE) |
| 3988 | #define SIMDE_NATURAL_VECTOR_SIZE SIMDE_NATURAL_FLOAT_VECTOR_SIZE |
| 3989 | #elif defined(SIMDE_NATURAL_INT_VECTOR_SIZE) |
| 3990 | #define SIMDE_NATURAL_VECTOR_SIZE SIMDE_NATURAL_INT_VECTOR_SIZE |
| 3991 | #elif defined(SIMDE_NATURAL_DOUBLE_VECTOR_SIZE) |
| 3992 | #define SIMDE_NATURAL_VECTOR_SIZE SIMDE_NATURAL_DOUBLE_VECTOR_SIZE |
| 3993 | #else |
| 3994 | #define SIMDE_NATURAL_VECTOR_SIZE (0) |
| 3995 | #endif |
| 3996 | #endif |
| 3997 | |
| 3998 | #if !defined(SIMDE_NATURAL_FLOAT_VECTOR_SIZE) |
| 3999 | #define SIMDE_NATURAL_FLOAT_VECTOR_SIZE SIMDE_NATURAL_VECTOR_SIZE |
| 4000 | #endif |
| 4001 | #if !defined(SIMDE_NATURAL_INT_VECTOR_SIZE) |
| 4002 | #define SIMDE_NATURAL_INT_VECTOR_SIZE SIMDE_NATURAL_VECTOR_SIZE |
| 4003 | #endif |
| 4004 | #if !defined(SIMDE_NATURAL_DOUBLE_VECTOR_SIZE) |
| 4005 | #define SIMDE_NATURAL_DOUBLE_VECTOR_SIZE SIMDE_NATURAL_VECTOR_SIZE |
| 4006 | #endif |
| 4007 | #endif |
| 4008 | |
| 4009 | #define SIMDE_NATURAL_VECTOR_SIZE_LE(x) ((SIMDE_NATURAL_VECTOR_SIZE > 0) && (SIMDE_NATURAL_VECTOR_SIZE <= (x))) |
| 4010 | #define SIMDE_NATURAL_VECTOR_SIZE_GE(x) ((SIMDE_NATURAL_VECTOR_SIZE > 0) && (SIMDE_NATURAL_VECTOR_SIZE >= (x))) |
| 4011 | #define SIMDE_NATURAL_FLOAT_VECTOR_SIZE_LE(x) ((SIMDE_NATURAL_FLOAT_VECTOR_SIZE > 0) && (SIMDE_NATURAL_FLOAT_VECTOR_SIZE <= (x))) |
| 4012 | #define SIMDE_NATURAL_FLOAT_VECTOR_SIZE_GE(x) ((SIMDE_NATURAL_FLOAT_VECTOR_SIZE > 0) && (SIMDE_NATURAL_FLOAT_VECTOR_SIZE >= (x))) |
| 4013 | #define SIMDE_NATURAL_INT_VECTOR_SIZE_LE(x) ((SIMDE_NATURAL_INT_VECTOR_SIZE > 0) && (SIMDE_NATURAL_INT_VECTOR_SIZE <= (x))) |
| 4014 | #define SIMDE_NATURAL_INT_VECTOR_SIZE_GE(x) ((SIMDE_NATURAL_INT_VECTOR_SIZE > 0) && (SIMDE_NATURAL_INT_VECTOR_SIZE >= (x))) |
| 4015 | #define SIMDE_NATURAL_DOUBLE_VECTOR_SIZE_LE(x) ((SIMDE_NATURAL_DOUBLE_VECTOR_SIZE > 0) && (SIMDE_NATURAL_DOUBLE_VECTOR_SIZE <= (x))) |
| 4016 | #define SIMDE_NATURAL_DOUBLE_VECTOR_SIZE_GE(x) ((SIMDE_NATURAL_DOUBLE_VECTOR_SIZE > 0) && (SIMDE_NATURAL_DOUBLE_VECTOR_SIZE >= (x))) |
| 4017 | |
| 4018 | /* Native aliases */ |
| 4019 | #if defined(SIMDE_ENABLE_NATIVE_ALIASES) |
| 4020 | #if !defined(SIMDE_X86_MMX_NATIVE) |
| 4021 | #define SIMDE_X86_MMX_ENABLE_NATIVE_ALIASES |
| 4022 | #endif |
| 4023 | #if !defined(SIMDE_X86_SSE_NATIVE) |
| 4024 | #define SIMDE_X86_SSE_ENABLE_NATIVE_ALIASES |
| 4025 | #endif |
| 4026 | #if !defined(SIMDE_X86_SSE2_NATIVE) |
| 4027 | #define SIMDE_X86_SSE2_ENABLE_NATIVE_ALIASES |
| 4028 | #endif |
| 4029 | #if !defined(SIMDE_X86_SSE3_NATIVE) |
| 4030 | #define SIMDE_X86_SSE3_ENABLE_NATIVE_ALIASES |
| 4031 | #endif |
| 4032 | #if !defined(SIMDE_X86_SSSE3_NATIVE) |
| 4033 | #define SIMDE_X86_SSSE3_ENABLE_NATIVE_ALIASES |
| 4034 | #endif |
| 4035 | #if !defined(SIMDE_X86_SSE4_1_NATIVE) |
| 4036 | #define SIMDE_X86_SSE4_1_ENABLE_NATIVE_ALIASES |
| 4037 | #endif |
| 4038 | #if !defined(SIMDE_X86_SSE4_2_NATIVE) |
| 4039 | #define SIMDE_X86_SSE4_2_ENABLE_NATIVE_ALIASES |
| 4040 | #endif |
| 4041 | #if !defined(SIMDE_X86_AVX_NATIVE) |
| 4042 | #define SIMDE_X86_AVX_ENABLE_NATIVE_ALIASES |
| 4043 | #endif |
| 4044 | #if !defined(SIMDE_X86_AVX2_NATIVE) |
| 4045 | #define SIMDE_X86_AVX2_ENABLE_NATIVE_ALIASES |
| 4046 | #endif |
| 4047 | #if !defined(SIMDE_X86_FMA_NATIVE) |
| 4048 | #define SIMDE_X86_FMA_ENABLE_NATIVE_ALIASES |
| 4049 | #endif |
| 4050 | #if !defined(SIMDE_X86_AVX512F_NATIVE) |
| 4051 | #define SIMDE_X86_AVX512F_ENABLE_NATIVE_ALIASES |
| 4052 | #endif |
| 4053 | #if !defined(SIMDE_X86_AVX512VL_NATIVE) |
| 4054 | #define SIMDE_X86_AVX512VL_ENABLE_NATIVE_ALIASES |
| 4055 | #endif |
| 4056 | #if !defined(SIMDE_X86_AVX512VBMI_NATIVE) |
| 4057 | #define SIMDE_X86_AVX512VBMI_ENABLE_NATIVE_ALIASES |
| 4058 | #endif |
| 4059 | #if !defined(SIMDE_X86_AVX512VBMI2_NATIVE) |
| 4060 | #define SIMDE_X86_AVX512VBMI2_ENABLE_NATIVE_ALIASES |
| 4061 | #endif |
| 4062 | #if !defined(SIMDE_X86_AVX512BW_NATIVE) |
| 4063 | #define SIMDE_X86_AVX512BW_ENABLE_NATIVE_ALIASES |
| 4064 | #endif |
| 4065 | #if !defined(SIMDE_X86_AVX512VNNI_NATIVE) |
| 4066 | #define SIMDE_X86_AVX512VNNI_ENABLE_NATIVE_ALIASES |
| 4067 | #endif |
| 4068 | #if !defined(SIMDE_X86_AVX5124VNNIW_NATIVE) |
| 4069 | #define SIMDE_X86_AVX5124VNNIW_ENABLE_NATIVE_ALIASES |
| 4070 | #endif |
| 4071 | #if !defined(SIMDE_X86_AVX512BF16_NATIVE) |
| 4072 | #define SIMDE_X86_AVX512BF16_ENABLE_NATIVE_ALIASES |
| 4073 | #endif |
| 4074 | #if !defined(SIMDE_X86_AVX512BITALG_NATIVE) |
| 4075 | #define SIMDE_X86_AVX512BITALG_ENABLE_NATIVE_ALIASES |
| 4076 | #endif |
| 4077 | #if !defined(SIMDE_X86_AVX512VPOPCNTDQ_NATIVE) |
| 4078 | #define SIMDE_X86_AVX512VPOPCNTDQ_ENABLE_NATIVE_ALIASES |
| 4079 | #endif |
| 4080 | #if !defined(SIMDE_X86_AVX512VP2INTERSECT_NATIVE) |
| 4081 | #define SIMDE_X86_AVX512VP2INTERSECT_ENABLE_NATIVE_ALIASES |
| 4082 | #endif |
| 4083 | #if !defined(SIMDE_X86_AVX512DQ_NATIVE) |
| 4084 | #define SIMDE_X86_AVX512DQ_ENABLE_NATIVE_ALIASES |
| 4085 | #endif |
| 4086 | #if !defined(SIMDE_X86_AVX512CD_NATIVE) |
| 4087 | #define SIMDE_X86_AVX512CD_ENABLE_NATIVE_ALIASES |
| 4088 | #endif |
| 4089 | #if !defined(SIMDE_X86_AVX512FP16_NATIVE) |
| 4090 | #define SIMDE_X86_AVX512FP16_ENABLE_NATIVE_ALIASES |
| 4091 | #endif |
| 4092 | #if !defined(SIMDE_X86_GFNI_NATIVE) |
| 4093 | #define SIMDE_X86_GFNI_ENABLE_NATIVE_ALIASES |
| 4094 | #endif |
| 4095 | #if !defined(SIMDE_X86_PCLMUL_NATIVE) |
| 4096 | #define SIMDE_X86_PCLMUL_ENABLE_NATIVE_ALIASES |
| 4097 | #endif |
| 4098 | #if !defined(SIMDE_X86_VPCLMULQDQ_NATIVE) |
| 4099 | #define SIMDE_X86_VPCLMULQDQ_ENABLE_NATIVE_ALIASES |
| 4100 | #endif |
| 4101 | #if !defined(SIMDE_X86_F16C_NATIVE) |
| 4102 | #define SIMDE_X86_F16C_ENABLE_NATIVE_ALIASES |
| 4103 | #endif |
| 4104 | #if !defined(SIMDE_X86_AES_NATIVE) |
| 4105 | #define SIMDE_X86_AES_ENABLE_NATIVE_ALIASES |
| 4106 | #endif |
| 4107 | #if !defined(SIMDE_X86_SVML_NATIVE) |
| 4108 | #define SIMDE_X86_SVML_ENABLE_NATIVE_ALIASES |
| 4109 | #endif |
| 4110 | |
| 4111 | #if !defined(SIMDE_ARM_NEON_A32V7_NATIVE) |
| 4112 | #define SIMDE_ARM_NEON_A32V7_ENABLE_NATIVE_ALIASES |
| 4113 | #endif |
| 4114 | #if !defined(SIMDE_ARM_NEON_A32V8_NATIVE) |
| 4115 | #define SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES |
| 4116 | #endif |
| 4117 | #if !defined(SIMDE_ARM_NEON_A64V8_NATIVE) |
| 4118 | #define SIMDE_ARM_NEON_A64V8_ENABLE_NATIVE_ALIASES |
| 4119 | #endif |
| 4120 | |
| 4121 | #if !defined(SIMDE_ARM_SVE_NATIVE) |
| 4122 | #define SIMDE_ARM_SVE_ENABLE_NATIVE_ALIASES |
| 4123 | #endif |
| 4124 | |
| 4125 | #if !defined(SIMDE_RISCV_V_NATIVE) |
| 4126 | #define SIMDE_RISCV_V_ENABLE_NATIVE_ALIASES |
| 4127 | #endif |
| 4128 | |
| 4129 | #if !defined(SIMDE_MIPS_MSA_NATIVE) |
| 4130 | #define SIMDE_MIPS_MSA_ENABLE_NATIVE_ALIASES |
| 4131 | #endif |
| 4132 | |
| 4133 | #if !defined(SIMDE_WASM_SIMD128_NATIVE) |
| 4134 | #define SIMDE_WASM_SIMD128_ENABLE_NATIVE_ALIASES |
| 4135 | #endif |
| 4136 | #endif |
| 4137 | |
| 4138 | /* Are floating point values stored using IEEE 754? Knowing |
| 4139 | * this at during preprocessing is a bit tricky, mostly because what |
| 4140 | * we're curious about is how values are stored and not whether the |
| 4141 | * implementation is fully conformant in terms of rounding, NaN |
| 4142 | * handling, etc. |
| 4143 | * |
| 4144 | * For example, if you use -ffast-math or -Ofast on |
| 4145 | * GCC or clang IEEE 754 isn't strictly followed, therefore IEE 754 |
| 4146 | * support is not advertised (by defining __STDC_IEC_559__). |
| 4147 | * |
| 4148 | * However, what we care about is whether it is safe to assume that |
| 4149 | * floating point values are stored in IEEE 754 format, in which case |
| 4150 | * we can provide faster implementations of some functions. |
| 4151 | * |
| 4152 | * Luckily every vaugely modern architecture I'm aware of uses IEEE 754- |
| 4153 | * so we just assume IEEE 754 for now. There is a test which verifies |
| 4154 | * this, if that test fails sowewhere please let us know and we'll add |
| 4155 | * an exception for that platform. Meanwhile, you can define |
| 4156 | * SIMDE_NO_IEEE754_STORAGE. */ |
| 4157 | #if !defined(SIMDE_IEEE754_STORAGE) && !defined(SIMDE_NO_IEE754_STORAGE) |
| 4158 | #define SIMDE_IEEE754_STORAGE |
| 4159 | #endif |
| 4160 | |
| 4161 | #if defined(SIMDE_ARCH_ARM_NEON_FP16) |
| 4162 | #define SIMDE_ARM_NEON_FP16 |
| 4163 | #endif |
| 4164 | |
| 4165 | #if defined(SIMDE_ARCH_ARM_NEON_BF16) |
| 4166 | #define SIMDE_ARM_NEON_BF16 |
| 4167 | #endif |
| 4168 | |
| 4169 | #if !defined(SIMDE_LOONGARCH_LASX_NATIVE) && !defined(SIMDE_LOONGARCH_LASX_NO_NATIVE) && !defined(SIMDE_NO_NATIVE) |
| 4170 | #if defined(SIMDE_ARCH_LOONGARCH_LASX) |
| 4171 | #define SIMDE_LOONGARCH_LASX_NATIVE |
| 4172 | #endif |
| 4173 | #endif |
| 4174 | |
| 4175 | #if !defined(SIMDE_LOONGARCH_LSX_NATIVE) && !defined(SIMDE_LOONGARCH_LSX_NO_NATIVE) && !defined(SIMDE_NO_NATIVE) |
| 4176 | #if defined(SIMDE_ARCH_LOONGARCH_LSX) |
| 4177 | #define SIMDE_LOONGARCH_LSX_NATIVE |
| 4178 | #endif |
| 4179 | #endif |
| 4180 | |
| 4181 | #if defined(SIMDE_LOONGARCH_LASX_NATIVE) |
| 4182 | #include <lasxintrin.h> |
| 4183 | #endif |
| 4184 | #if defined(SIMDE_LOONGARCH_LSX_NATIVE) |
| 4185 | #include <lsxintrin.h> |
| 4186 | #endif |
| 4187 | |
| 4188 | #endif /* !defined(SIMDE_FEATURES_H) */ |
| 4189 | /* :: End simde/simde-features.h :: */ |
| 4190 | /* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */ |
| 4191 | /* 71fd833d9666141edcd1d3c109a80e228303d8d7 */ |
| 4192 | /* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */ |
| 4193 | /* 71fd833d9666141edcd1d3c109a80e228303d8d7 */ |
| 4194 | /* :: Begin simde/simde-math.h :: */ |
| 4195 | /* SPDX-License-Identifier: MIT |
| 4196 | * |
| 4197 | * Permission is hereby granted, free of charge, to any person |
| 4198 | * obtaining a copy of this software and associated documentation |
| 4199 | * files (the "Software"), to deal in the Software without |
| 4200 | * restriction, including without limitation the rights to use, copy, |
| 4201 | * modify, merge, publish, distribute, sublicense, and/or sell copies |
| 4202 | * of the Software, and to permit persons to whom the Software is |
| 4203 | * furnished to do so, subject to the following conditions: |
| 4204 | * |
| 4205 | * The above copyright notice and this permission notice shall be |
| 4206 | * included in all copies or substantial portions of the Software. |
| 4207 | * |
| 4208 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 4209 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 4210 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 4211 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS |
| 4212 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN |
| 4213 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 4214 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 4215 | * SOFTWARE. |
| 4216 | * |
| 4217 | * Copyright: |
| 4218 | * 2017-2020 Evan Nemerson <evan@nemerson.com> |
| 4219 | * 2023 Yi-Yen Chung <eric681@andestech.com> (Copyright owned by Andes Technology) |
| 4220 | */ |
| 4221 | |
| 4222 | /* Attempt to find math functions. Functions may be in <cmath>, |
| 4223 | * <math.h>, compiler built-ins/intrinsics, or platform/architecture |
| 4224 | * specific headers. In some cases, especially those not built in to |
| 4225 | * libm, we may need to define our own implementations. */ |
| 4226 | |
| 4227 | #if !defined(SIMDE_MATH_H) |
| 4228 | #define SIMDE_MATH_H 1 |
| 4229 | |
| 4230 | /* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */ |
| 4231 | /* 71fd833d9666141edcd1d3c109a80e228303d8d7 */ |
| 4232 | /* AUTOMATICALLY GENERATED FILE, DO NOT MODIFY */ |
| 4233 | /* 71fd833d9666141edcd1d3c109a80e228303d8d7 */ |
| 4234 | |
| 4235 | #include <stdint.h> |
| 4236 | #if defined(SIMDE_ARM_NEON_A64V8_NATIVE) |
| 4237 | #include <arm_neon.h> |
| 4238 | #endif |
| 4239 | |
| 4240 | HEDLEY_DIAGNOSTIC_PUSH |
| 4241 | SIMDE_DISABLE_UNWANTED_DIAGNOSTICS |
| 4242 | |
| 4243 | /* SLEEF support |
| 4244 | * https://sleef.org/ |
| 4245 | * |
| 4246 | * If you include <sleef.h> prior to including SIMDe, SIMDe will use |
| 4247 | * SLEEF. You can also define SIMDE_MATH_SLEEF_ENABLE prior to |
| 4248 | * including SIMDe to force the issue. |
| 4249 | * |
| 4250 | * Note that SLEEF does requires linking to libsleef. |
| 4251 | * |
| 4252 | * By default, SIMDe will use the 1 ULP functions, but if you use |
| 4253 | * SIMDE_ACCURACY_PREFERENCE of 0 we will use up to 4 ULP. This is |
| 4254 | * only the case for the simde_math_* functions; for code in other |
| 4255 | * SIMDe headers which calls SLEEF directly we may use functions with |
| 4256 | * greater error if the API we're implementing is less precise (for |
| 4257 | * example, SVML guarantees 4 ULP, so we will generally use the 3.5 |
| 4258 | * ULP functions from SLEEF). */ |
| 4259 | #if !defined(SIMDE_MATH_SLEEF_DISABLE) |
| 4260 | #if defined(__SLEEF_H__) |
| 4261 | #define SIMDE_MATH_SLEEF_ENABLE |
| 4262 | #endif |
| 4263 | #endif |
| 4264 | |
| 4265 | #if defined(SIMDE_MATH_SLEEF_ENABLE) && !defined(__SLEEF_H__) |
| 4266 | HEDLEY_DIAGNOSTIC_PUSH |
| 4267 | SIMDE_DIAGNOSTIC_DISABLE_IGNORED_QUALIFIERS_ |
| 4268 | #include <sleef.h> |
| 4269 | HEDLEY_DIAGNOSTIC_POP |
| 4270 | #endif |
| 4271 | |
| 4272 | #if defined(SIMDE_MATH_SLEEF_ENABLE) && defined(__SLEEF_H__) |
| 4273 | #if defined(SLEEF_VERSION_MAJOR) |
| 4274 | #define SIMDE_MATH_SLEEF_VERSION_CHECK(major, minor, patch) (HEDLEY_VERSION_ENCODE(SLEEF_VERSION_MAJOR, SLEEF_VERSION_MINOR, SLEEF_VERSION_PATCHLEVEL) >= HEDLEY_VERSION_ENCODE(major, minor, patch)) |
| 4275 | #else |
| 4276 | #define SIMDE_MATH_SLEEF_VERSION_CHECK(major, minor, patch) (HEDLEY_VERSION_ENCODE(3,0,0) >= HEDLEY_VERSION_ENCODE(major, minor, patch)) |
| 4277 | #endif |
| 4278 | #else |
| 4279 | #define SIMDE_MATH_SLEEF_VERSION_CHECK(major, minor, patch) (0) |
| 4280 | #endif |
| 4281 | |
| 4282 | #if defined(__has_builtin) |
| 4283 | #define SIMDE_MATH_BUILTIN_LIBM(func) __has_builtin(__builtin_##func) |
| 4284 | #elif \ |
| 4285 | HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ |
| 4286 | HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ |
| 4287 | HEDLEY_GCC_VERSION_CHECK(4,4,0) |
| 4288 | #define SIMDE_MATH_BUILTIN_LIBM(func) (1) |
| 4289 | #else |
| 4290 | #define SIMDE_MATH_BUILTIN_LIBM(func) (0) |
| 4291 | #endif |
| 4292 | |
| 4293 | #if defined(HUGE_VAL) |
| 4294 | /* Looks like <math.h> or <cmath> has already been included. */ |
| 4295 | |
| 4296 | /* The math.h from libc++ (yes, the C header from the C++ standard |
| 4297 | * library) will define an isnan function, but not an isnan macro |
| 4298 | * like the C standard requires. So we detect the header guards |
| 4299 | * macro libc++ uses. */ |
| 4300 | #if defined(isnan) || (defined(_LIBCPP_MATH_H) && !defined(_LIBCPP_CMATH)) |
| 4301 | #define SIMDE_MATH_HAVE_MATH_H |
| 4302 | #elif defined(__cplusplus) |
| 4303 | #define SIMDE_MATH_HAVE_CMATH |
| 4304 | #endif |
| 4305 | #elif defined(__has_include) |
| 4306 | #if defined(__cplusplus) && (__cplusplus >= 201103L) && __has_include(<cmath>) |
| 4307 | #define SIMDE_MATH_HAVE_CMATH |
| 4308 | #include <cmath> |
| 4309 | #elif __has_include(<math.h>) |
| 4310 | #define SIMDE_MATH_HAVE_MATH_H |
| 4311 | #include <math.h> |
| 4312 | #elif !defined(SIMDE_MATH_NO_LIBM) |
| 4313 | #define SIMDE_MATH_NO_LIBM |
| 4314 | #endif |
| 4315 | #elif !defined(SIMDE_MATH_NO_LIBM) |
| 4316 | #if defined(__cplusplus) && (__cplusplus >= 201103L) |
| 4317 | #define SIMDE_MATH_HAVE_CMATH |
| 4318 | HEDLEY_DIAGNOSTIC_PUSH |
| 4319 | #if defined(HEDLEY_MSVC_VERSION) |
| 4320 | /* VS 14 emits this diagnostic about noexcept being used on a |
| 4321 | * <cmath> function, which we can't do anything about. */ |
| 4322 | #pragma warning(disable:4996) |
| 4323 | #endif |
| 4324 | #include <cmath> |
| 4325 | HEDLEY_DIAGNOSTIC_POP |
| 4326 | #else |
| 4327 | #define SIMDE_MATH_HAVE_MATH_H |
| 4328 | #include <math.h> |
| 4329 | #endif |
| 4330 | #endif |
| 4331 | |
| 4332 | #if !defined(SIMDE_MATH_INFINITY) |
| 4333 | #if \ |
| 4334 | HEDLEY_HAS_BUILTIN(__builtin_inf) || \ |
| 4335 | HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ |
| 4336 | HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ |
| 4337 | HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ |
| 4338 | HEDLEY_CRAY_VERSION_CHECK(8,1,0) |
| 4339 | #define SIMDE_MATH_INFINITY (__builtin_inf()) |
| 4340 | #elif defined(INFINITY) |
| 4341 | #define SIMDE_MATH_INFINITY INFINITY |
| 4342 | #endif |
| 4343 | #endif |
| 4344 | |
| 4345 | #if !defined(SIMDE_INFINITYF) |
| 4346 | #if \ |
| 4347 | HEDLEY_HAS_BUILTIN(__builtin_inff) || \ |
| 4348 | HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ |
| 4349 | HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ |
| 4350 | HEDLEY_CRAY_VERSION_CHECK(8,1,0) || \ |
| 4351 | HEDLEY_IBM_VERSION_CHECK(13,1,0) |
| 4352 | #define SIMDE_MATH_INFINITYF (__builtin_inff()) |
| 4353 | #elif defined(INFINITYF) |
| 4354 | #define SIMDE_MATH_INFINITYF INFINITYF |
| 4355 | #elif defined(SIMDE_MATH_INFINITY) |
| 4356 | #define SIMDE_MATH_INFINITYF HEDLEY_STATIC_CAST(float, SIMDE_MATH_INFINITY) |
| 4357 | #endif |
| 4358 | #endif |
| 4359 | |
| 4360 | #if !defined(SIMDE_MATH_NAN) |
| 4361 | #if \ |
| 4362 | HEDLEY_HAS_BUILTIN(__builtin_nan) || \ |
| 4363 | HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ |
| 4364 | HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ |
| 4365 | HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ |
| 4366 | HEDLEY_CRAY_VERSION_CHECK(8,1,0) || \ |
| 4367 | HEDLEY_IBM_VERSION_CHECK(13,1,0) |
| 4368 | #define SIMDE_MATH_NAN (__builtin_nan("")) |
| 4369 | #elif defined(NAN) |
| 4370 | #define SIMDE_MATH_NAN NAN |
| 4371 | #endif |
| 4372 | #endif |
| 4373 | |
| 4374 | #if !defined(SIMDE_NANF) |
| 4375 | #if \ |
| 4376 | HEDLEY_HAS_BUILTIN(__builtin_nanf) || \ |
| 4377 | HEDLEY_GCC_VERSION_CHECK(3,3,0) || \ |
| 4378 | HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ |
| 4379 | HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ |
| 4380 | HEDLEY_CRAY_VERSION_CHECK(8,1,0) |
| 4381 | #define SIMDE_MATH_NANF (__builtin_nanf("")) |
| 4382 | #elif defined(NANF) |
| 4383 | #define SIMDE_MATH_NANF NANF |
| 4384 | #elif defined(SIMDE_MATH_NAN) |
| 4385 | #define SIMDE_MATH_NANF HEDLEY_STATIC_CAST(float, SIMDE_MATH_NAN) |
| 4386 | #endif |
| 4387 | #endif |
| 4388 | |
| 4389 | #if !defined(SIMDE_MATH_PI) |
| 4390 | #if defined(M_PI) |
| 4391 | #define SIMDE_MATH_PI M_PI |
| 4392 | #else |
| 4393 | #define SIMDE_MATH_PI 3.14159265358979323846 |
| 4394 | #endif |
| 4395 | #endif |
| 4396 | |
| 4397 | #if !defined(SIMDE_MATH_PIF) |
| 4398 | #if defined(M_PI) |
| 4399 | #define SIMDE_MATH_PIF HEDLEY_STATIC_CAST(float, M_PI) |
| 4400 | #else |
| 4401 | #define SIMDE_MATH_PIF 3.14159265358979323846f |
| 4402 | #endif |
| 4403 | #endif |
| 4404 | |
| 4405 | #if !defined(SIMDE_MATH_PI_OVER_180) |
| 4406 | #define SIMDE_MATH_PI_OVER_180 0.0174532925199432957692369076848861271344287188854172545609719144 |
| 4407 | #endif |
| 4408 | |
| 4409 | #if !defined(SIMDE_MATH_PI_OVER_180F) |
| 4410 | #define SIMDE_MATH_PI_OVER_180F 0.0174532925199432957692369076848861271344287188854172545609719144f |
| 4411 | #endif |
| 4412 | |
| 4413 | #if !defined(SIMDE_MATH_180_OVER_PI) |
| 4414 | #define SIMDE_MATH_180_OVER_PI 57.295779513082320876798154814105170332405472466564321549160243861 |
| 4415 | #endif |
| 4416 | |
| 4417 | #if !defined(SIMDE_MATH_180_OVER_PIF) |
| 4418 | #define SIMDE_MATH_180_OVER_PIF 57.295779513082320876798154814105170332405472466564321549160243861f |
| 4419 | #endif |
| 4420 | |
| 4421 | #if !defined(SIMDE_MATH_FLT_MIN) |
| 4422 | #if defined(__FLT_MIN__) |
| 4423 | #define SIMDE_MATH_FLT_MIN __FLT_MIN__ |
| 4424 | #else |
| 4425 | #if !defined(FLT_MIN) |
| 4426 | #if defined(__cplusplus) |
| 4427 | #include <cfloat> |
| 4428 | #else |
| 4429 | #include <float.h> |
| 4430 | #endif |
| 4431 | #endif |
| 4432 | #define SIMDE_MATH_FLT_MIN FLT_MIN |
| 4433 | #endif |
| 4434 | #endif |
| 4435 | |
| 4436 | #if !defined(SIMDE_MATH_FLT_MAX) |
| 4437 | #if defined(__FLT_MAX__) |
| 4438 | #define SIMDE_MATH_FLT_MAX __FLT_MAX__ |
| 4439 | #else |
| 4440 | #if !defined(FLT_MAX) |
| 4441 | #if defined(__cplusplus) |
| 4442 | #include <cfloat> |
| 4443 | #else |
| 4444 | #include <float.h> |
| 4445 | #endif |
| 4446 | #endif |
| 4447 | #define SIMDE_MATH_FLT_MAX FLT_MAX |
| 4448 | #endif |
| 4449 | #endif |
| 4450 | |
| 4451 | #if !defined(SIMDE_MATH_DBL_MIN) |
| 4452 | #if defined(__DBL_MIN__) |
| 4453 | #define SIMDE_MATH_DBL_MIN __DBL_MIN__ |
| 4454 | #else |
| 4455 | #if !defined(DBL_MIN) |
| 4456 | #if defined(__cplusplus) |
| 4457 | #include <cfloat> |
| 4458 | #else |
| 4459 | #include <float.h> |
| 4460 | #endif |
| 4461 | #endif |
| 4462 | #define SIMDE_MATH_DBL_MIN DBL_MIN |
| 4463 | #endif |
| 4464 | #endif |
| 4465 | |
| 4466 | #if !defined(SIMDE_MATH_DBL_MAX) |
| 4467 | #if defined(__DBL_MAX__) |
| 4468 | #define SIMDE_MATH_DBL_MAX __DBL_MAX__ |
| 4469 | #else |
| 4470 | #if !defined(DBL_MAX) |
| 4471 | #if defined(__cplusplus) |
| 4472 | #include <cfloat> |
| 4473 | #else |
| 4474 | #include <float.h> |
| 4475 | #endif |
| 4476 | #endif |
| 4477 | #define SIMDE_MATH_DBL_MAX DBL_MAX |
| 4478 | #endif |
| 4479 | #endif |
| 4480 | |
| 4481 | /*** Classification macros from C99 ***/ |
| 4482 | |
| 4483 | #if !defined(simde_math_isinf) |
| 4484 | #if SIMDE_MATH_BUILTIN_LIBM(isinf) |
| 4485 | #define simde_math_isinf(v) __builtin_isinf(v) |
| 4486 | #elif defined(isinf) || defined(SIMDE_MATH_HAVE_MATH_H) |
| 4487 | #define simde_math_isinf(v) isinf(v) |
| 4488 | #elif defined(SIMDE_MATH_HAVE_CMATH) |
| 4489 | #define simde_math_isinf(v) std::isinf(v) |
| 4490 | #endif |
| 4491 | #endif |
| 4492 | |
| 4493 | #if !defined(simde_math_isinff) |
| 4494 | #if HEDLEY_HAS_BUILTIN(__builtin_isinff) || \ |
| 4495 | HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ |
| 4496 | HEDLEY_ARM_VERSION_CHECK(4,1,0) |
| 4497 | #define simde_math_isinff(v) __builtin_isinff(v) |
| 4498 | #elif defined(SIMDE_MATH_HAVE_CMATH) |
| 4499 | #define simde_math_isinff(v) std::isinf(v) |
| 4500 | #elif defined(simde_math_isinf) |
| 4501 | #define simde_math_isinff(v) simde_math_isinf(HEDLEY_STATIC_CAST(double, v)) |
| 4502 | #endif |
| 4503 | #endif |
| 4504 | |
| 4505 | #if !defined(simde_math_isnan) |
| 4506 | #if SIMDE_MATH_BUILTIN_LIBM(isnan) |
| 4507 | #define simde_math_isnan(v) __builtin_isnan(v) |
| 4508 | #elif defined(isnan) || defined(SIMDE_MATH_HAVE_MATH_H) |
| 4509 | #define simde_math_isnan(v) isnan(v) |
| 4510 | #elif defined(SIMDE_MATH_HAVE_CMATH) |
| 4511 | #define simde_math_isnan(v) std::isnan(v) |
| 4512 | #endif |
| 4513 | #endif |
| 4514 | |
| 4515 | #if !defined(simde_math_isnanf) |
| 4516 | #if HEDLEY_HAS_BUILTIN(__builtin_isnanf) || \ |
| 4517 | HEDLEY_INTEL_VERSION_CHECK(13,0,0) || \ |
| 4518 | HEDLEY_ARM_VERSION_CHECK(4,1,0) |
| 4519 | /* XL C/C++ has __builtin_isnan but not __builtin_isnanf */ |
| 4520 | #define simde_math_isnanf(v) __builtin_isnanf(v) |
| 4521 | #elif defined(SIMDE_MATH_HAVE_CMATH) |
| 4522 | #define simde_math_isnanf(v) std::isnan(v) |
| 4523 | #elif defined(simde_math_isnan) |
| 4524 | #define simde_math_isnanf(v) simde_math_isnan(HEDLEY_STATIC_CAST(double, v)) |
| 4525 | #endif |
| 4526 | #endif |
| 4527 | |
| 4528 | #if !defined(simde_math_isnormal) |
| 4529 | #if SIMDE_MATH_BUILTIN_LIBM(isnormal) |
| 4530 | #define simde_math_isnormal(v) __builtin_isnormal(v) |
| 4531 | #elif defined(SIMDE_MATH_HAVE_MATH_H) |
| 4532 | #define simde_math_isnormal(v) isnormal(v) |
| 4533 | #elif defined(SIMDE_MATH_HAVE_CMATH) |
| 4534 | #define simde_math_isnormal(v) std::isnormal(v) |
| 4535 | #endif |
| 4536 | #endif |
| 4537 | |
| 4538 | #if !defined(simde_math_isnormalf) |
| 4539 | #if HEDLEY_HAS_BUILTIN(__builtin_isnormalf) |
| 4540 | #define simde_math_isnormalf(v) __builtin_isnormalf(v) |
| 4541 | #elif SIMDE_MATH_BUILTIN_LIBM(isnormal) |
| 4542 | #define simde_math_isnormalf(v) __builtin_isnormal(v) |
| 4543 | #elif defined(isnormalf) |
| 4544 | #define simde_math_isnormalf(v) isnormalf(v) |
| 4545 | #elif defined(isnormal) || defined(SIMDE_MATH_HAVE_MATH_H) |
| 4546 | #define simde_math_isnormalf(v) isnormal(v) |
| 4547 | #elif defined(SIMDE_MATH_HAVE_CMATH) |
| 4548 | #define simde_math_isnormalf(v) std::isnormal(v) |
| 4549 | #elif defined(simde_math_isnormal) |
| 4550 | #define simde_math_isnormalf(v) simde_math_isnormal(v) |
| 4551 | #endif |
| 4552 | #endif |
| 4553 | |
| 4554 | #if !defined(simde_math_issubnormalf) |
| 4555 | #if SIMDE_MATH_BUILTIN_LIBM(fpclassify) |
| 4556 | #define simde_math_issubnormalf(v) __builtin_fpclassify(0, 0, 0, 1, 0, v) |
| 4557 | #elif defined(fpclassify) |
| 4558 | #define simde_math_issubnormalf(v) (fpclassify(v) == FP_SUBNORMAL) |
| 4559 | #elif defined(SIMDE_IEEE754_STORAGE) |
| 4560 | #define simde_math_issubnormalf(v) (((simde_float32_as_uint32(v) & UINT32_C(0x7F800000)) == UINT32_C(0)) && ((simde_float32_as_uint32(v) & UINT32_C(0x007FFFFF)) != UINT32_C(0))) |
| 4561 | #endif |
| 4562 | #endif |
| 4563 | |
| 4564 | #if !defined(simde_math_issubnormal) |
| 4565 | #if SIMDE_MATH_BUILTIN_LIBM(fpclassify) |
| 4566 | #define simde_math_issubnormal(v) __builtin_fpclassify(0, 0, 0, 1, 0, v) |
| 4567 | #elif defined(fpclassify) |
| 4568 | #define simde_math_issubnormal(v) (fpclassify(v) == FP_SUBNORMAL) |
| 4569 | #elif defined(SIMDE_IEEE754_STORAGE) |
| 4570 | #define simde_math_issubnormal(v) (((simde_float64_as_uint64(v) & UINT64_C(0x7FF0000000000000)) == UINT64_C(0)) && ((simde_float64_as_uint64(v) & UINT64_C(0x00FFFFFFFFFFFFF)) != UINT64_C(0))) |
| 4571 | #endif |
| 4572 | #endif |
| 4573 | |
| 4574 | #if defined(FP_NAN) |
| 4575 | #define SIMDE_MATH_FP_NAN FP_NAN |
| 4576 | #else |
| 4577 | #define SIMDE_MATH_FP_NAN 0 |
| 4578 | #endif |
| 4579 | #if defined(FP_INFINITE) |
| 4580 | #define SIMDE_MATH_FP_INFINITE FP_INFINITE |
| 4581 | #else |
| 4582 | #define SIMDE_MATH_FP_INFINITE 1 |
| 4583 | #endif |
| 4584 | #if defined(FP_ZERO) |
| 4585 | #define SIMDE_MATH_FP_ZERO FP_ZERO |
| 4586 | #else |
| 4587 | #define SIMDE_MATH_FP_ZERO 2 |
| 4588 | #endif |
| 4589 | #if defined(FP_SUBNORMAL) |
| 4590 | #define SIMDE_MATH_FP_SUBNORMAL FP_SUBNORMAL |
| 4591 | #else |
| 4592 | #define SIMDE_MATH_FP_SUBNORMAL 3 |
| 4593 | #endif |
| 4594 | #if defined(FP_NORMAL) |
| 4595 | #define SIMDE_MATH_FP_NORMAL FP_NORMAL |
| 4596 | #else |
| 4597 | #define SIMDE_MATH_FP_NORMAL 4 |
| 4598 | #endif |
| 4599 | |
| 4600 | static HEDLEY_INLINE |
| 4601 | int |
| 4602 | simde_math_fpclassifyf(float v) { |
| 4603 | #if SIMDE_MATH_BUILTIN_LIBM(fpclassify) |
| 4604 | return __builtin_fpclassify(SIMDE_MATH_FP_NAN, SIMDE_MATH_FP_INFINITE, SIMDE_MATH_FP_NORMAL, SIMDE_MATH_FP_SUBNORMAL, SIMDE_MATH_FP_ZERO, v); |
| 4605 | #elif defined(fpclassify) |
| 4606 | return fpclassify(v); |
| 4607 | #else |
| 4608 | return |
| 4609 | simde_math_isnormalf(v) ? SIMDE_MATH_FP_NORMAL : |
| 4610 | (v == 0.0f) ? SIMDE_MATH_FP_ZERO : |
| 4611 | simde_math_isnanf(v) ? SIMDE_MATH_FP_NAN : |
| 4612 | simde_math_isinff(v) ? SIMDE_MATH_FP_INFINITE : |
| 4613 | SIMDE_MATH_FP_SUBNORMAL; |
| 4614 | #endif |
| 4615 | } |
| 4616 | |
| 4617 | static HEDLEY_INLINE |
| 4618 | int |
| 4619 | simde_math_fpclassify(double v) { |
| 4620 | #if SIMDE_MATH_BUILTIN_LIBM(fpclassify) |
| 4621 | return __builtin_fpclassify(SIMDE_MATH_FP_NAN, SIMDE_MATH_FP_INFINITE, SIMDE_MATH_FP_NORMAL, SIMDE_MATH_FP_SUBNORMAL, SIMDE_MATH_FP_ZERO, v); |
| 4622 | #elif defined(fpclassify) |
| 4623 | return fpclassify(v); |
| 4624 | #else |
| 4625 | return |
| 4626 | simde_math_isnormal(v) ? SIMDE_MATH_FP_NORMAL : |
| 4627 | (v == 0.0) ? SIMDE_MATH_FP_ZERO : |
| 4628 | simde_math_isnan(v) ? SIMDE_MATH_FP_NAN : |
| 4629 | simde_math_isinf(v) ? SIMDE_MATH_FP_INFINITE : |
| 4630 | SIMDE_MATH_FP_SUBNORMAL; |
| 4631 | #endif |
| 4632 | } |
| 4633 | |
| 4634 | #define SIMDE_MATH_FP_QNAN 0x01 |
| 4635 | #define SIMDE_MATH_FP_PZERO 0x02 |
| 4636 | #define SIMDE_MATH_FP_NZERO 0x04 |
| 4637 | #define SIMDE_MATH_FP_PINF 0x08 |
| 4638 | #define SIMDE_MATH_FP_NINF 0x10 |
| 4639 | #define SIMDE_MATH_FP_DENORMAL 0x20 |
| 4640 | #define SIMDE_MATH_FP_NEGATIVE 0x40 |
| 4641 | #define SIMDE_MATH_FP_SNAN 0x80 |
| 4642 | |
| 4643 | static HEDLEY_INLINE |
| 4644 | uint8_t |
| 4645 | simde_math_fpclassf(float v, const int imm8) { |
| 4646 | union { |
| 4647 | float f; |
| 4648 | uint32_t u; |
| 4649 | } fu; |
| 4650 | fu.f = v; |
| 4651 | uint32_t bits = fu.u; |
| 4652 | uint8_t NegNum = (bits >> 31) & 1; |
| 4653 | uint32_t const ExpMask = 0x3F800000; // [30:23] |
| 4654 | uint32_t const MantMask = 0x007FFFFF; // [22:0] |
| 4655 | uint8_t ExpAllOnes = ((bits & ExpMask) == ExpMask); |
| 4656 | uint8_t ExpAllZeros = ((bits & ExpMask) == 0); |
| 4657 | uint8_t MantAllZeros = ((bits & MantMask) == 0); |
| 4658 | uint8_t ZeroNumber = ExpAllZeros & MantAllZeros; |
| 4659 | uint8_t SignalingBit = (bits >> 22) & 1; |
| 4660 | |
| 4661 | uint8_t result = 0; |
| 4662 | uint8_t qNaN_res = ExpAllOnes & (!MantAllZeros) & SignalingBit; |
| 4663 | uint8_t Pzero_res = (!NegNum) & ExpAllZeros & MantAllZeros; |
| 4664 | uint8_t Nzero_res = NegNum & ExpAllZeros & MantAllZeros; |
| 4665 | uint8_t Pinf_res = (!NegNum) & ExpAllOnes & MantAllZeros; |
| 4666 | uint8_t Ninf_res = NegNum & ExpAllOnes & MantAllZeros; |
| 4667 | uint8_t Denorm_res = ExpAllZeros & (!MantAllZeros); |
| 4668 | uint8_t FinNeg_res = NegNum & (!ExpAllOnes) & (!ZeroNumber); |
| 4669 | uint8_t sNaN_res = ExpAllOnes & (!MantAllZeros) & (!SignalingBit); |
| 4670 | result = (((imm8 >> 0) & qNaN_res) | \ |
| 4671 | ((imm8 >> 1) & Pzero_res) | \ |
| 4672 | ((imm8 >> 2) & Nzero_res) | \ |
| 4673 | ((imm8 >> 3) & Pinf_res) | \ |
| 4674 | ((imm8 >> 4) & Ninf_res) | \ |
| 4675 | ((imm8 >> 5) & Denorm_res) | \ |
| 4676 | ((imm8 >> 6) & FinNeg_res) | \ |
| 4677 | ((imm8 >> 7) & sNaN_res)); |
| 4678 | return result; |
| 4679 | } |
| 4680 | |
| 4681 | static HEDLEY_INLINE |
| 4682 | uint8_t |
| 4683 | simde_math_fpclass(double v, const int imm8) { |
| 4684 | union { |
| 4685 | double d; |
| 4686 | uint64_t u; |
| 4687 | } du; |
| 4688 | du.d = v; |
| 4689 | uint64_t bits = du.u; |
| 4690 | uint8_t NegNum = (bits >> 63) & 1; |
| 4691 | uint64_t const ExpMask = 0x3FF0000000000000; // [62:52] |
| 4692 | uint64_t const MantMask = 0x000FFFFFFFFFFFFF; // [51:0] |
| 4693 | uint8_t ExpAllOnes = ((bits & ExpMask) == ExpMask); |
| 4694 | uint8_t ExpAllZeros = ((bits & ExpMask) == 0); |
| 4695 | uint8_t MantAllZeros = ((bits & MantMask) == 0); |
| 4696 | uint8_t ZeroNumber = ExpAllZeros & MantAllZeros; |
| 4697 | uint8_t SignalingBit = (bits >> 51) & 1; |
| 4698 | |
| 4699 | uint8_t result = 0; |
| 4700 | uint8_t qNaN_res = ExpAllOnes & (!MantAllZeros) & SignalingBit; |
| 4701 | uint8_t Pzero_res = (!NegNum) & ExpAllZeros & MantAllZeros; |
| 4702 | uint8_t Nzero_res = NegNum & ExpAllZeros & MantAllZeros; |
| 4703 | uint8_t Pinf_res = (!NegNum) & ExpAllOnes & MantAllZeros; |
| 4704 | uint8_t Ninf_res = NegNum & ExpAllOnes & MantAllZeros; |
| 4705 | uint8_t Denorm_res = ExpAllZeros & (!MantAllZeros); |
| 4706 | uint8_t FinNeg_res = NegNum & (!ExpAllOnes) & (!ZeroNumber); |
| 4707 | uint8_t sNaN_res = ExpAllOnes & (!MantAllZeros) & (!SignalingBit); |
| 4708 | result = (((imm8 >> 0) & qNaN_res) | \ |
| 4709 | ((imm8 >> 1) & Pzero_res) | \ |
| 4710 | ((imm8 >> 2) & Nzero_res) | \ |
| 4711 | ((imm8 >> 3) & Pinf_res) | \ |
| 4712 | ((imm8 >> 4) & Ninf_res) | \ |
| 4713 | ((imm8 >> 5) & Denorm_res) | \ |
| 4714 | ((imm8 >> 6) & FinNeg_res) | \ |
| 4715 | ((imm8 >> 7) & sNaN_res)); |
| 4716 | return result; |
| 4717 | } |
| 4718 | |
| 4719 | /*** Manipulation functions ***/ |
| 4720 | |
| 4721 | #if !defined(simde_math_nextafter) |
| 4722 | #if \ |
| 4723 | (HEDLEY_HAS_BUILTIN(__builtin_nextafter) && !defined(HEDLEY_IBM_VERSION)) || \ |
| 4724 | HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ |
| 4725 | HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ |
| 4726 | HEDLEY_INTEL_VERSION_CHECK(13,0,0) |
| 4727 | #define simde_math_nextafter(x, y) __builtin_nextafter(x, y) |
| 4728 | #elif defined(SIMDE_MATH_HAVE_CMATH) |
| 4729 | #define simde_math_nextafter(x, y) std::nextafter(x, y) |
| 4730 | #elif defined(SIMDE_MATH_HAVE_MATH_H) |
| 4731 | #define simde_math_nextafter(x, y) nextafter(x, y) |
| 4732 | #endif |
| 4733 | #endif |
| 4734 | |
| 4735 | #if !defined(simde_math_nextafterf) |
| 4736 | #if \ |
| 4737 | (HEDLEY_HAS_BUILTIN(__builtin_nextafterf) && !defined(HEDLEY_IBM_VERSION)) || \ |
| 4738 | HEDLEY_ARM_VERSION_CHECK(4,1,0) || \ |
| 4739 | HEDLEY_GCC_VERSION_CHECK(3,4,0) || \ |
| 4740 | HEDLEY_INTEL_VERSION_CHECK(13,0,0) |
| 4741 | #define simde_math_nextafterf(x, y) __builtin_nextafterf(x, y) |
| 4742 | #elif defined(SIMDE_MATH_HAVE_CMATH) |
| 4743 | #define simde_math_nextafterf(x, y) std::nextafter(x, y) |
| 4744 | #elif defined(SIMDE_MATH_HAVE_MATH_H) |
| 4745 | #define simde_math_nextafterf(x, y) nextafterf(x, y) |
| 4746 | #endif |
| 4747 | #endif |
| 4748 | |
| 4749 | /*** Functions from C99 ***/ |
| 4750 | |
| 4751 | #if !defined(simde_math_abs) |
| 4752 | #if SIMDE_MATH_BUILTIN_LIBM(abs) |
| 4753 | #define simde_math_abs(v) __builtin_abs(v) |
| 4754 | #elif defined(SIMDE_MATH_HAVE_CMATH) |
| 4755 | #define simde_math_abs(v) std::abs(v) |
| 4756 | #elif defined(SIMDE_MATH_HAVE_MATH_H) |
| 4757 | #define simde_math_abs(v) abs(v) |
| 4758 | #endif |
| 4759 | #endif |
| 4760 | |
| 4761 | #if !defined(simde_math_labs) |
| 4762 | #if SIMDE_MATH_BUILTIN_LIBM(labs) |
| 4763 | #define simde_math_labs(v) __builtin_labs(v) |
| 4764 | #elif defined(SIMDE_MATH_HAVE_CMATH) |
| 4765 | #define simde_math_labs(v) std::labs(v) |
| 4766 | #elif defined(SIMDE_MATH_HAVE_MATH_H) |
| 4767 | #define simde_math_labs(v) labs(v) |
| 4768 | #endif |
| 4769 | #endif |
| 4770 | |
| 4771 | #if !defined(simde_math_llabs) |
| 4772 | #if SIMDE_MATH_BUILTIN_LIBM(llabs) |
| 4773 | #define simde_math_llabs(v) __builtin_llabs(v) |
| 4774 | #elif defined(SIMDE_MATH_HAVE_CMATH) |
| 4775 | #define simde_math_llabs(v) std::llabs(v) |
| 4776 | #elif defined(SIMDE_MATH_HAVE_MATH_H) |
| 4777 | #define simde_math_llabs(v) llabs(v) |
| 4778 | #endif |
| 4779 | #endif |
| 4780 | |
| 4781 | #if !defined(simde_math_fabsf) |
| 4782 | #if SIMDE_MATH_BUILTIN_LIBM(fabsf) |
| 4783 | #define simde_math_fabsf(v) __builtin_fabsf(v) |
| 4784 | #elif defined(SIMDE_MATH_HAVE_CMATH) |
| 4785 | #define simde_math_fabsf(v) std::abs(v) |
| 4786 | #elif defined(SIMDE_MATH_HAVE_MATH_H) |
| 4787 | #define simde_math_fabsf(v) fabsf(v) |
| 4788 | #endif |
| 4789 | #endif |
| 4790 | |
| 4791 | #if !defined(simde_math_acos) |
| 4792 | #if SIMDE_MATH_BUILTIN_LIBM(acos) |
| 4793 | #define simde_math_acos(v) __builtin_acos(v) |
| 4794 | #elif defined(SIMDE_MATH_HAVE_CMATH) |
| 4795 | #define simde_math_acos(v) std::acos(v) |
| 4796 | #elif defined(SIMDE_MATH_HAVE_MATH_H) |
| 4797 | #define simde_math_acos(v) acos(v) |
| 4798 | #endif |
| 4799 | #endif |
| 4800 | |
| 4801 | #if !defined(simde_math_acosf) |
| 4802 | #if SIMDE_MATH_BUILTIN_LIBM(acosf) |
| 4803 | #define simde_math_acosf(v) __builtin_acosf(v) |
| 4804 | #elif defined(SIMDE_MATH_HAVE_CMATH) |
| 4805 | #define simde_math_acosf(v) std::acos(v) |
| 4806 | #elif defined(SIMDE_MATH_HAVE_MATH_H) |
| 4807 | #define simde_math_acosf(v) acosf(v) |
| 4808 | #endif |
| 4809 | #endif |
| 4810 | |
| 4811 | #if !defined(simde_math_acosh) |
| 4812 | #if SIMDE_MATH_BUILTIN_LIBM(acosh) |
| 4813 | #define simde_math_acosh(v) __builtin_acosh(v) |
| 4814 | #elif defined(SIMDE_MATH_HAVE_CMATH) |
| 4815 | #define simde_math_acosh(v) std::acosh(v) |
| 4816 | #elif defined(SIMDE_MATH_HAVE_MATH_H) |
| 4817 | #define simde_math_acosh(v) acosh(v) |
| 4818 | #endif |
| 4819 | #endif |
| 4820 | |
| 4821 | #if !defined(simde_math_acoshf) |
| 4822 | #if SIMDE_MATH_BUILTIN_LIBM(acoshf) |
| 4823 | #define simde_math_acoshf(v) __builtin_acoshf(v) |
| 4824 | #elif defined(SIMDE_MATH_HAVE_CMATH) |
| 4825 | #define simde_math_acoshf(v) std::acosh(v) |
| 4826 | #elif defined(SIMDE_MATH_HAVE_MATH_H) |
| 4827 | #define simde_math_acoshf(v) acoshf(v) |
| 4828 | #endif |
| 4829 | #endif |
| 4830 | |
| 4831 | #if !defined(simde_math_asin) |
| 4832 | #if SIMDE_MATH_BUILTIN_LIBM(asin) |
| 4833 | #define simde_math_asin(v) __builtin_asin(v) |
| 4834 | #elif defined(SIMDE_MATH_HAVE_CMATH) |
| 4835 | #define simde_math_asin(v) std::asin(v) |
| 4836 | #elif defined(SIMDE_MATH_HAVE_MATH_H) |
| 4837 | #define simde_math_asin(v) asin(v) |
| 4838 | #endif |
| 4839 | #endif |
| 4840 | |
| 4841 | #if !defined(simde_math_asinf) |
| 4842 | #if SIMDE_MATH_BUILTIN_LIBM(asinf) |
| 4843 | #define simde_math_asinf(v) __builtin_asinf(v) |
| 4844 | #elif defined(SIMDE_MATH_HAVE_CMATH) |
| 4845 | #define simde_math_asinf(v) std::asin(v) |
| 4846 | #elif defined(SIMDE_MATH_HAVE_MATH_H) |
| 4847 | #define simde_math_asinf(v) asinf(v) |
| 4848 | #endif |
| 4849 | #endif |
| 4850 | |
| 4851 | #if !defined(simde_math_asinh) |
| 4852 | #if SIMDE_MATH_BUILTIN_LIBM(asinh) |
| 4853 | #define simde_math_asinh(v) __builtin_asinh(v) |
| 4854 | #elif defined(SIMDE_MATH_HAVE_CMATH) |
| 4855 | #define simde_math_asinh(v) std::asinh(v) |
| 4856 | #elif defined(SIMDE_MATH_HAVE_MATH_H) |
| 4857 | #define simde_math_asinh(v) asinh(v) |
| 4858 | #endif |
| 4859 | #endif |
| 4860 | |
| 4861 | #if !defined(simde_math_asinhf) |
| 4862 | #if SIMDE_MATH_BUILTIN_LIBM(asinhf) |
| 4863 | #define simde_math_asinhf(v) __builtin_asinhf(v) |
| 4864 | #elif defined(SIMDE_MATH_HAVE_CMATH) |
| 4865 | #define simde_math_asinhf(v) std::asinh(v) |
| 4866 | #elif defined(SIMDE_MATH_HAVE_MATH_H) |
| 4867 | #define simde_math_asinhf(v) asinhf(v) |
| 4868 | #endif |
| 4869 | #endif |
| 4870 | |
| 4871 | #if !defined(simde_math_atan) |
| 4872 | #if SIMDE_MATH_BUILTIN_LIBM(atan) |
| 4873 | #define simde_math_atan(v) __builtin_atan(v) |
| 4874 | #elif defined(SIMDE_MATH_HAVE_CMATH) |
| 4875 | #define simde_math_atan(v) std::atan(v) |
| 4876 | #elif defined(SIMDE_MATH_HAVE_MATH_H) |
| 4877 | #define simde_math_atan(v) atan(v) |
| 4878 | #endif |
| 4879 | #endif |
| 4880 | |
| 4881 | #if !defined(simde_math_atan2) |
| 4882 | #if SIMDE_MATH_BUILTIN_LIBM(atan2) |
| 4883 | #define simde_math_atan2(y, x) __builtin_atan2(y, x) |
| 4884 | #elif defined(SIMDE_MATH_HAVE_CMATH) |
| 4885 | #define simde_math_atan2(y, x) std::atan2(y, x) |
| 4886 | #elif defined(SIMDE_MATH_HAVE_MATH_H) |
| 4887 | #define simde_math_atan2(y, x) atan2(y, x) |
| 4888 | #endif |
| 4889 | #endif |
| 4890 | |
| 4891 | #if !defined(simde_math_atan2f) |
| 4892 | #if SIMDE_MATH_BUILTIN_LIBM(atan2f) |
| 4893 | #define simde_math_atan2f(y, x) __builtin_atan2f(y, x) |
| 4894 | #elif defined(SIMDE_MATH_HAVE_CMATH) |
| 4895 | #define simde_math_atan2f(y, x) std::atan2(y, x) |
| 4896 | #elif defined(SIMDE_MATH_HAVE_MATH_H) |
| 4897 | #define simde_math_atan2f(y, x) atan2f(y, x) |
| 4898 | #endif |
| 4899 | #endif |
| 4900 | |
| 4901 | #if !defined(simde_math_atanf) |
| 4902 | #if SIMDE_MATH_BUILTIN_LIBM(atanf) |
| 4903 | #define simde_math_atanf(v) __builtin_atanf(v) |
| 4904 | #elif defined(SIMDE_MATH_HAVE_CMATH) |
| 4905 | #define simde_math_atanf(v) std::atan(v) |
| 4906 | #elif defined(SIMDE_MATH_HAVE_MATH_H) |
| 4907 | #define simde_math_atanf(v) atanf(v) |
| 4908 | #endif |
| 4909 | #endif |
| 4910 | |
| 4911 | #if !defined(simde_math_atanh) |
| 4912 | #if SIMDE_MATH_BUILTIN_LIBM(atanh) |
| 4913 | #define simde_math_atanh(v) __builtin_atanh(v) |
| 4914 | #elif defined(SIMDE_MATH_HAVE_CMATH) |
| 4915 | #define simde_math_atanh(v) std::atanh(v) |
| 4916 | #elif defined(SIMDE_MATH_HAVE_MATH_H) |
| 4917 | #define simde_math_atanh(v) atanh(v) |
| 4918 | #endif |
| 4919 | #endif |
| 4920 | |
| 4921 | #if !defined(simde_math_atanhf) |
| 4922 | #if SIMDE_MATH_BUILTIN_LIBM(atanhf) |
| 4923 | #define simde_math_atanhf(v) __builtin_atanhf(v) |
| 4924 | #elif defined(SIMDE_MATH_HAVE_CMATH) |
| 4925 | #define simde_math_atanhf(v) std::atanh(v) |
| 4926 | #elif defined(SIMDE_MATH_HAVE_MATH_H) |
| 4927 | #define simde_math_atanhf(v) atanhf(v) |
| 4928 | #endif |
| 4929 | #endif |
| 4930 | |
| 4931 | #if !defined(simde_math_cbrt) |
| 4932 | #if SIMDE_MATH_BUILTIN_LIBM(cbrt) |
| 4933 | #define simde_math_cbrt(v) __builtin_cbrt(v) |
| 4934 | #elif defined(SIMDE_MATH_HAVE_CMATH) |
| 4935 | #define simde_math_cbrt(v) std::cbrt(v) |
| 4936 | #elif defined(SIMDE_MATH_HAVE_MATH_H) |
| 4937 | #define simde_math_cbrt(v) cbrt(v) |
| 4938 | #endif |
| 4939 | #endif |
| 4940 | |
| 4941 | #if !defined(simde_math_cbrtf) |
| 4942 | #if SIMDE_MATH_BUILTIN_LIBM(cbrtf) |
| 4943 | #define simde_math_cbrtf(v) __builtin_cbrtf(v) |
| 4944 | #elif defined(SIMDE_MATH_HAVE_CMATH) |
| 4945 | #define simde_math_cbrtf(v) std::cbrt(v) |
| 4946 | #elif defined(SIMDE_MATH_HAVE_MATH_H) |
| 4947 | #define simde_math_cbrtf(v) cbrtf(v) |
| 4948 | #endif |
| 4949 | #endif |
| 4950 | |
| 4951 | #if !defined(simde_math_ceil) |
| 4952 | #if SIMDE_MATH_BUILTIN_LIBM(ceil) |
| 4953 | #define simde_math_ceil(v) __builtin_ceil(v) |
| 4954 | #elif defined(SIMDE_MATH_HAVE_CMATH) |
| 4955 | #define simde_math_ceil(v) std::ceil(v) |
| 4956 | #elif defined(SIMDE_MATH_HAVE_MATH_H) |
| 4957 | #define simde_math_ceil(v) ceil(v) |
| 4958 | #endif |
| 4959 | #endif |
| 4960 | |
| 4961 | #if !defined(simde_math_ceilf) |
| 4962 | #if SIMDE_MATH_BUILTIN_LIBM(ceilf) |
| 4963 | #define simde_math_ceilf(v) __builtin_ceilf(v) |
| 4964 | #elif defined(SIMDE_MATH_HAVE_CMATH) |
| 4965 | #define simde_math_ceilf(v) std::ceil(v) |
| 4966 | #elif defined(SIMDE_MATH_HAVE_MATH_H) |
| 4967 | #define simde_math_ceilf(v) ceilf(v) |
| 4968 | #endif |
| 4969 | #endif |
| 4970 | |
| 4971 | #if !defined(simde_math_copysign) |
| 4972 | #if SIMDE_MATH_BUILTIN_LIBM(copysign) |
| 4973 | #define simde_math_copysign(x, y) __builtin_copysign(x, y) |
| 4974 | #elif defined(SIMDE_MATH_HAVE_CMATH) |
| 4975 | #define simde_math_copysign(x, y) std::copysign(x, y) |
| 4976 | #elif defined(SIMDE_MATH_HAVE_MATH_H) |
| 4977 | #define simde_math_copysign(x, y) copysign(x, y) |
| 4978 | #endif |
| 4979 | #endif |
| 4980 | |
| 4981 | #if !defined(simde_math_copysignf) |
| 4982 | #if SIMDE_MATH_BUILTIN_LIBM(copysignf) |
| 4983 | #define simde_math_copysignf(x, y) __builtin_copysignf(x, y) |
| 4984 | #elif defined(SIMDE_MATH_HAVE_CMATH) |
| 4985 | #define simde_math_copysignf(x, y) std::copysignf(x, y) |
| 4986 | #elif defined(SIMDE_MATH_HAVE_MATH_H) |
| 4987 | #define simde_math_copysignf(x, y) copysignf(x, y) |
| 4988 | #endif |
| 4989 | #endif |
| 4990 | |
| 4991 | #if !defined(simde_math_signbit) |
| 4992 | #if SIMDE_MATH_BUILTIN_LIBM(signbit) |
| 4993 | #if (!defined(__clang__) || SIMDE_DETECT_CLANG_VERSION_CHECK(7,0,0)) |
| 4994 | #define simde_math_signbit(x) __builtin_signbit(x) |
| 4995 | #else |
| 4996 | #define simde_math_signbit(x) __builtin_signbit(HEDLEY_STATIC_CAST(double, (x))) |
| 4997 | #endif |
| 4998 | #elif defined(SIMDE_MATH_HAVE_CMATH) |
| 4999 | #define simde_math_signbit(x) std::signbit(x) |
| 5000 | #elif defined(SIMDE_MATH_HAVE_MATH_H) |
Showing first 5,000 of 17,950 lines.
View raw