minimap2 0.2.25.0 → 0.2.25.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -3
- data/ext/minimap2/Makefile +6 -2
- data/ext/minimap2/NEWS.md +38 -0
- data/ext/minimap2/README.md +9 -3
- data/ext/minimap2/align.c +5 -3
- data/ext/minimap2/cookbook.md +2 -2
- data/ext/minimap2/format.c +7 -4
- data/ext/minimap2/kalloc.c +20 -1
- data/ext/minimap2/kalloc.h +13 -2
- data/ext/minimap2/ksw2.h +1 -0
- data/ext/minimap2/ksw2_extd2_sse.c +1 -1
- data/ext/minimap2/ksw2_exts2_sse.c +79 -40
- data/ext/minimap2/ksw2_extz2_sse.c +1 -1
- data/ext/minimap2/lchain.c +15 -16
- data/ext/minimap2/lib/simde/CONTRIBUTING.md +114 -0
- data/ext/minimap2/lib/simde/COPYING +20 -0
- data/ext/minimap2/lib/simde/README.md +333 -0
- data/ext/minimap2/lib/simde/amalgamate.py +58 -0
- data/ext/minimap2/lib/simde/meson.build +33 -0
- data/ext/minimap2/lib/simde/netlify.toml +20 -0
- data/ext/minimap2/lib/simde/simde/arm/neon/float32x2.h +140 -0
- data/ext/minimap2/lib/simde/simde/arm/neon/float32x4.h +137 -0
- data/ext/minimap2/lib/simde/simde/arm/neon/float64x1.h +142 -0
- data/ext/minimap2/lib/simde/simde/arm/neon/float64x2.h +145 -0
- data/ext/minimap2/lib/simde/simde/arm/neon/int16x4.h +140 -0
- data/ext/minimap2/lib/simde/simde/arm/neon/int16x8.h +145 -0
- data/ext/minimap2/lib/simde/simde/arm/neon/int32x2.h +140 -0
- data/ext/minimap2/lib/simde/simde/arm/neon/int32x4.h +143 -0
- data/ext/minimap2/lib/simde/simde/arm/neon/int64x1.h +137 -0
- data/ext/minimap2/lib/simde/simde/arm/neon/int64x2.h +141 -0
- data/ext/minimap2/lib/simde/simde/arm/neon/int8x16.h +147 -0
- data/ext/minimap2/lib/simde/simde/arm/neon/int8x8.h +141 -0
- data/ext/minimap2/lib/simde/simde/arm/neon/uint16x4.h +134 -0
- data/ext/minimap2/lib/simde/simde/arm/neon/uint16x8.h +138 -0
- data/ext/minimap2/lib/simde/simde/arm/neon/uint32x2.h +134 -0
- data/ext/minimap2/lib/simde/simde/arm/neon/uint32x4.h +137 -0
- data/ext/minimap2/lib/simde/simde/arm/neon/uint64x1.h +131 -0
- data/ext/minimap2/lib/simde/simde/arm/neon/uint64x2.h +135 -0
- data/ext/minimap2/lib/simde/simde/arm/neon/uint8x16.h +141 -0
- data/ext/minimap2/lib/simde/simde/arm/neon/uint8x8.h +135 -0
- data/ext/minimap2/lib/simde/simde/arm/neon.h +97 -0
- data/ext/minimap2/lib/simde/simde/check.h +267 -0
- data/ext/minimap2/lib/simde/simde/debug-trap.h +83 -0
- data/ext/minimap2/lib/simde/simde/hedley.h +1899 -0
- data/ext/minimap2/lib/simde/simde/simde-arch.h +445 -0
- data/ext/minimap2/lib/simde/simde/simde-common.h +697 -0
- data/ext/minimap2/lib/simde/simde/x86/avx.h +5385 -0
- data/ext/minimap2/lib/simde/simde/x86/avx2.h +2402 -0
- data/ext/minimap2/lib/simde/simde/x86/avx512bw.h +391 -0
- data/ext/minimap2/lib/simde/simde/x86/avx512f.h +3389 -0
- data/ext/minimap2/lib/simde/simde/x86/avx512vl.h +112 -0
- data/ext/minimap2/lib/simde/simde/x86/fma.h +659 -0
- data/ext/minimap2/lib/simde/simde/x86/mmx.h +2210 -0
- data/ext/minimap2/lib/simde/simde/x86/sse.h +3696 -0
- data/ext/minimap2/lib/simde/simde/x86/sse2.h +5991 -0
- data/ext/minimap2/lib/simde/simde/x86/sse3.h +343 -0
- data/ext/minimap2/lib/simde/simde/x86/sse4.1.h +1783 -0
- data/ext/minimap2/lib/simde/simde/x86/sse4.2.h +105 -0
- data/ext/minimap2/lib/simde/simde/x86/ssse3.h +1053 -0
- data/ext/minimap2/lib/simde/simde/x86/svml.h +543 -0
- data/ext/minimap2/lib/simde/test/CMakeLists.txt +166 -0
- data/ext/minimap2/lib/simde/test/arm/meson.build +4 -0
- data/ext/minimap2/lib/simde/test/arm/neon/meson.build +23 -0
- data/ext/minimap2/lib/simde/test/arm/neon/skel.c +871 -0
- data/ext/minimap2/lib/simde/test/arm/neon/test-neon-internal.h +134 -0
- data/ext/minimap2/lib/simde/test/arm/neon/test-neon.c +39 -0
- data/ext/minimap2/lib/simde/test/arm/neon/test-neon.h +10 -0
- data/ext/minimap2/lib/simde/test/arm/neon/vadd.c +1260 -0
- data/ext/minimap2/lib/simde/test/arm/neon/vdup_n.c +873 -0
- data/ext/minimap2/lib/simde/test/arm/neon/vmul.c +1084 -0
- data/ext/minimap2/lib/simde/test/arm/neon/vsub.c +1260 -0
- data/ext/minimap2/lib/simde/test/arm/test-arm-internal.h +18 -0
- data/ext/minimap2/lib/simde/test/arm/test-arm.c +20 -0
- data/ext/minimap2/lib/simde/test/arm/test-arm.h +8 -0
- data/ext/minimap2/lib/simde/test/cmake/AddCompilerFlags.cmake +171 -0
- data/ext/minimap2/lib/simde/test/cmake/ExtraWarningFlags.cmake +68 -0
- data/ext/minimap2/lib/simde/test/meson.build +64 -0
- data/ext/minimap2/lib/simde/test/munit/COPYING +21 -0
- data/ext/minimap2/lib/simde/test/munit/Makefile +55 -0
- data/ext/minimap2/lib/simde/test/munit/README.md +54 -0
- data/ext/minimap2/lib/simde/test/munit/example.c +351 -0
- data/ext/minimap2/lib/simde/test/munit/meson.build +37 -0
- data/ext/minimap2/lib/simde/test/munit/munit.c +2055 -0
- data/ext/minimap2/lib/simde/test/munit/munit.h +535 -0
- data/ext/minimap2/lib/simde/test/run-tests.c +20 -0
- data/ext/minimap2/lib/simde/test/run-tests.h +260 -0
- data/ext/minimap2/lib/simde/test/x86/avx.c +13752 -0
- data/ext/minimap2/lib/simde/test/x86/avx2.c +9977 -0
- data/ext/minimap2/lib/simde/test/x86/avx512bw.c +2664 -0
- data/ext/minimap2/lib/simde/test/x86/avx512f.c +10416 -0
- data/ext/minimap2/lib/simde/test/x86/avx512vl.c +210 -0
- data/ext/minimap2/lib/simde/test/x86/fma.c +2557 -0
- data/ext/minimap2/lib/simde/test/x86/meson.build +33 -0
- data/ext/minimap2/lib/simde/test/x86/mmx.c +2878 -0
- data/ext/minimap2/lib/simde/test/x86/skel.c +2984 -0
- data/ext/minimap2/lib/simde/test/x86/sse.c +5121 -0
- data/ext/minimap2/lib/simde/test/x86/sse2.c +9860 -0
- data/ext/minimap2/lib/simde/test/x86/sse3.c +486 -0
- data/ext/minimap2/lib/simde/test/x86/sse4.1.c +3446 -0
- data/ext/minimap2/lib/simde/test/x86/sse4.2.c +101 -0
- data/ext/minimap2/lib/simde/test/x86/ssse3.c +2084 -0
- data/ext/minimap2/lib/simde/test/x86/svml.c +1545 -0
- data/ext/minimap2/lib/simde/test/x86/test-avx.h +16 -0
- data/ext/minimap2/lib/simde/test/x86/test-avx512.h +25 -0
- data/ext/minimap2/lib/simde/test/x86/test-mmx.h +13 -0
- data/ext/minimap2/lib/simde/test/x86/test-sse.h +13 -0
- data/ext/minimap2/lib/simde/test/x86/test-sse2.h +13 -0
- data/ext/minimap2/lib/simde/test/x86/test-x86-internal.h +196 -0
- data/ext/minimap2/lib/simde/test/x86/test-x86.c +48 -0
- data/ext/minimap2/lib/simde/test/x86/test-x86.h +8 -0
- data/ext/minimap2/main.c +13 -6
- data/ext/minimap2/map.c +0 -5
- data/ext/minimap2/minimap.h +40 -31
- data/ext/minimap2/minimap2.1 +19 -5
- data/ext/minimap2/misc/paftools.js +545 -24
- data/ext/minimap2/options.c +1 -1
- data/ext/minimap2/pyproject.toml +2 -0
- data/ext/minimap2/python/mappy.pyx +3 -1
- data/ext/minimap2/seed.c +1 -1
- data/ext/minimap2/setup.py +32 -22
- data/lib/minimap2/version.rb +1 -1
- metadata +100 -3
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
#if !defined(SIMDE_RUN_TESTS_H)
|
|
2
|
+
#define SIMDE_RUN_TESTS_H
|
|
3
|
+
|
|
4
|
+
#include "../simde/hedley.h"
|
|
5
|
+
#include "munit/munit.h"
|
|
6
|
+
#include "../simde/simde-common.h"
|
|
7
|
+
|
|
8
|
+
#include <stdio.h>
|
|
9
|
+
#include <math.h>
|
|
10
|
+
|
|
11
|
+
SIMDE_DISABLE_UNWANTED_DIAGNOSTICS
|
|
12
|
+
|
|
13
|
+
#if defined(HEDLEY_MSVC_VERSION)
|
|
14
|
+
/* Unused function(s) */
|
|
15
|
+
#pragma warning(disable:4505)
|
|
16
|
+
#endif
|
|
17
|
+
|
|
18
|
+
HEDLEY_DIAGNOSTIC_PUSH
|
|
19
|
+
|
|
20
|
+
#define SIMDE_TESTS_CONCAT3_EX(a, b, c) a##b##c
|
|
21
|
+
#define SIMDE_TESTS_CONCAT3(a, b, c) SIMDE_TESTS_CONCAT3_EX(a, b, c)
|
|
22
|
+
|
|
23
|
+
#if defined(__cplusplus)
|
|
24
|
+
# define SIMDE_TESTS_CURRENT_LANG cpp
|
|
25
|
+
#else
|
|
26
|
+
# define SIMDE_TESTS_CURRENT_LANG c
|
|
27
|
+
#endif
|
|
28
|
+
|
|
29
|
+
#if defined(SIMDE_NO_NATIVE)
|
|
30
|
+
# define SIMDE_TESTS_CURRENT_NATIVE emul
|
|
31
|
+
#else
|
|
32
|
+
# define SIMDE_TESTS_CURRENT_NATIVE native
|
|
33
|
+
#endif
|
|
34
|
+
|
|
35
|
+
#define SIMDE_TESTS_GENERATE_SYMBOL_FULL(sym, arch, isa, native, lang) \
|
|
36
|
+
HEDLEY_CONCAT(HEDLEY_CONCAT(HEDLEY_CONCAT(HEDLEY_CONCAT(HEDLEY_CONCAT(HEDLEY_CONCAT(HEDLEY_CONCAT(HEDLEY_CONCAT(simde_tests_, HEDLEY_CONCAT(arch, _)), isa), _), native), _), lang),_),sym)
|
|
37
|
+
|
|
38
|
+
#define SIMDE_TESTS_GENERATE_SYMBOL(sym) \
|
|
39
|
+
SIMDE_TESTS_GENERATE_SYMBOL_FULL(sym, SIMDE_TESTS_CURRENT_ARCH, SIMDE_TESTS_CURRENT_ISAX, SIMDE_TESTS_CURRENT_NATIVE, SIMDE_TESTS_CURRENT_LANG)
|
|
40
|
+
|
|
41
|
+
#if defined(SIMDE_BUILD_CPP_TESTS)
|
|
42
|
+
#define SIMDE_TESTS_GENERATE_NAME(name) \
|
|
43
|
+
"/" HEDLEY_STRINGIFY(name) "/" HEDLEY_STRINGIFY(SIMDE_TESTS_CURRENT_NATIVE) "/" HEDLEY_STRINGIFY(SIMDE_TESTS_CURRENT_LANG)
|
|
44
|
+
#else
|
|
45
|
+
#define SIMDE_TESTS_GENERATE_NAME(name) \
|
|
46
|
+
"/" HEDLEY_STRINGIFY(name) "/" HEDLEY_STRINGIFY(SIMDE_TESTS_CURRENT_NATIVE)
|
|
47
|
+
#endif
|
|
48
|
+
|
|
49
|
+
#define SIMDE_TESTS_DEFINE_TEST(name) \
|
|
50
|
+
{ (char*) SIMDE_TESTS_GENERATE_NAME(name), test_simde_##name, NULL, NULL, MUNIT_TEST_OPTION_NONE, NULL }
|
|
51
|
+
|
|
52
|
+
HEDLEY_BEGIN_C_DECLS
|
|
53
|
+
|
|
54
|
+
#if !defined(HEDLEY_PGI_VERSION)
|
|
55
|
+
# define SIMDE_ALMOST_EQUAL_TO "≈"
|
|
56
|
+
#else
|
|
57
|
+
# define SIMDE_ALMOST_EQUAL_TO "~=~"
|
|
58
|
+
#endif
|
|
59
|
+
|
|
60
|
+
SIMDE__FUNCTION_POSSIBLY_UNUSED
|
|
61
|
+
static int
|
|
62
|
+
simde_check_double_close(double a, double b, int precision) {
|
|
63
|
+
const double r = 1.0 * pow(10, HEDLEY_STATIC_CAST(double, precision));
|
|
64
|
+
return
|
|
65
|
+
HEDLEY_UNLIKELY(a < (b - r)) ||
|
|
66
|
+
HEDLEY_UNLIKELY(a > (b + r));
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
#define SIMDE_TEST_DEFINE_ASSERT_VEC_CLOSE(VT, accessor) \
|
|
70
|
+
HEDLEY_ALWAYS_INLINE \
|
|
71
|
+
static void \
|
|
72
|
+
simde_assert_##VT##_##accessor##_close_ex(int line, const char* file, simde__##VT a, simde__##VT b, int precision) { \
|
|
73
|
+
simde__##VT##_private \
|
|
74
|
+
a_ = simde__##VT##_to_private(a), \
|
|
75
|
+
b_ = simde__##VT##_to_private(b); \
|
|
76
|
+
\
|
|
77
|
+
for (int i = 0 ; i < HEDLEY_STATIC_CAST(int, sizeof(a_.accessor) / sizeof(a_.accessor[0])) ; i++) { \
|
|
78
|
+
if (simde_check_double_close(HEDLEY_STATIC_CAST(double, a_.accessor[i]), HEDLEY_STATIC_CAST(double, b_.accessor[i]), precision)) { \
|
|
79
|
+
fprintf(stderr, "%s:%d: assertion failed[%d]: %g " SIMDE_ALMOST_EQUAL_TO " %g (precision: 1e-%d)\n", file, line, i, a_.accessor[i], b_.accessor[i], precision); \
|
|
80
|
+
abort(); \
|
|
81
|
+
} \
|
|
82
|
+
} \
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
SIMDE__FUNCTION_POSSIBLY_UNUSED
|
|
86
|
+
static void random_f32v(size_t nmemb, simde_float32 v[HEDLEY_ARRAY_PARAM(nmemb)]) {
|
|
87
|
+
for (size_t i = 0 ; i < nmemb ; i++) {
|
|
88
|
+
do {
|
|
89
|
+
munit_rand_memory(sizeof(v[i]), HEDLEY_REINTERPRET_CAST(uint8_t*, &(v[i])));
|
|
90
|
+
} while (!isnormal(v[i]));
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
SIMDE__FUNCTION_POSSIBLY_UNUSED
|
|
95
|
+
static simde_float64 random_f64_range(simde_float64 min, simde_float64 max) {
|
|
96
|
+
const simde_float64 range = max - min;
|
|
97
|
+
simde_float64 x = HEDLEY_STATIC_CAST(simde_float64, munit_rand_uint32());
|
|
98
|
+
x /= HEDLEY_STATIC_CAST(simde_float64, UINT32_MAX) / range;
|
|
99
|
+
x += min;
|
|
100
|
+
return x;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
SIMDE__FUNCTION_POSSIBLY_UNUSED
|
|
104
|
+
static simde_float32 random_f32_range(simde_float32 min, simde_float32 max) {
|
|
105
|
+
return HEDLEY_STATIC_CAST(simde_float32, random_f64_range(HEDLEY_STATIC_CAST(double, min), HEDLEY_STATIC_CAST(double, max)));
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
SIMDE__FUNCTION_POSSIBLY_UNUSED
|
|
109
|
+
static void random_f64v(size_t nmemb, simde_float64 v[HEDLEY_ARRAY_PARAM(nmemb)]) {
|
|
110
|
+
for (size_t i = 0 ; i < nmemb ; i++) {
|
|
111
|
+
do {
|
|
112
|
+
munit_rand_memory(sizeof(v[i]), HEDLEY_REINTERPRET_CAST(uint8_t*, &(v[i])));
|
|
113
|
+
} while (!isnormal(v[i]));
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
#define random_intv_range(T, nmemb, v, min, max) \
|
|
118
|
+
do { \
|
|
119
|
+
for (size_t simde_tmp_i_ = 0 ; simde_tmp_i_ < nmemb ; simde_tmp_i_++) { \
|
|
120
|
+
((T*) (v))[simde_tmp_i_] = munit_rand_int_range(min, max); \
|
|
121
|
+
} \
|
|
122
|
+
} while (0)
|
|
123
|
+
|
|
124
|
+
#define TEST_PREFERRED_ITERATIONS (256)
|
|
125
|
+
|
|
126
|
+
/* I'll probably move these into µnit, but I want to play around with
|
|
127
|
+
them for a while first. */
|
|
128
|
+
|
|
129
|
+
#define simde_assert_array_full(prefix, suffix, T, fmt, nmemb, a, op, b) \
|
|
130
|
+
do { \
|
|
131
|
+
const T* simde__tmp_a_ = (a); \
|
|
132
|
+
const T* simde__tmp_b_ = (b); \
|
|
133
|
+
for (size_t simde__i_ = 0 ; simde__i_ < nmemb ; simde__i_++) { \
|
|
134
|
+
if (!(simde__tmp_a_[simde__i_] op simde__tmp_b_[simde__i_])) { \
|
|
135
|
+
munit_errorf("assertion failed: (" #a ")[%" MUNIT_SIZE_MODIFIER "u] " #op " (" #b ")[%" MUNIT_SIZE_MODIFIER "u] (" prefix "%" fmt suffix " " #op " " prefix "%" fmt suffix ")", simde__i_, simde__i_, simde__tmp_a_[simde__i_], simde__tmp_b_[simde__i_]); \
|
|
136
|
+
} \
|
|
137
|
+
} \
|
|
138
|
+
} while (0)
|
|
139
|
+
|
|
140
|
+
#define simde_assert_typev(T, fmt, nmemb, a, op, b) \
|
|
141
|
+
simde_assert_array_full("", "", T, fmt, nmemb, a, op, b)
|
|
142
|
+
|
|
143
|
+
#define simde_assert_f32v(nmemb, a, op, b) \
|
|
144
|
+
simde_assert_typev(simde_float32, "g", nmemb, a, op, b)
|
|
145
|
+
|
|
146
|
+
#define simde_assert_intv(nmemb, a, op, b) \
|
|
147
|
+
simde_assert_typev(int, "d", nmemb, a, op, b)
|
|
148
|
+
|
|
149
|
+
#define simde_assert_uintv(nmemb, a, op, b) \
|
|
150
|
+
simde_assert_typev(int, "u", nmemb, a, op, b)
|
|
151
|
+
|
|
152
|
+
#define simde_assert_int8v(nmemb, a, op, b) \
|
|
153
|
+
simde_assert_array_full("", "", munit_int8_t, PRId8, nmemb, a, op, b)
|
|
154
|
+
#define simde_assert_uint8v(nmemb, a, op, b) \
|
|
155
|
+
simde_assert_array_full("", "", munit_uint8_t, PRIu8, nmemb, a, op, b)
|
|
156
|
+
#define simde_assert_int16v(nmemb, a, op, b) \
|
|
157
|
+
simde_assert_array_full("", "", munit_int16_t, PRId16, nmemb, a, op, b)
|
|
158
|
+
#define simde_assert_uint16v(nmemb, a, op, b) \
|
|
159
|
+
simde_assert_array_full("", "", munit_uint16_t, PRIu16, nmemb, a, op, b)
|
|
160
|
+
#define simde_assert_int32v(nmemb, a, op, b) \
|
|
161
|
+
simde_assert_array_full("", "", munit_int32_t, PRId32, nmemb, a, op, b)
|
|
162
|
+
#define simde_assert_uint32v(nmemb, a, op, b) \
|
|
163
|
+
simde_assert_array_full("", "", munit_uint32_t, PRIu32, nmemb, a, op, b)
|
|
164
|
+
#define simde_assert_int64v(nmemb, a, op, b) \
|
|
165
|
+
simde_assert_array_full("", "", munit_int64_t, PRId64, nmemb, a, op, b)
|
|
166
|
+
#define simde_assert_uint64v(nmemb, a, op, b) \
|
|
167
|
+
simde_assert_array_full("", "", munit_uint64_t, PRIu64, nmemb, a, op, b)
|
|
168
|
+
|
|
169
|
+
#define simde_assert_f32v_equal(T, nmemb, a, b, precision) \
|
|
170
|
+
do { \
|
|
171
|
+
const T* simde_tmp_a_ = (a); \
|
|
172
|
+
const T* simde_tmp_b_ = (b); \
|
|
173
|
+
for (size_t simde_i_ = 0 ; simde_i_ < nmemb ; simde_i_++) { \
|
|
174
|
+
const T simde_tmp_diff_ = ((simde_tmp_a_[simde_i_] - simde_tmp_b_[simde_i_]) < 0) ? \
|
|
175
|
+
(simde_tmp_b_[simde_i_] - simde_tmp_a_[simde_i_]) : \
|
|
176
|
+
(simde_tmp_a_[simde_i_] - simde_tmp_b_[simde_i_]); \
|
|
177
|
+
if (MUNIT_UNLIKELY(simde_tmp_diff_ > 1e-##precision)) { \
|
|
178
|
+
munit_errorf("assertion failed: (" #a ")[%" MUNIT_SIZE_MODIFIER "u] == (" #b ")[%" MUNIT_SIZE_MODIFIER "u] (%." #precision "f == %." #precision "f)", simde_i_, simde_i_, simde_tmp_a_[simde_i_], simde_tmp_b_[simde_i_]); \
|
|
179
|
+
} \
|
|
180
|
+
} \
|
|
181
|
+
} while (0)
|
|
182
|
+
|
|
183
|
+
#define simde_assert_f32v_close(T, nmemb, a, b, precision) \
|
|
184
|
+
do { \
|
|
185
|
+
const T* simde_tmp_a_ = (a); \
|
|
186
|
+
const T* simde_tmp_b_ = (b); \
|
|
187
|
+
for (size_t simde_i_ = 0 ; simde_i_ < nmemb ; simde_i_++) { \
|
|
188
|
+
const T simde_tmp_diff_ = ((simde_tmp_a_[simde_i_] - simde_tmp_b_[simde_i_]) < 0) ? \
|
|
189
|
+
(simde_tmp_b_[simde_i_] - simde_tmp_a_[simde_i_]) : \
|
|
190
|
+
(simde_tmp_a_[simde_i_] - simde_tmp_b_[simde_i_]); \
|
|
191
|
+
if (MUNIT_UNLIKELY(simde_tmp_diff_ > precision)) { \
|
|
192
|
+
munit_errorf("assertion failed: (" #a ")[%" MUNIT_SIZE_MODIFIER "u] == (" #b ")[%" MUNIT_SIZE_MODIFIER "u] (%" #precision ".1f == %" #precision ".1f)", simde_i_, simde_i_, simde_tmp_a_[simde_i_], simde_tmp_b_[simde_i_]); \
|
|
193
|
+
} \
|
|
194
|
+
} \
|
|
195
|
+
} while (0)
|
|
196
|
+
|
|
197
|
+
#define simde_assert_f64v_close(T, nmemb, a, b, precision) \
|
|
198
|
+
do { \
|
|
199
|
+
const T* simde_tmp_a_ = (a); \
|
|
200
|
+
const T* simde_tmp_b_ = (b); \
|
|
201
|
+
for (size_t simde_i_ = 0 ; simde_i_ < nmemb ; simde_i_++) { \
|
|
202
|
+
const T simde_tmp_diff_ = ((simde_tmp_a_[simde_i_] - simde_tmp_b_[simde_i_]) < 0) ? \
|
|
203
|
+
(simde_tmp_b_[simde_i_] - simde_tmp_a_[simde_i_]) : \
|
|
204
|
+
(simde_tmp_a_[simde_i_] - simde_tmp_b_[simde_i_]); \
|
|
205
|
+
if (MUNIT_UNLIKELY(simde_tmp_diff_ > precision)) { \
|
|
206
|
+
munit_errorf("assertion failed: (" #a ")[%" MUNIT_SIZE_MODIFIER "u] == (" #b ")[%" MUNIT_SIZE_MODIFIER "u] (%" #precision ".1f == %" #precision ".1f)", simde_i_, simde_i_, simde_tmp_a_[simde_i_], simde_tmp_b_[simde_i_]); \
|
|
207
|
+
} \
|
|
208
|
+
} \
|
|
209
|
+
} while (0)
|
|
210
|
+
|
|
211
|
+
/* These probably won't go into µnit; they're similar to the
|
|
212
|
+
simde_assert_*v macros above, but print in hex. */
|
|
213
|
+
|
|
214
|
+
#define simde_assert_int8vx(nmemb, a, op, b) \
|
|
215
|
+
simde_assert_array_full("0x", "", munit_int8_t, "02" PRIx8, nmemb, a, op, b)
|
|
216
|
+
#define simde_assert_uint8vx(nmemb, a, op, b) \
|
|
217
|
+
simde_assert_array_full("0x", "", munit_uint8_t, "02" PRIx8, nmemb, a, op, b)
|
|
218
|
+
#define simde_assert_int16vx(nmemb, a, op, b) \
|
|
219
|
+
simde_assert_array_full("0x", "", munit_int16_t, "04" PRIx16, nmemb, a, op, b)
|
|
220
|
+
#define simde_assert_uint16vx(nmemb, a, op, b) \
|
|
221
|
+
simde_assert_array_full("0x", "", munit_uint16_t, "04" PRIx16, nmemb, a, op, b)
|
|
222
|
+
#define simde_assert_int32vx(nmemb, a, op, b) \
|
|
223
|
+
simde_assert_array_full("0x", "", munit_int32_t, "08" PRIx32, nmemb, a, op, b)
|
|
224
|
+
#define simde_assert_uint32vx(nmemb, a, op, b) \
|
|
225
|
+
simde_assert_array_full("0x", "", munit_uint32_t, "08" PRIx32, nmemb, a, op, b)
|
|
226
|
+
#define simde_assert_int64vx(nmemb, a, op, b) \
|
|
227
|
+
simde_assert_array_full("0x", "", munit_int64_t, "016" PRIx64, nmemb, a, op, b)
|
|
228
|
+
#define simde_assert_uint64vx(nmemb, a, op, b) \
|
|
229
|
+
simde_assert_array_full("0x", "", munit_uint64_t, "016" PRIx64, nmemb, a, op, b)
|
|
230
|
+
|
|
231
|
+
#define simde_assert_int32_close(value, target) \
|
|
232
|
+
do { \
|
|
233
|
+
if (value != target && value != target + 1 && value != target - 1) \
|
|
234
|
+
munit_errorf("assertion failed: %s == %s (%" PRId32 " == %" PRId32 ")", #value, #target, value, target); \
|
|
235
|
+
} while (0)
|
|
236
|
+
|
|
237
|
+
#define simde_assert_int64_close(value, target) \
|
|
238
|
+
do { \
|
|
239
|
+
if (value != target && value != target + 1 && value != target - 1) \
|
|
240
|
+
munit_errorf("assertion failed: %s == %s (%" PRId64 " == %" PRId64 ")", #value, #target, value, target); \
|
|
241
|
+
} while (0)
|
|
242
|
+
|
|
243
|
+
HEDLEY_END_C_DECLS
|
|
244
|
+
|
|
245
|
+
HEDLEY_DIAGNOSTIC_POP
|
|
246
|
+
|
|
247
|
+
#if HEDLEY_HAS_WARNING("-Wpadded")
|
|
248
|
+
# pragma clang diagnostic ignored "-Wpadded"
|
|
249
|
+
#elif defined(HEDLEY_MSVC_VERSION)
|
|
250
|
+
# pragma warning(disable:4324)
|
|
251
|
+
#endif
|
|
252
|
+
|
|
253
|
+
#if defined(HEDLEY_MSVC_VERSION)
|
|
254
|
+
/* nonstandard extension used : non-lvalue array converted to pointer */
|
|
255
|
+
#pragma warning(disable:4223)
|
|
256
|
+
/* Conditional expression is a constant */
|
|
257
|
+
#pragma warning(disable:4127)
|
|
258
|
+
#endif
|
|
259
|
+
|
|
260
|
+
#endif /* !defined(SIMDE_RUN_TESTS_H) */
|