minimap2 0.2.25.1 → 0.2.25.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. checksums.yaml +4 -4
  2. data/ext/Rakefile +2 -2
  3. data/lib/minimap2/version.rb +1 -1
  4. metadata +1 -97
  5. data/ext/minimap2/lib/simde/CONTRIBUTING.md +0 -114
  6. data/ext/minimap2/lib/simde/COPYING +0 -20
  7. data/ext/minimap2/lib/simde/README.md +0 -333
  8. data/ext/minimap2/lib/simde/amalgamate.py +0 -58
  9. data/ext/minimap2/lib/simde/meson.build +0 -33
  10. data/ext/minimap2/lib/simde/netlify.toml +0 -20
  11. data/ext/minimap2/lib/simde/simde/arm/neon/float32x2.h +0 -140
  12. data/ext/minimap2/lib/simde/simde/arm/neon/float32x4.h +0 -137
  13. data/ext/minimap2/lib/simde/simde/arm/neon/float64x1.h +0 -142
  14. data/ext/minimap2/lib/simde/simde/arm/neon/float64x2.h +0 -145
  15. data/ext/minimap2/lib/simde/simde/arm/neon/int16x4.h +0 -140
  16. data/ext/minimap2/lib/simde/simde/arm/neon/int16x8.h +0 -145
  17. data/ext/minimap2/lib/simde/simde/arm/neon/int32x2.h +0 -140
  18. data/ext/minimap2/lib/simde/simde/arm/neon/int32x4.h +0 -143
  19. data/ext/minimap2/lib/simde/simde/arm/neon/int64x1.h +0 -137
  20. data/ext/minimap2/lib/simde/simde/arm/neon/int64x2.h +0 -141
  21. data/ext/minimap2/lib/simde/simde/arm/neon/int8x16.h +0 -147
  22. data/ext/minimap2/lib/simde/simde/arm/neon/int8x8.h +0 -141
  23. data/ext/minimap2/lib/simde/simde/arm/neon/uint16x4.h +0 -134
  24. data/ext/minimap2/lib/simde/simde/arm/neon/uint16x8.h +0 -138
  25. data/ext/minimap2/lib/simde/simde/arm/neon/uint32x2.h +0 -134
  26. data/ext/minimap2/lib/simde/simde/arm/neon/uint32x4.h +0 -137
  27. data/ext/minimap2/lib/simde/simde/arm/neon/uint64x1.h +0 -131
  28. data/ext/minimap2/lib/simde/simde/arm/neon/uint64x2.h +0 -135
  29. data/ext/minimap2/lib/simde/simde/arm/neon/uint8x16.h +0 -141
  30. data/ext/minimap2/lib/simde/simde/arm/neon/uint8x8.h +0 -135
  31. data/ext/minimap2/lib/simde/simde/arm/neon.h +0 -97
  32. data/ext/minimap2/lib/simde/simde/check.h +0 -267
  33. data/ext/minimap2/lib/simde/simde/debug-trap.h +0 -83
  34. data/ext/minimap2/lib/simde/simde/hedley.h +0 -1899
  35. data/ext/minimap2/lib/simde/simde/simde-arch.h +0 -445
  36. data/ext/minimap2/lib/simde/simde/simde-common.h +0 -697
  37. data/ext/minimap2/lib/simde/simde/x86/avx.h +0 -5385
  38. data/ext/minimap2/lib/simde/simde/x86/avx2.h +0 -2402
  39. data/ext/minimap2/lib/simde/simde/x86/avx512bw.h +0 -391
  40. data/ext/minimap2/lib/simde/simde/x86/avx512f.h +0 -3389
  41. data/ext/minimap2/lib/simde/simde/x86/avx512vl.h +0 -112
  42. data/ext/minimap2/lib/simde/simde/x86/fma.h +0 -659
  43. data/ext/minimap2/lib/simde/simde/x86/mmx.h +0 -2210
  44. data/ext/minimap2/lib/simde/simde/x86/sse.h +0 -3696
  45. data/ext/minimap2/lib/simde/simde/x86/sse2.h +0 -5991
  46. data/ext/minimap2/lib/simde/simde/x86/sse3.h +0 -343
  47. data/ext/minimap2/lib/simde/simde/x86/sse4.1.h +0 -1783
  48. data/ext/minimap2/lib/simde/simde/x86/sse4.2.h +0 -105
  49. data/ext/minimap2/lib/simde/simde/x86/ssse3.h +0 -1053
  50. data/ext/minimap2/lib/simde/simde/x86/svml.h +0 -543
  51. data/ext/minimap2/lib/simde/test/CMakeLists.txt +0 -166
  52. data/ext/minimap2/lib/simde/test/arm/meson.build +0 -4
  53. data/ext/minimap2/lib/simde/test/arm/neon/meson.build +0 -23
  54. data/ext/minimap2/lib/simde/test/arm/neon/skel.c +0 -871
  55. data/ext/minimap2/lib/simde/test/arm/neon/test-neon-internal.h +0 -134
  56. data/ext/minimap2/lib/simde/test/arm/neon/test-neon.c +0 -39
  57. data/ext/minimap2/lib/simde/test/arm/neon/test-neon.h +0 -10
  58. data/ext/minimap2/lib/simde/test/arm/neon/vadd.c +0 -1260
  59. data/ext/minimap2/lib/simde/test/arm/neon/vdup_n.c +0 -873
  60. data/ext/minimap2/lib/simde/test/arm/neon/vmul.c +0 -1084
  61. data/ext/minimap2/lib/simde/test/arm/neon/vsub.c +0 -1260
  62. data/ext/minimap2/lib/simde/test/arm/test-arm-internal.h +0 -18
  63. data/ext/minimap2/lib/simde/test/arm/test-arm.c +0 -20
  64. data/ext/minimap2/lib/simde/test/arm/test-arm.h +0 -8
  65. data/ext/minimap2/lib/simde/test/cmake/AddCompilerFlags.cmake +0 -171
  66. data/ext/minimap2/lib/simde/test/cmake/ExtraWarningFlags.cmake +0 -68
  67. data/ext/minimap2/lib/simde/test/meson.build +0 -64
  68. data/ext/minimap2/lib/simde/test/munit/COPYING +0 -21
  69. data/ext/minimap2/lib/simde/test/munit/Makefile +0 -55
  70. data/ext/minimap2/lib/simde/test/munit/README.md +0 -54
  71. data/ext/minimap2/lib/simde/test/munit/example.c +0 -351
  72. data/ext/minimap2/lib/simde/test/munit/meson.build +0 -37
  73. data/ext/minimap2/lib/simde/test/munit/munit.c +0 -2055
  74. data/ext/minimap2/lib/simde/test/munit/munit.h +0 -535
  75. data/ext/minimap2/lib/simde/test/run-tests.c +0 -20
  76. data/ext/minimap2/lib/simde/test/run-tests.h +0 -260
  77. data/ext/minimap2/lib/simde/test/x86/avx.c +0 -13752
  78. data/ext/minimap2/lib/simde/test/x86/avx2.c +0 -9977
  79. data/ext/minimap2/lib/simde/test/x86/avx512bw.c +0 -2664
  80. data/ext/minimap2/lib/simde/test/x86/avx512f.c +0 -10416
  81. data/ext/minimap2/lib/simde/test/x86/avx512vl.c +0 -210
  82. data/ext/minimap2/lib/simde/test/x86/fma.c +0 -2557
  83. data/ext/minimap2/lib/simde/test/x86/meson.build +0 -33
  84. data/ext/minimap2/lib/simde/test/x86/mmx.c +0 -2878
  85. data/ext/minimap2/lib/simde/test/x86/skel.c +0 -2984
  86. data/ext/minimap2/lib/simde/test/x86/sse.c +0 -5121
  87. data/ext/minimap2/lib/simde/test/x86/sse2.c +0 -9860
  88. data/ext/minimap2/lib/simde/test/x86/sse3.c +0 -486
  89. data/ext/minimap2/lib/simde/test/x86/sse4.1.c +0 -3446
  90. data/ext/minimap2/lib/simde/test/x86/sse4.2.c +0 -101
  91. data/ext/minimap2/lib/simde/test/x86/ssse3.c +0 -2084
  92. data/ext/minimap2/lib/simde/test/x86/svml.c +0 -1545
  93. data/ext/minimap2/lib/simde/test/x86/test-avx.h +0 -16
  94. data/ext/minimap2/lib/simde/test/x86/test-avx512.h +0 -25
  95. data/ext/minimap2/lib/simde/test/x86/test-mmx.h +0 -13
  96. data/ext/minimap2/lib/simde/test/x86/test-sse.h +0 -13
  97. data/ext/minimap2/lib/simde/test/x86/test-sse2.h +0 -13
  98. data/ext/minimap2/lib/simde/test/x86/test-x86-internal.h +0 -196
  99. data/ext/minimap2/lib/simde/test/x86/test-x86.c +0 -48
  100. data/ext/minimap2/lib/simde/test/x86/test-x86.h +0 -8
@@ -1,135 +0,0 @@
1
- /* Copyright (c) 2018-2019 Evan Nemerson <evan@nemerson.com>
2
- *
3
- * Permission is hereby granted, free of charge, to any person
4
- * obtaining a copy of this software and associated documentation
5
- * files (the "Software"), to deal in the Software without
6
- * restriction, including without limitation the rights to use, copy,
7
- * modify, merge, publish, distribute, sublicense, and/or sell copies
8
- * of the Software, and to permit persons to whom the Software is
9
- * furnished to do so, subject to the following conditions:
10
- *
11
- * The above copyright notice and this permission notice shall be
12
- * included in all copies or substantial portions of the Software.
13
- *
14
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
18
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
19
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- * SOFTWARE.
22
- */
23
-
24
- #if !defined(SIMDE__INSIDE_NEON_H)
25
- # error Do not include simde/arm/neon/uint8x8.h directly; use simde/arm/neon.h.
26
- #endif
27
-
28
- #if !defined(SIMDE__NEON_UINT8X8_H)
29
- #define SIMDE__NEON_UINT8X8_H
30
-
31
- typedef union {
32
- #if defined(SIMDE_VECTOR_SUBSCRIPT)
33
- uint8_t u8 SIMDE_VECTOR(8) SIMDE_MAY_ALIAS;
34
- #else
35
- uint8_t u8[8];
36
- #endif
37
-
38
- #if defined(SIMDE_NEON_NATIVE)
39
- uint8x8_t n;
40
- #endif
41
-
42
- #if defined(SIMDE_NEON_MMX)
43
- __m64 mmx;
44
- #endif
45
- } simde_uint8x8_t;
46
-
47
- #if defined(SIMDE_NEON_NATIVE)
48
- HEDLEY_STATIC_ASSERT(sizeof(uint8x8_t) == sizeof(simde_uint8x8_t), "uint8x8_t size doesn't match simde_uint8x8_t size");
49
- #endif
50
- HEDLEY_STATIC_ASSERT(8 == sizeof(simde_uint8x8_t), "simde_uint8x8_t size incorrect");
51
-
52
- SIMDE__FUNCTION_ATTRIBUTES
53
- simde_uint8x8_t
54
- simde_vadd_u8(simde_uint8x8_t a, simde_uint8x8_t b) {
55
- simde_uint8x8_t r;
56
- #if defined(SIMDE_NEON_NATIVE)
57
- r.n = vadd_u8(a.n, b.n);
58
- #else
59
- SIMDE__VECTORIZE
60
- for (size_t i = 0 ; i < (sizeof(r.u8) / sizeof(r.u8[0])) ; i++) {
61
- r.u8[i] = a.u8[i] + b.u8[i];
62
- }
63
- #endif
64
- return r;
65
- }
66
-
67
- SIMDE__FUNCTION_ATTRIBUTES
68
- simde_uint8x8_t
69
- simde_vld1_u8 (uint8_t const ptr[8]) {
70
- simde_uint8x8_t r;
71
- #if defined(SIMDE_NEON_NATIVE)
72
- r.n = vld1_u8(ptr);
73
- #else
74
- SIMDE__VECTORIZE
75
- for (size_t i = 0 ; i < (sizeof(r.u8) / sizeof(r.u8[0])) ; i++) {
76
- r.u8[i] = ptr[i];
77
- }
78
- #endif
79
- return r;
80
- }
81
-
82
- SIMDE__FUNCTION_ATTRIBUTES
83
- simde_uint8x8_t
84
- simde_x_vload_u8 (uint8_t l0, uint8_t l1, uint8_t l2, uint8_t l3,
85
- uint8_t l4, uint8_t l5, uint8_t l6, uint8_t l7) {
86
- uint8_t v[] = { l0, l1, l2, l3, l4, l5, l6, l7 };
87
- return simde_vld1_u8(v);
88
- }
89
-
90
- SIMDE__FUNCTION_ATTRIBUTES
91
- simde_uint8x8_t
92
- simde_vdup_n_u8 (uint8_t value) {
93
- simde_uint8x8_t r;
94
- #if defined(SIMDE_NEON_NATIVE)
95
- r.n = vdup_n_u8(value);
96
- #else
97
- SIMDE__VECTORIZE
98
- for (size_t i = 0 ; i < (sizeof(r.u8) / sizeof(r.u8[0])) ; i++) {
99
- r.u8[i] = value;
100
- }
101
- #endif
102
- return r;
103
- }
104
-
105
- SIMDE__FUNCTION_ATTRIBUTES
106
- simde_uint8x8_t
107
- simde_vmul_u8(simde_uint8x8_t a, simde_uint8x8_t b) {
108
- simde_uint8x8_t r;
109
- #if defined(SIMDE_NEON_NATIVE)
110
- r.n = vmul_u8(a.n, b.n);
111
- #else
112
- SIMDE__VECTORIZE
113
- for (size_t i = 0 ; i < (sizeof(r.u8) / sizeof(r.u8[0])) ; i++) {
114
- r.u8[i] = a.u8[i] * b.u8[i];
115
- }
116
- #endif
117
- return r;
118
- }
119
-
120
- SIMDE__FUNCTION_ATTRIBUTES
121
- simde_uint8x8_t
122
- simde_vsub_u8(simde_uint8x8_t a, simde_uint8x8_t b) {
123
- simde_uint8x8_t r;
124
- #if defined(SIMDE_NEON_NATIVE)
125
- r.n = vsub_u8(a.n, b.n);
126
- #else
127
- SIMDE__VECTORIZE
128
- for (size_t i = 0 ; i < (sizeof(r.u8) / sizeof(r.u8[0])) ; i++) {
129
- r.u8[i] = a.u8[i] - b.u8[i];
130
- }
131
- #endif
132
- return r;
133
- }
134
-
135
- #endif
@@ -1,97 +0,0 @@
1
- /* Copyright (c) 2017-2020 Evan Nemerson <evan@nemerson.com>
2
- *
3
- * Permission is hereby granted, free of charge, to any person
4
- * obtaining a copy of this software and associated documentation
5
- * files (the "Software"), to deal in the Software without
6
- * restriction, including without limitation the rights to use, copy,
7
- * modify, merge, publish, distribute, sublicense, and/or sell copies
8
- * of the Software, and to permit persons to whom the Software is
9
- * furnished to do so, subject to the following conditions:
10
- *
11
- * The above copyright notice and this permission notice shall be
12
- * included in all copies or substantial portions of the Software.
13
- *
14
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
18
- * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
19
- * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- * SOFTWARE.
22
- */
23
-
24
- #if !defined(SIMDE__NEON_H)
25
- # define SIMDE__INSIDE_NEON_H
26
- # if !defined(SIMDE__NEON_H)
27
- # define SIMDE__NEON_H
28
- # endif
29
- # include "../simde-common.h"
30
-
31
- # if defined(SIMDE_NEON_FORCE_NATIVE)
32
- # define SIMDE_NEON_NATIVE
33
- # elif defined(__ARM_NEON) && !defined(SIMDE_NEON_NO_NATIVE) && !defined(SIMDE_NO_NATIVE)
34
- # define SIMDE_NEON_NATIVE
35
- # endif
36
-
37
- # if defined(SIMDE_NEON64_FORCE_NATIVE)
38
- # define SIMDE_NEON64_NATIVE
39
- # elif defined(SIMDE_ARCH_AARCH64) && !defined(SIMDE_NEON64_NO_NATIVE) && !defined(SIMDE_NO_NATIVE)
40
- # define SIMDE_NEON64_NATIVE
41
- # endif
42
-
43
- # if defined(__MMX__) && !defined(SIMDE_NEON_NO_MMX) && !defined(SIMDE_NO_MMX)
44
- # define SIMDE_NEON_MMX
45
- # include <mmintrin.h>
46
- # endif
47
- # if defined(__SSE__) && !defined(SIMDE_NEON_NO_SSE) && !defined(SIMDE_NO_SSE)
48
- # define SIMDE_NEON_SSE
49
- # include <xmmintrin.h>
50
- # endif
51
- # if defined(__SSE2__) && !defined(SIMDE_NEON_NO_SSE2) && !defined(SIMDE_NO_SSE2)
52
- # define SIMDE_NEON_SSE2
53
- # include <emmintrin.h>
54
- # endif
55
-
56
- # if defined(SIMDE_NEON_NATIVE)
57
- # include <arm_neon.h>
58
- # endif
59
- # include <stdint.h>
60
-
61
- SIMDE__BEGIN_DECLS
62
-
63
- #include "neon/int8x8.h"
64
- #include "neon/int16x4.h"
65
- #include "neon/int32x2.h"
66
- #include "neon/int64x1.h"
67
- #include "neon/uint8x8.h"
68
- #include "neon/uint16x4.h"
69
- #include "neon/uint32x2.h"
70
- #include "neon/uint64x1.h"
71
- #include "neon/float32x2.h"
72
- #include "neon/float64x1.h"
73
-
74
- #include "neon/int8x16.h"
75
- #include "neon/int16x8.h"
76
- #include "neon/int32x4.h"
77
- #include "neon/int64x2.h"
78
- #include "neon/uint8x16.h"
79
- #include "neon/uint16x8.h"
80
- #include "neon/uint32x4.h"
81
- #include "neon/uint64x2.h"
82
- #include "neon/float32x4.h"
83
- #include "neon/float64x2.h"
84
-
85
- SIMDE__FUNCTION_ATTRIBUTES
86
- int8_t
87
- simde_vget_lane_s8(simde_int8x8_t v, const int lane) {
88
- return v.i8[lane];
89
- }
90
- #if defined(SIMDE_NEON_NATIVE)
91
- # define simde_vget_lane_s8(v, lane) vget_lane_s8(v.n, lane)
92
- #endif
93
-
94
- SIMDE__END_DECLS
95
-
96
- #undef SIMDE__INSIDE_NEON_H
97
- #endif /* !defined(SIMDE__NEON_H) */
@@ -1,267 +0,0 @@
1
- /* Check (assertions)
2
- * Portable Snippets - https://gitub.com/nemequ/portable-snippets
3
- * Created by Evan Nemerson <evan@nemerson.com>
4
- *
5
- * To the extent possible under law, the authors have waived all
6
- * copyright and related or neighboring rights to this code. For
7
- * details, see the Creative Commons Zero 1.0 Universal license at
8
- * https://creativecommons.org/publicdomain/zero/1.0/
9
- */
10
-
11
- #if !defined(SIMDE_CHECK_H)
12
- #define SIMDE_CHECK_H
13
-
14
- #if !defined(SIMDE_NDEBUG) && !defined(SIMDE_DEBUG)
15
- # define SIMDE_NDEBUG 1
16
- #endif
17
-
18
- #include <stdint.h>
19
-
20
- #if !defined(_WIN32)
21
- # define SIMDE_SIZE_MODIFIER "z"
22
- # define SIMDE_CHAR_MODIFIER "hh"
23
- # define SIMDE_SHORT_MODIFIER "h"
24
- #else
25
- # if defined(_M_X64) || defined(__amd64__)
26
- # define SIMDE_SIZE_MODIFIER "I64"
27
- # else
28
- # define SIMDE_SIZE_MODIFIER ""
29
- # endif
30
- # define SIMDE_CHAR_MODIFIER ""
31
- # define SIMDE_SHORT_MODIFIER ""
32
- #endif
33
-
34
- #if defined(_MSC_VER) && (_MSC_VER >= 1500)
35
- # define SIMDE__PUSH_DISABLE_MSVC_C4127 __pragma(warning(push)) __pragma(warning(disable:4127))
36
- # define SIMDE__POP_DISABLE_MSVC_C4127 __pragma(warning(pop))
37
- #else
38
- # define SIMDE__PUSH_DISABLE_MSVC_C4127
39
- # define SIMDE__POP_DISABLE_MSVC_C4127
40
- #endif
41
-
42
- #if !defined(simde_errorf)
43
- # if defined(__has_include)
44
- # if __has_include(<stdio.h>)
45
- # include <stdio.h>
46
- # endif
47
- # elif defined(SIMDE_STDC_HOSTED)
48
- # if SIMDE_STDC_HOSTED == 1
49
- # include <stdio.h>
50
- # endif
51
- # elif defined(__STDC_HOSTED__)
52
- # if __STDC_HOSTETD__ == 1
53
- # include <stdio.h>
54
- # endif
55
- # endif
56
-
57
- # include "debug-trap.h"
58
-
59
- # if defined(EOF)
60
- # define simde_errorf(format, ...) (fprintf(stderr, format, __VA_ARGS__), abort())
61
- # else
62
- # define simde_errorf(format, ...) (simde_trap())
63
- # endif
64
- #endif
65
-
66
- #define simde_error(msg) simde_errorf("%s", msg)
67
-
68
- #if defined(SIMDE_NDEBUG)
69
- # if defined(SIMDE_CHECK_FAIL_DEFINED)
70
- # define simde_assert(expr)
71
- # else
72
- # if defined(HEDLEY_ASSUME)
73
- # define simde_assert(expr) HEDLEY_ASSUME(expr)
74
- # elif HEDLEY_GCC_VERSION_CHECK(4,5,0)
75
- # define simde_assert(expr) ((void) (!!(expr) ? 1 : (__builtin_unreachable(), 1)))
76
- # elif HEDLEY_MSVC_VERSION_CHECK(13,10,0)
77
- # define simde_assert(expr) __assume(expr)
78
- # else
79
- # define simde_assert(expr)
80
- # endif
81
- # endif
82
- # define simde_assert_true(expr) simde_assert(expr)
83
- # define simde_assert_false(expr) simde_assert(!(expr))
84
- # define simde_assert_type_full(prefix, suffix, T, fmt, a, op, b) simde_assert(((a) op (b)))
85
- # define simde_assert_double_equal(a, b, precision)
86
- # define simde_assert_string_equal(a, b)
87
- # define simde_assert_string_not_equal(a, b)
88
- # define simde_assert_memory_equal(size, a, b)
89
- # define simde_assert_memory_not_equal(size, a, b)
90
- #else
91
- # define simde_assert(expr) \
92
- do { \
93
- if (!HEDLEY_LIKELY(expr)) { \
94
- simde_error("assertion failed: " #expr "\n"); \
95
- } \
96
- SIMDE__PUSH_DISABLE_MSVC_C4127 \
97
- } while (0) \
98
- SIMDE__POP_DISABLE_MSVC_C4127
99
-
100
- # define simde_assert_true(expr) \
101
- do { \
102
- if (!HEDLEY_LIKELY(expr)) { \
103
- simde_error("assertion failed: " #expr " is not true\n"); \
104
- } \
105
- SIMDE__PUSH_DISABLE_MSVC_C4127 \
106
- } while (0) \
107
- SIMDE__POP_DISABLE_MSVC_C4127
108
-
109
- # define simde_assert_false(expr) \
110
- do { \
111
- if (!HEDLEY_LIKELY(!(expr))) { \
112
- simde_error("assertion failed: " #expr " is not false\n"); \
113
- } \
114
- SIMDE__PUSH_DISABLE_MSVC_C4127 \
115
- } while (0) \
116
- SIMDE__POP_DISABLE_MSVC_C4127
117
-
118
- # define simde_assert_type_full(prefix, suffix, T, fmt, a, op, b) \
119
- do { \
120
- T simde_tmp_a_ = (a); \
121
- T simde_tmp_b_ = (b); \
122
- if (!(simde_tmp_a_ op simde_tmp_b_)) { \
123
- simde_errorf("assertion failed: %s %s %s (" prefix "%" fmt suffix " %s " prefix "%" fmt suffix ")\n", \
124
- #a, #op, #b, simde_tmp_a_, #op, simde_tmp_b_); \
125
- } \
126
- SIMDE__PUSH_DISABLE_MSVC_C4127 \
127
- } while (0) \
128
- SIMDE__POP_DISABLE_MSVC_C4127
129
-
130
- # define simde_assert_double_equal(a, b, precision) \
131
- do { \
132
- const double simde_tmp_a_ = (a); \
133
- const double simde_tmp_b_ = (b); \
134
- const double simde_tmp_diff_ = ((simde_tmp_a_ - simde_tmp_b_) < 0) ? \
135
- -(simde_tmp_a_ - simde_tmp_b_) : \
136
- (simde_tmp_a_ - simde_tmp_b_); \
137
- if (HEDLEY_UNLIKELY(simde_tmp_diff_ > 1e-##precision)) { \
138
- simde_errorf("assertion failed: %s == %s (%0." #precision "g == %0." #precision "g)\n", \
139
- #a, #b, simde_tmp_a_, simde_tmp_b_); \
140
- } \
141
- SIMDE__PUSH_DISABLE_MSVC_C4127 \
142
- } while (0) \
143
- SIMDE__POP_DISABLE_MSVC_C4127
144
-
145
- # include <string.h>
146
- # define simde_assert_string_equal(a, b) \
147
- do { \
148
- const char* simde_tmp_a_ = a; \
149
- const char* simde_tmp_b_ = b; \
150
- if (HEDLEY_UNLIKELY(strcmp(simde_tmp_a_, simde_tmp_b_) != 0)) { \
151
- simde_errorf("assertion failed: string %s == %s (\"%s\" == \"%s\")\n", \
152
- #a, #b, simde_tmp_a_, simde_tmp_b_); \
153
- } \
154
- SIMDE__PUSH_DISABLE_MSVC_C4127 \
155
- } while (0) \
156
- SIMDE__POP_DISABLE_MSVC_C4127
157
-
158
- # define simde_assert_string_not_equal(a, b) \
159
- do { \
160
- const char* simde_tmp_a_ = a; \
161
- const char* simde_tmp_b_ = b; \
162
- if (HEDLEY_UNLIKELY(strcmp(simde_tmp_a_, simde_tmp_b_) == 0)) { \
163
- simde_errorf("assertion failed: string %s != %s (\"%s\" == \"%s\")\n", \
164
- #a, #b, simde_tmp_a_, simde_tmp_b_); \
165
- } \
166
- SIMDE__PUSH_DISABLE_MSVC_C4127 \
167
- } while (0) \
168
- SIMDE__POP_DISABLE_MSVC_C4127
169
-
170
- # define simde_assert_memory_equal(size, a, b) \
171
- do { \
172
- const unsigned char* simde_tmp_a_ = (const unsigned char*) (a); \
173
- const unsigned char* simde_tmp_b_ = (const unsigned char*) (b); \
174
- const size_t simde_tmp_size_ = (size); \
175
- if (HEDLEY_UNLIKELY(memcmp(simde_tmp_a_, simde_tmp_b_, simde_tmp_size_)) != 0) { \
176
- size_t simde_tmp_pos_; \
177
- for (simde_tmp_pos_ = 0 ; simde_tmp_pos_ < simde_tmp_size_ ; simde_tmp_pos_++) { \
178
- if (simde_tmp_a_[simde_tmp_pos_] != simde_tmp_b_[simde_tmp_pos_]) { \
179
- simde_errorf("assertion failed: memory %s == %s, at offset %" SIMDE_SIZE_MODIFIER "u\n", \
180
- #a, #b, simde_tmp_pos_); \
181
- break; \
182
- } \
183
- } \
184
- } \
185
- SIMDE__PUSH_DISABLE_MSVC_C4127 \
186
- } while (0) \
187
- SIMDE__POP_DISABLE_MSVC_C4127
188
-
189
- # define simde_assert_memory_not_equal(size, a, b) \
190
- do { \
191
- const unsigned char* simde_tmp_a_ = (const unsigned char*) (a); \
192
- const unsigned char* simde_tmp_b_ = (const unsigned char*) (b); \
193
- const size_t simde_tmp_size_ = (size); \
194
- if (HEDLEY_UNLIKELY(memcmp(simde_tmp_a_, simde_tmp_b_, simde_tmp_size_)) == 0) { \
195
- simde_errorf("assertion failed: memory %s != %s (%" SIMDE_SIZE_MODIFIER "u bytes)\n", \
196
- #a, #b, simde_tmp_size_); \
197
- } \
198
- SIMDE__PUSH_DISABLE_MSVC_C4127 \
199
- } while (0) \
200
- SIMDE__POP_DISABLE_MSVC_C4127
201
- #endif
202
-
203
- #define simde_assert_type(T, fmt, a, op, b) \
204
- simde_assert_type_full("", "", T, fmt, a, op, b)
205
-
206
- #define simde_assert_char(a, op, b) \
207
- simde_assert_type_full("'\\x", "'", char, "02" SIMDE_CHAR_MODIFIER "x", a, op, b)
208
- #define simde_assert_uchar(a, op, b) \
209
- simde_assert_type_full("'\\x", "'", unsigned char, "02" SIMDE_CHAR_MODIFIER "x", a, op, b)
210
- #define simde_assert_short(a, op, b) \
211
- simde_assert_type(short, SIMDE_SHORT_MODIFIER "d", a, op, b)
212
- #define simde_assert_ushort(a, op, b) \
213
- simde_assert_type(unsigned short, SIMDE_SHORT_MODIFIER "u", a, op, b)
214
- #define simde_assert_int(a, op, b) \
215
- simde_assert_type(int, "d", a, op, b)
216
- #define simde_assert_uint(a, op, b) \
217
- simde_assert_type(unsigned int, "u", a, op, b)
218
- #define simde_assert_long(a, op, b) \
219
- simde_assert_type(long int, "ld", a, op, b)
220
- #define simde_assert_ulong(a, op, b) \
221
- simde_assert_type(unsigned long int, "lu", a, op, b)
222
- #define simde_assert_llong(a, op, b) \
223
- simde_assert_type(long long int, "lld", a, op, b)
224
- #define simde_assert_ullong(a, op, b) \
225
- simde_assert_type(unsigned long long int, "llu", a, op, b)
226
-
227
- #define simde_assert_size(a, op, b) \
228
- simde_assert_type(size_t, SIMDE_SIZE_MODIFIER "u", a, op, b)
229
-
230
- #define simde_assert_float(a, op, b) \
231
- simde_assert_type(float, "f", a, op, b)
232
- #define simde_assert_double(a, op, b) \
233
- simde_assert_type(double, "g", a, op, b)
234
- #define simde_assert_ptr(a, op, b) \
235
- simde_assert_type(const void*, "p", a, op, b)
236
-
237
- #define simde_assert_int8(a, op, b) \
238
- simde_assert_type(int8_t, PRIi8, a, op, b)
239
- #define simde_assert_uint8(a, op, b) \
240
- simde_assert_type(uint8_t, PRIu8, a, op, b)
241
- #define simde_assert_int16(a, op, b) \
242
- simde_assert_type(int16_t, PRIi16, a, op, b)
243
- #define simde_assert_uint16(a, op, b) \
244
- simde_assert_type(uint16_t, PRIu16, a, op, b)
245
- #define simde_assert_int32(a, op, b) \
246
- simde_assert_type(int32_t, PRIi32, a, op, b)
247
- #define simde_assert_uint32(a, op, b) \
248
- simde_assert_type(uint32_t, PRIu32, a, op, b)
249
- #define simde_assert_int64(a, op, b) \
250
- simde_assert_type(int64_t, PRIi64, a, op, b)
251
- #define simde_assert_uint64(a, op, b) \
252
- simde_assert_type(uint64_t, PRIu64, a, op, b)
253
-
254
- #define simde_assert_ptr_equal(a, b) \
255
- simde_assert_ptr(a, ==, b)
256
- #define simde_assert_ptr_not_equal(a, b) \
257
- simde_assert_ptr(a, !=, b)
258
- #define simde_assert_null(ptr) \
259
- simde_assert_ptr(ptr, ==, NULL)
260
- #define simde_assert_not_null(ptr) \
261
- simde_assert_ptr(ptr, !=, NULL)
262
- #define simde_assert_ptr_null(ptr) \
263
- simde_assert_ptr(ptr, ==, NULL)
264
- #define simde_assert_ptr_not_null(ptr) \
265
- simde_assert_ptr(ptr, !=, NULL)
266
-
267
- #endif /* !defined(SIMDE_CHECK_H) */
@@ -1,83 +0,0 @@
1
- /* Debugging assertions and traps
2
- * Portable Snippets - https://gitub.com/nemequ/portable-snippets
3
- * Created by Evan Nemerson <evan@nemerson.com>
4
- *
5
- * To the extent possible under law, the authors have waived all
6
- * copyright and related or neighboring rights to this code. For
7
- * details, see the Creative Commons Zero 1.0 Universal license at
8
- * https://creativecommons.org/publicdomain/zero/1.0/
9
- */
10
-
11
- #if !defined(SIMDE_DEBUG_TRAP_H)
12
- #define SIMDE_DEBUG_TRAP_H
13
-
14
- #if !defined(SIMDE_NDEBUG) && defined(NDEBUG) && !defined(SIMDE_DEBUG)
15
- # define SIMDE_NDEBUG 1
16
- #endif
17
-
18
- #if defined(__has_builtin) && !defined(__ibmxl__)
19
- # if __has_builtin(__builtin_debugtrap)
20
- # define simde_trap() __builtin_debugtrap()
21
- # elif __has_builtin(__debugbreak)
22
- # define simde_trap() __debugbreak()
23
- # endif
24
- #endif
25
- #if !defined(simde_trap)
26
- # if defined(_MSC_VER) || defined(__INTEL_COMPILER)
27
- # define simde_trap() __debugbreak()
28
- # elif defined(__ARMCC_VERSION)
29
- # define simde_trap() __breakpoint(42)
30
- # elif defined(__ibmxl__) || defined(__xlC__)
31
- # include <builtins.h>
32
- # define simde_trap() __trap(42)
33
- # elif defined(__DMC__) && defined(_M_IX86)
34
- static inline void simde_trap(void) { __asm int 3h; }
35
- # elif defined(__i386__) || defined(__x86_64__)
36
- static inline void simde_trap(void) { __asm__ __volatile__("int $03"); }
37
- # elif defined(__thumb__)
38
- static inline void simde_trap(void) { __asm__ __volatile__(".inst 0xde01"); }
39
- # elif defined(__aarch64__)
40
- static inline void simde_trap(void) { __asm__ __volatile__(".inst 0xd4200000"); }
41
- # elif defined(__arm__)
42
- static inline void simde_trap(void) { __asm__ __volatile__(".inst 0xe7f001f0"); }
43
- # elif defined (__alpha__) && !defined(__osf__)
44
- static inline void simde_trap(void) { __asm__ __volatile__("bpt"); }
45
- # elif defined(_54_)
46
- static inline void simde_trap(void) { __asm__ __volatile__("ESTOP"); }
47
- # elif defined(_55_)
48
- static inline void simde_trap(void) { __asm__ __volatile__(";\n .if (.MNEMONIC)\n ESTOP_1\n .else\n ESTOP_1()\n .endif\n NOP"); }
49
- # elif defined(_64P_)
50
- static inline void simde_trap(void) { __asm__ __volatile__("SWBP 0"); }
51
- # elif defined(_6x_)
52
- static inline void simde_trap(void) { __asm__ __volatile__("NOP\n .word 0x10000000"); }
53
- # elif defined(__STDC_HOSTED__) && (__STDC_HOSTED__ == 0) && defined(__GNUC__)
54
- # define simde_trap() __builtin_trap()
55
- # else
56
- # include <signal.h>
57
- # if defined(SIGTRAP)
58
- # define simde_trap() raise(SIGTRAP)
59
- # else
60
- # define simde_trap() raise(SIGABRT)
61
- # endif
62
- # endif
63
- #endif
64
-
65
- #if defined(HEDLEY_LIKELY)
66
- # define SIMDE_DBG_LIKELY(expr) HEDLEY_LIKELY(expr)
67
- #elif defined(__GNUC__) && (__GNUC__ >= 3)
68
- # define SIMDE_DBG_LIKELY(expr) __builtin_expect(!!(expr), 1)
69
- #else
70
- # define SIMDE_DBG_LIKELY(expr) (!!(expr))
71
- #endif
72
-
73
- #if !defined(SIMDE_NDEBUG) || (SIMDE_NDEBUG == 0)
74
- # define simde_dbg_assert(expr) do { \
75
- if (!SIMDE_DBG_LIKELY(expr)) { \
76
- simde_trap(); \
77
- } \
78
- } while (0)
79
- #else
80
- # define simde_dbg_assert(expr)
81
- #endif
82
-
83
- #endif /* !defined(SIMDE_DEBUG_TRAP_H) */