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.
Files changed (123) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -3
  3. data/ext/minimap2/Makefile +6 -2
  4. data/ext/minimap2/NEWS.md +38 -0
  5. data/ext/minimap2/README.md +9 -3
  6. data/ext/minimap2/align.c +5 -3
  7. data/ext/minimap2/cookbook.md +2 -2
  8. data/ext/minimap2/format.c +7 -4
  9. data/ext/minimap2/kalloc.c +20 -1
  10. data/ext/minimap2/kalloc.h +13 -2
  11. data/ext/minimap2/ksw2.h +1 -0
  12. data/ext/minimap2/ksw2_extd2_sse.c +1 -1
  13. data/ext/minimap2/ksw2_exts2_sse.c +79 -40
  14. data/ext/minimap2/ksw2_extz2_sse.c +1 -1
  15. data/ext/minimap2/lchain.c +15 -16
  16. data/ext/minimap2/lib/simde/CONTRIBUTING.md +114 -0
  17. data/ext/minimap2/lib/simde/COPYING +20 -0
  18. data/ext/minimap2/lib/simde/README.md +333 -0
  19. data/ext/minimap2/lib/simde/amalgamate.py +58 -0
  20. data/ext/minimap2/lib/simde/meson.build +33 -0
  21. data/ext/minimap2/lib/simde/netlify.toml +20 -0
  22. data/ext/minimap2/lib/simde/simde/arm/neon/float32x2.h +140 -0
  23. data/ext/minimap2/lib/simde/simde/arm/neon/float32x4.h +137 -0
  24. data/ext/minimap2/lib/simde/simde/arm/neon/float64x1.h +142 -0
  25. data/ext/minimap2/lib/simde/simde/arm/neon/float64x2.h +145 -0
  26. data/ext/minimap2/lib/simde/simde/arm/neon/int16x4.h +140 -0
  27. data/ext/minimap2/lib/simde/simde/arm/neon/int16x8.h +145 -0
  28. data/ext/minimap2/lib/simde/simde/arm/neon/int32x2.h +140 -0
  29. data/ext/minimap2/lib/simde/simde/arm/neon/int32x4.h +143 -0
  30. data/ext/minimap2/lib/simde/simde/arm/neon/int64x1.h +137 -0
  31. data/ext/minimap2/lib/simde/simde/arm/neon/int64x2.h +141 -0
  32. data/ext/minimap2/lib/simde/simde/arm/neon/int8x16.h +147 -0
  33. data/ext/minimap2/lib/simde/simde/arm/neon/int8x8.h +141 -0
  34. data/ext/minimap2/lib/simde/simde/arm/neon/uint16x4.h +134 -0
  35. data/ext/minimap2/lib/simde/simde/arm/neon/uint16x8.h +138 -0
  36. data/ext/minimap2/lib/simde/simde/arm/neon/uint32x2.h +134 -0
  37. data/ext/minimap2/lib/simde/simde/arm/neon/uint32x4.h +137 -0
  38. data/ext/minimap2/lib/simde/simde/arm/neon/uint64x1.h +131 -0
  39. data/ext/minimap2/lib/simde/simde/arm/neon/uint64x2.h +135 -0
  40. data/ext/minimap2/lib/simde/simde/arm/neon/uint8x16.h +141 -0
  41. data/ext/minimap2/lib/simde/simde/arm/neon/uint8x8.h +135 -0
  42. data/ext/minimap2/lib/simde/simde/arm/neon.h +97 -0
  43. data/ext/minimap2/lib/simde/simde/check.h +267 -0
  44. data/ext/minimap2/lib/simde/simde/debug-trap.h +83 -0
  45. data/ext/minimap2/lib/simde/simde/hedley.h +1899 -0
  46. data/ext/minimap2/lib/simde/simde/simde-arch.h +445 -0
  47. data/ext/minimap2/lib/simde/simde/simde-common.h +697 -0
  48. data/ext/minimap2/lib/simde/simde/x86/avx.h +5385 -0
  49. data/ext/minimap2/lib/simde/simde/x86/avx2.h +2402 -0
  50. data/ext/minimap2/lib/simde/simde/x86/avx512bw.h +391 -0
  51. data/ext/minimap2/lib/simde/simde/x86/avx512f.h +3389 -0
  52. data/ext/minimap2/lib/simde/simde/x86/avx512vl.h +112 -0
  53. data/ext/minimap2/lib/simde/simde/x86/fma.h +659 -0
  54. data/ext/minimap2/lib/simde/simde/x86/mmx.h +2210 -0
  55. data/ext/minimap2/lib/simde/simde/x86/sse.h +3696 -0
  56. data/ext/minimap2/lib/simde/simde/x86/sse2.h +5991 -0
  57. data/ext/minimap2/lib/simde/simde/x86/sse3.h +343 -0
  58. data/ext/minimap2/lib/simde/simde/x86/sse4.1.h +1783 -0
  59. data/ext/minimap2/lib/simde/simde/x86/sse4.2.h +105 -0
  60. data/ext/minimap2/lib/simde/simde/x86/ssse3.h +1053 -0
  61. data/ext/minimap2/lib/simde/simde/x86/svml.h +543 -0
  62. data/ext/minimap2/lib/simde/test/CMakeLists.txt +166 -0
  63. data/ext/minimap2/lib/simde/test/arm/meson.build +4 -0
  64. data/ext/minimap2/lib/simde/test/arm/neon/meson.build +23 -0
  65. data/ext/minimap2/lib/simde/test/arm/neon/skel.c +871 -0
  66. data/ext/minimap2/lib/simde/test/arm/neon/test-neon-internal.h +134 -0
  67. data/ext/minimap2/lib/simde/test/arm/neon/test-neon.c +39 -0
  68. data/ext/minimap2/lib/simde/test/arm/neon/test-neon.h +10 -0
  69. data/ext/minimap2/lib/simde/test/arm/neon/vadd.c +1260 -0
  70. data/ext/minimap2/lib/simde/test/arm/neon/vdup_n.c +873 -0
  71. data/ext/minimap2/lib/simde/test/arm/neon/vmul.c +1084 -0
  72. data/ext/minimap2/lib/simde/test/arm/neon/vsub.c +1260 -0
  73. data/ext/minimap2/lib/simde/test/arm/test-arm-internal.h +18 -0
  74. data/ext/minimap2/lib/simde/test/arm/test-arm.c +20 -0
  75. data/ext/minimap2/lib/simde/test/arm/test-arm.h +8 -0
  76. data/ext/minimap2/lib/simde/test/cmake/AddCompilerFlags.cmake +171 -0
  77. data/ext/minimap2/lib/simde/test/cmake/ExtraWarningFlags.cmake +68 -0
  78. data/ext/minimap2/lib/simde/test/meson.build +64 -0
  79. data/ext/minimap2/lib/simde/test/munit/COPYING +21 -0
  80. data/ext/minimap2/lib/simde/test/munit/Makefile +55 -0
  81. data/ext/minimap2/lib/simde/test/munit/README.md +54 -0
  82. data/ext/minimap2/lib/simde/test/munit/example.c +351 -0
  83. data/ext/minimap2/lib/simde/test/munit/meson.build +37 -0
  84. data/ext/minimap2/lib/simde/test/munit/munit.c +2055 -0
  85. data/ext/minimap2/lib/simde/test/munit/munit.h +535 -0
  86. data/ext/minimap2/lib/simde/test/run-tests.c +20 -0
  87. data/ext/minimap2/lib/simde/test/run-tests.h +260 -0
  88. data/ext/minimap2/lib/simde/test/x86/avx.c +13752 -0
  89. data/ext/minimap2/lib/simde/test/x86/avx2.c +9977 -0
  90. data/ext/minimap2/lib/simde/test/x86/avx512bw.c +2664 -0
  91. data/ext/minimap2/lib/simde/test/x86/avx512f.c +10416 -0
  92. data/ext/minimap2/lib/simde/test/x86/avx512vl.c +210 -0
  93. data/ext/minimap2/lib/simde/test/x86/fma.c +2557 -0
  94. data/ext/minimap2/lib/simde/test/x86/meson.build +33 -0
  95. data/ext/minimap2/lib/simde/test/x86/mmx.c +2878 -0
  96. data/ext/minimap2/lib/simde/test/x86/skel.c +2984 -0
  97. data/ext/minimap2/lib/simde/test/x86/sse.c +5121 -0
  98. data/ext/minimap2/lib/simde/test/x86/sse2.c +9860 -0
  99. data/ext/minimap2/lib/simde/test/x86/sse3.c +486 -0
  100. data/ext/minimap2/lib/simde/test/x86/sse4.1.c +3446 -0
  101. data/ext/minimap2/lib/simde/test/x86/sse4.2.c +101 -0
  102. data/ext/minimap2/lib/simde/test/x86/ssse3.c +2084 -0
  103. data/ext/minimap2/lib/simde/test/x86/svml.c +1545 -0
  104. data/ext/minimap2/lib/simde/test/x86/test-avx.h +16 -0
  105. data/ext/minimap2/lib/simde/test/x86/test-avx512.h +25 -0
  106. data/ext/minimap2/lib/simde/test/x86/test-mmx.h +13 -0
  107. data/ext/minimap2/lib/simde/test/x86/test-sse.h +13 -0
  108. data/ext/minimap2/lib/simde/test/x86/test-sse2.h +13 -0
  109. data/ext/minimap2/lib/simde/test/x86/test-x86-internal.h +196 -0
  110. data/ext/minimap2/lib/simde/test/x86/test-x86.c +48 -0
  111. data/ext/minimap2/lib/simde/test/x86/test-x86.h +8 -0
  112. data/ext/minimap2/main.c +13 -6
  113. data/ext/minimap2/map.c +0 -5
  114. data/ext/minimap2/minimap.h +40 -31
  115. data/ext/minimap2/minimap2.1 +19 -5
  116. data/ext/minimap2/misc/paftools.js +545 -24
  117. data/ext/minimap2/options.c +1 -1
  118. data/ext/minimap2/pyproject.toml +2 -0
  119. data/ext/minimap2/python/mappy.pyx +3 -1
  120. data/ext/minimap2/seed.c +1 -1
  121. data/ext/minimap2/setup.py +32 -22
  122. data/lib/minimap2/version.rb +1 -1
  123. metadata +100 -3
@@ -0,0 +1,543 @@
1
+ /* Permission is hereby granted, free of charge, to any person
2
+ * obtaining a copy of this software and associated documentation
3
+ * files (the "Software"), to deal in the Software without
4
+ * restriction, including without limitation the rights to use, copy,
5
+ * modify, merge, publish, distribute, sublicense, and/or sell copies
6
+ * of the Software, and to permit persons to whom the Software is
7
+ * furnished to do so, subject to the following conditions:
8
+ *
9
+ * The above copyright notice and this permission notice shall be
10
+ * included in all copies or substantial portions of the Software.
11
+ *
12
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
13
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
14
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
15
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
16
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
17
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
18
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19
+ * SOFTWARE.
20
+ *
21
+ * Copyright:
22
+ * 2020 Evan Nemerson <evan@nemerson.com>
23
+ */
24
+
25
+ #if !defined(SIMDE__SVML_H)
26
+ # if !defined(SIMDE__SVML_H)
27
+ # define SIMDE__SVML_H
28
+ # endif
29
+ # include "avx2.h"
30
+
31
+ HEDLEY_DIAGNOSTIC_PUSH
32
+ SIMDE_DISABLE_UNWANTED_DIAGNOSTICS
33
+
34
+ # if defined(SIMDE_SVML_NATIVE)
35
+ # undef SIMDE_SVML_NATIVE
36
+ # endif
37
+ # if defined(__INTEL_COMPILER) && !defined(SIMDE_SVML_NO_NATIVE) && !defined(SIMDE_NO_NATIVE)
38
+ # define SIMDE_SVML_NATIVE
39
+ # elif defined(SIMDE_ARCH_ARM_NEON) && !defined(SIMDE_SVML_NO_NEON) && !defined(SIMDE_NO_NEON)
40
+ # define SIMDE_SVML_NEON
41
+ # elif defined(SIMDE_ARCH_WASM_SIMD128)
42
+ # define SIMDE_SVML_WASM_SIMD128
43
+ # endif
44
+
45
+ # if defined(SIMDE_SVML_NATIVE)
46
+ # if defined(SIMDE_ARCH_X86_SSE)
47
+ # define SIMDE_SVML_SSE
48
+ # endif
49
+ # if defined(SIMDE_ARCH_X86_SSE2)
50
+ # define SIMDE_SVML_SSE2
51
+ # endif
52
+ # if defined(SIMDE_ARCH_X86_SSE3)
53
+ # define SIMDE_SVML_SSE3
54
+ # endif
55
+ # if defined(SIMDE_ARCH_X86_SSSE3)
56
+ # define SIMDE_SVML_SSSE3
57
+ # endif
58
+ # if defined(SIMDE_ARCH_X86_SSE4_1)
59
+ # define SIMDE_SVML_SSE4_1
60
+ # endif
61
+ # if defined(SIMDE_ARCH_X86_SSE4_2)
62
+ # define SIMDE_SVML_SSE4_2
63
+ # endif
64
+ # if defined(SIMDE_ARCH_X86_AVX)
65
+ # define SIMDE_SVML_SSE
66
+ # endif
67
+ # if defined(SIMDE_ARCH_X86_AVX2)
68
+ # define SIMDE_SVML_SSE
69
+ # endif
70
+ # else
71
+ # if defined(SIMDE_SVML_NEON)
72
+ # include <arm_neon.h>
73
+ # endif
74
+
75
+ # if defined(SIMDE_SVML_WASM_SIMD128)
76
+ # if !defined(__wasm_unimplemented_simd128__)
77
+ # define __wasm_unimplemented_simd128__
78
+ # endif
79
+ # include <wasm_simd128.h>
80
+ # endif
81
+
82
+ # if !defined(HEDLEY_INTEL_VERSION) && !defined(HEDLEY_EMSCRIPTEN_VERSION) && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_ATOMICS__)
83
+ # include <stdatomic.h>
84
+ # elif defined(_WIN32)
85
+ # include <windows.h>
86
+ # endif
87
+ # endif
88
+
89
+ SIMDE__BEGIN_DECLS
90
+
91
+ SIMDE__FUNCTION_ATTRIBUTES
92
+ simde__m128i
93
+ simde_mm_div_epi8 (simde__m128i a, simde__m128i b) {
94
+ #if defined(SIMDE_SVML_NATIVE) && defined(SIMDE_SVML_SSE2)
95
+ return _mm_div_epi8(a, b);
96
+ #else
97
+ simde__m128i_private
98
+ r_,
99
+ a_ = simde__m128i_to_private(a),
100
+ b_ = simde__m128i_to_private(b);
101
+
102
+ #if defined(SIMDE_VECTOR_SUBSCRIPT_OPS)
103
+ r_.i8 = a_.i8 / b_.i8;
104
+ #elif defined(SIMDE_SVML_WASM_SIMD128)
105
+ r_.wasm_v128 = wasm_i8x4_div(a_.wasm_v128, b_.wasm_v128);
106
+ #else
107
+ SIMDE__VECTORIZE
108
+ for (size_t i = 0 ; i < (sizeof(r_.i8) / sizeof(r_.i8[0])) ; i++) {
109
+ r_.i8[i] = a_.i8[i] / b_.i8[i];
110
+ }
111
+ #endif
112
+
113
+ return simde__m128i_from_private(r_);
114
+ #endif
115
+ }
116
+ #if defined(SIMDE_SVML_ENABLE_NATIVE_ALIASES)
117
+ # define _mm_div_epi8(a, b) simde_mm_div_epi8((a), (b))
118
+ #endif
119
+
120
+ SIMDE__FUNCTION_ATTRIBUTES
121
+ simde__m128i
122
+ simde_mm_div_epi16 (simde__m128i a, simde__m128i b) {
123
+ #if defined(SIMDE_SVML_NATIVE) && defined(SIMDE_SVML_SSE2)
124
+ return _mm_div_epi16(a, b);
125
+ #else
126
+ simde__m128i_private
127
+ r_,
128
+ a_ = simde__m128i_to_private(a),
129
+ b_ = simde__m128i_to_private(b);
130
+
131
+ #if defined(SIMDE_VECTOR_SUBSCRIPT_OPS)
132
+ r_.i16 = a_.i16 / b_.i16;
133
+ #elif defined(SIMDE_SVML_WASM_SIMD128)
134
+ r_.wasm_v128 = wasm_i16x4_div(a_.wasm_v128, b_.wasm_v128);
135
+ #else
136
+ SIMDE__VECTORIZE
137
+ for (size_t i = 0 ; i < (sizeof(r_.i16) / sizeof(r_.i16[0])) ; i++) {
138
+ r_.i16[i] = a_.i16[i] / b_.i16[i];
139
+ }
140
+ #endif
141
+
142
+ return simde__m128i_from_private(r_);
143
+ #endif
144
+ }
145
+ #if defined(SIMDE_SVML_ENABLE_NATIVE_ALIASES)
146
+ # define _mm_div_epi16(a, b) simde_mm_div_epi16((a), (b))
147
+ #endif
148
+
149
+ SIMDE__FUNCTION_ATTRIBUTES
150
+ simde__m128i
151
+ simde_mm_div_epi32 (simde__m128i a, simde__m128i b) {
152
+ #if defined(SIMDE_SVML_NATIVE) && defined(SIMDE_SVML_SSE2)
153
+ return _mm_div_epi32(a, b);
154
+ #else
155
+ simde__m128i_private
156
+ r_,
157
+ a_ = simde__m128i_to_private(a),
158
+ b_ = simde__m128i_to_private(b);
159
+
160
+ #if defined(SIMDE_VECTOR_SUBSCRIPT_OPS)
161
+ r_.i32 = a_.i32 / b_.i32;
162
+ #elif defined(SIMDE_SVML_WASM_SIMD128)
163
+ r_.wasm_v128 = wasm_i32x4_div(a_.wasm_v128, b_.wasm_v128);
164
+ #else
165
+ SIMDE__VECTORIZE
166
+ for (size_t i = 0 ; i < (sizeof(r_.i32) / sizeof(r_.i32[0])) ; i++) {
167
+ r_.i32[i] = a_.i32[i] / b_.i32[i];
168
+ }
169
+ #endif
170
+
171
+ return simde__m128i_from_private(r_);
172
+ #endif
173
+ }
174
+ #if defined(SIMDE_SVML_ENABLE_NATIVE_ALIASES)
175
+ # define _mm_div_epi32(a, b) simde_mm_div_epi32((a), (b))
176
+ #endif
177
+
178
+ SIMDE__FUNCTION_ATTRIBUTES
179
+ simde__m128i
180
+ simde_mm_div_epi64 (simde__m128i a, simde__m128i b) {
181
+ #if defined(SIMDE_SVML_NATIVE) && defined(SIMDE_SVML_SSE2)
182
+ return _mm_div_epi64(a, b);
183
+ #else
184
+ simde__m128i_private
185
+ r_,
186
+ a_ = simde__m128i_to_private(a),
187
+ b_ = simde__m128i_to_private(b);
188
+
189
+ #if defined(SIMDE_VECTOR_SUBSCRIPT_OPS)
190
+ r_.i64 = a_.i64 / b_.i64;
191
+ #elif defined(SIMDE_SVML_WASM_SIMD128)
192
+ r_.wasm_v128 = wasm_i64x4_div(a_.wasm_v128, b_.wasm_v128);
193
+ #else
194
+ SIMDE__VECTORIZE
195
+ for (size_t i = 0 ; i < (sizeof(r_.i64) / sizeof(r_.i64[0])) ; i++) {
196
+ r_.i64[i] = a_.i64[i] / b_.i64[i];
197
+ }
198
+ #endif
199
+
200
+ return simde__m128i_from_private(r_);
201
+ #endif
202
+ }
203
+ #if defined(SIMDE_SVML_ENABLE_NATIVE_ALIASES)
204
+ # define _mm_div_epi64(a, b) simde_mm_div_epi64((a), (b))
205
+ #endif
206
+
207
+ SIMDE__FUNCTION_ATTRIBUTES
208
+ simde__m128i
209
+ simde_mm_div_epu8 (simde__m128i a, simde__m128i b) {
210
+ #if defined(SIMDE_SVML_NATIVE) && defined(SIMDE_SVML_SSE2)
211
+ return _mm_div_epu8(a, b);
212
+ #else
213
+ simde__m128i_private
214
+ r_,
215
+ a_ = simde__m128i_to_private(a),
216
+ b_ = simde__m128i_to_private(b);
217
+
218
+ #if defined(SIMDE_VECTOR_SUBSCRIPT_OPS)
219
+ r_.u8 = a_.u8 / b_.u8;
220
+ #elif defined(SIMDE_SVML_WASM_SIMD128)
221
+ r_.wasm_v128 = wasm_u8x16_div(a_.wasm_v128, b_.wasm_v128);
222
+ #else
223
+ SIMDE__VECTORIZE
224
+ for (size_t i = 0 ; i < (sizeof(r_.u8) / sizeof(r_.u8[0])) ; i++) {
225
+ r_.u8[i] = a_.u8[i] / b_.u8[i];
226
+ }
227
+ #endif
228
+
229
+ return simde__m128i_from_private(r_);
230
+ #endif
231
+ }
232
+ #if defined(SIMDE_SVML_ENABLE_NATIVE_ALIASES)
233
+ # define _mm_div_epu8(a, b) simde_mm_div_epu8((a), (b))
234
+ #endif
235
+
236
+ SIMDE__FUNCTION_ATTRIBUTES
237
+ simde__m128i
238
+ simde_mm_div_epu16 (simde__m128i a, simde__m128i b) {
239
+ #if defined(SIMDE_SVML_NATIVE) && defined(SIMDE_SVML_SSE2)
240
+ return _mm_div_epu16(a, b);
241
+ #else
242
+ simde__m128i_private
243
+ r_,
244
+ a_ = simde__m128i_to_private(a),
245
+ b_ = simde__m128i_to_private(b);
246
+
247
+ #if defined(SIMDE_VECTOR_SUBSCRIPT_OPS)
248
+ r_.u16 = a_.u16 / b_.u16;
249
+ #elif defined(SIMDE_SVML_WASM_SIMD128)
250
+ r_.wasm_v128 = wasm_u16x16_div(a_.wasm_v128, b_.wasm_v128);
251
+ #else
252
+ SIMDE__VECTORIZE
253
+ for (size_t i = 0 ; i < (sizeof(r_.u16) / sizeof(r_.u16[0])) ; i++) {
254
+ r_.u16[i] = a_.u16[i] / b_.u16[i];
255
+ }
256
+ #endif
257
+
258
+ return simde__m128i_from_private(r_);
259
+ #endif
260
+ }
261
+ #if defined(SIMDE_SVML_ENABLE_NATIVE_ALIASES)
262
+ # define _mm_div_epu16(a, b) simde_mm_div_epu16((a), (b))
263
+ #endif
264
+
265
+ SIMDE__FUNCTION_ATTRIBUTES
266
+ simde__m128i
267
+ simde_mm_div_epu32 (simde__m128i a, simde__m128i b) {
268
+ #if defined(SIMDE_SVML_NATIVE) && defined(SIMDE_SVML_SSE2)
269
+ return _mm_div_epu32(a, b);
270
+ #else
271
+ simde__m128i_private
272
+ r_,
273
+ a_ = simde__m128i_to_private(a),
274
+ b_ = simde__m128i_to_private(b);
275
+
276
+ #if defined(SIMDE_VECTOR_SUBSCRIPT_OPS)
277
+ r_.u32 = a_.u32 / b_.u32;
278
+ #elif defined(SIMDE_SVML_WASM_SIMD128)
279
+ r_.wasm_v128 = wasm_u32x16_div(a_.wasm_v128, b_.wasm_v128);
280
+ #else
281
+ SIMDE__VECTORIZE
282
+ for (size_t i = 0 ; i < (sizeof(r_.u32) / sizeof(r_.u32[0])) ; i++) {
283
+ r_.u32[i] = a_.u32[i] / b_.u32[i];
284
+ }
285
+ #endif
286
+
287
+ return simde__m128i_from_private(r_);
288
+ #endif
289
+ }
290
+ #if defined(SIMDE_SVML_ENABLE_NATIVE_ALIASES)
291
+ # define _mm_div_epu32(a, b) simde_mm_div_epu32((a), (b))
292
+ #endif
293
+
294
+ SIMDE__FUNCTION_ATTRIBUTES
295
+ simde__m128i
296
+ simde_mm_div_epu64 (simde__m128i a, simde__m128i b) {
297
+ #if defined(SIMDE_SVML_NATIVE) && defined(SIMDE_SVML_SSE2)
298
+ return _mm_div_epu64(a, b);
299
+ #else
300
+ simde__m128i_private
301
+ r_,
302
+ a_ = simde__m128i_to_private(a),
303
+ b_ = simde__m128i_to_private(b);
304
+
305
+ #if defined(SIMDE_VECTOR_SUBSCRIPT_OPS)
306
+ r_.u64 = a_.u64 / b_.u64;
307
+ #elif defined(SIMDE_SVML_WASM_SIMD128)
308
+ r_.wasm_v128 = wasm_u64x16_div(a_.wasm_v128, b_.wasm_v128);
309
+ #else
310
+ SIMDE__VECTORIZE
311
+ for (size_t i = 0 ; i < (sizeof(r_.u64) / sizeof(r_.u64[0])) ; i++) {
312
+ r_.u64[i] = a_.u64[i] / b_.u64[i];
313
+ }
314
+ #endif
315
+
316
+ return simde__m128i_from_private(r_);
317
+ #endif
318
+ }
319
+ #if defined(SIMDE_SVML_ENABLE_NATIVE_ALIASES)
320
+ # define _mm_div_epu64(a, b) simde_mm_div_epu64((a), (b))
321
+ #endif
322
+
323
+ SIMDE__FUNCTION_ATTRIBUTES
324
+ simde__m256i
325
+ simde_mm256_div_epi8 (simde__m256i a, simde__m256i b) {
326
+ #if defined(SIMDE_SVML_NATIVE) && defined(SIMDE_SVML_AVX)
327
+ return _mm256_div_epi32(a, b);
328
+ #else
329
+ simde__m256i_private
330
+ r_,
331
+ a_ = simde__m256i_to_private(a),
332
+ b_ = simde__m256i_to_private(b);
333
+
334
+ #if defined(SIMDE_VECTOR_SUBSCRIPT_OPS)
335
+ r_.i8 = a_.i8 / b_.i8;
336
+ #else
337
+ SIMDE__VECTORIZE
338
+ for (size_t i = 0 ; i < (sizeof(r_.i8) / sizeof(r_.i8[0])) ; i++) {
339
+ r_.i8[i] = a_.i8[i] / b_.i8[i];
340
+ }
341
+ #endif
342
+
343
+ return simde__m256i_from_private(r_);
344
+ #endif
345
+ }
346
+ #if defined(SIMDE_SVML_ENABLE_NATIVE_ALIASES)
347
+ # define _mm256_div_epi8(a, b) simde_mm256_div_epi8((a), (b))
348
+ #endif
349
+
350
+ SIMDE__FUNCTION_ATTRIBUTES
351
+ simde__m256i
352
+ simde_mm256_div_epi16 (simde__m256i a, simde__m256i b) {
353
+ #if defined(SIMDE_SVML_NATIVE) && defined(SIMDE_SVML_AVX)
354
+ return _mm256_div_epi16(a, b);
355
+ #else
356
+ simde__m256i_private
357
+ r_,
358
+ a_ = simde__m256i_to_private(a),
359
+ b_ = simde__m256i_to_private(b);
360
+
361
+ #if defined(SIMDE_VECTOR_SUBSCRIPT_OPS)
362
+ r_.i16 = a_.i16 / b_.i16;
363
+ #else
364
+ SIMDE__VECTORIZE
365
+ for (size_t i = 0 ; i < (sizeof(r_.i16) / sizeof(r_.i16[0])) ; i++) {
366
+ r_.i16[i] = a_.i16[i] / b_.i16[i];
367
+ }
368
+ #endif
369
+
370
+ return simde__m256i_from_private(r_);
371
+ #endif
372
+ }
373
+ #if defined(SIMDE_SVML_ENABLE_NATIVE_ALIASES)
374
+ # define _mm256_div_epi16(a, b) simde_mm256_div_epi16((a), (b))
375
+ #endif
376
+
377
+ SIMDE__FUNCTION_ATTRIBUTES
378
+ simde__m256i
379
+ simde_mm256_div_epi32 (simde__m256i a, simde__m256i b) {
380
+ #if defined(SIMDE_SVML_NATIVE) && defined(SIMDE_SVML_AVX)
381
+ return _mm256_div_epi32(a, b);
382
+ #else
383
+ simde__m256i_private
384
+ r_,
385
+ a_ = simde__m256i_to_private(a),
386
+ b_ = simde__m256i_to_private(b);
387
+
388
+ #if defined(SIMDE_VECTOR_SUBSCRIPT_OPS)
389
+ r_.i32 = a_.i32 / b_.i32;
390
+ #else
391
+ SIMDE__VECTORIZE
392
+ for (size_t i = 0 ; i < (sizeof(r_.i32) / sizeof(r_.i32[0])) ; i++) {
393
+ r_.i32[i] = a_.i32[i] / b_.i32[i];
394
+ }
395
+ #endif
396
+
397
+ return simde__m256i_from_private(r_);
398
+ #endif
399
+ }
400
+ #if defined(SIMDE_SVML_ENABLE_NATIVE_ALIASES)
401
+ # define _mm256_div_epi32(a, b) simde_mm256_div_epi32((a), (b))
402
+ #endif
403
+
404
+ SIMDE__FUNCTION_ATTRIBUTES
405
+ simde__m256i
406
+ simde_mm256_div_epi64 (simde__m256i a, simde__m256i b) {
407
+ #if defined(SIMDE_SVML_NATIVE) && defined(SIMDE_SVML_AVX)
408
+ return _mm256_div_epi64(a, b);
409
+ #else
410
+ simde__m256i_private
411
+ r_,
412
+ a_ = simde__m256i_to_private(a),
413
+ b_ = simde__m256i_to_private(b);
414
+
415
+ #if defined(SIMDE_VECTOR_SUBSCRIPT_OPS)
416
+ r_.i64 = a_.i64 / b_.i64;
417
+ #else
418
+ SIMDE__VECTORIZE
419
+ for (size_t i = 0 ; i < (sizeof(r_.i64) / sizeof(r_.i64[0])) ; i++) {
420
+ r_.i64[i] = a_.i64[i] / b_.i64[i];
421
+ }
422
+ #endif
423
+
424
+ return simde__m256i_from_private(r_);
425
+ #endif
426
+ }
427
+ #if defined(SIMDE_SVML_ENABLE_NATIVE_ALIASES)
428
+ # define _mm256_div_epi64(a, b) simde_mm256_div_epi64((a), (b))
429
+ #endif
430
+
431
+ SIMDE__FUNCTION_ATTRIBUTES
432
+ simde__m256i
433
+ simde_mm256_div_epu8 (simde__m256i a, simde__m256i b) {
434
+ #if defined(SIMDE_SVML_NATIVE) && defined(SIMDE_SVML_AVX)
435
+ return _mm256_div_epi32(a, b);
436
+ #else
437
+ simde__m256i_private
438
+ r_,
439
+ a_ = simde__m256i_to_private(a),
440
+ b_ = simde__m256i_to_private(b);
441
+
442
+ #if defined(SIMDE_VECTOR_SUBSCRIPT_OPS)
443
+ r_.u8 = a_.u8 / b_.u8;
444
+ #else
445
+ SIMDE__VECTORIZE
446
+ for (size_t i = 0 ; i < (sizeof(r_.u8) / sizeof(r_.u8[0])) ; i++) {
447
+ r_.u8[i] = a_.u8[i] / b_.u8[i];
448
+ }
449
+ #endif
450
+
451
+ return simde__m256i_from_private(r_);
452
+ #endif
453
+ }
454
+ #if defined(SIMDE_SVML_ENABLE_NATIVE_ALIASES)
455
+ # define _mm256_div_epu8(a, b) simde_mm256_div_epu8((a), (b))
456
+ #endif
457
+
458
+ SIMDE__FUNCTION_ATTRIBUTES
459
+ simde__m256i
460
+ simde_mm256_div_epu16 (simde__m256i a, simde__m256i b) {
461
+ #if defined(SIMDE_SVML_NATIVE) && defined(SIMDE_SVML_AVX)
462
+ return _mm256_div_epi16(a, b);
463
+ #else
464
+ simde__m256i_private
465
+ r_,
466
+ a_ = simde__m256i_to_private(a),
467
+ b_ = simde__m256i_to_private(b);
468
+
469
+ #if defined(SIMDE_VECTOR_SUBSCRIPT_OPS)
470
+ r_.u16 = a_.u16 / b_.u16;
471
+ #else
472
+ SIMDE__VECTORIZE
473
+ for (size_t i = 0 ; i < (sizeof(r_.u16) / sizeof(r_.u16[0])) ; i++) {
474
+ r_.u16[i] = a_.u16[i] / b_.u16[i];
475
+ }
476
+ #endif
477
+
478
+ return simde__m256i_from_private(r_);
479
+ #endif
480
+ }
481
+ #if defined(SIMDE_SVML_ENABLE_NATIVE_ALIASES)
482
+ # define _mm256_div_epu16(a, b) simde_mm256_div_epu16((a), (b))
483
+ #endif
484
+
485
+ SIMDE__FUNCTION_ATTRIBUTES
486
+ simde__m256i
487
+ simde_mm256_div_epu32 (simde__m256i a, simde__m256i b) {
488
+ #if defined(SIMDE_SVML_NATIVE) && defined(SIMDE_SVML_AVX)
489
+ return _mm256_div_epi32(a, b);
490
+ #else
491
+ simde__m256i_private
492
+ r_,
493
+ a_ = simde__m256i_to_private(a),
494
+ b_ = simde__m256i_to_private(b);
495
+
496
+ #if defined(SIMDE_VECTOR_SUBSCRIPT_OPS)
497
+ r_.u32 = a_.u32 / b_.u32;
498
+ #else
499
+ SIMDE__VECTORIZE
500
+ for (size_t i = 0 ; i < (sizeof(r_.u32) / sizeof(r_.u32[0])) ; i++) {
501
+ r_.u32[i] = a_.u32[i] / b_.u32[i];
502
+ }
503
+ #endif
504
+
505
+ return simde__m256i_from_private(r_);
506
+ #endif
507
+ }
508
+ #if defined(SIMDE_SVML_ENABLE_NATIVE_ALIASES)
509
+ # define _mm256_div_epu32(a, b) simde_mm256_div_epu32((a), (b))
510
+ #endif
511
+
512
+ SIMDE__FUNCTION_ATTRIBUTES
513
+ simde__m256i
514
+ simde_mm256_div_epu64 (simde__m256i a, simde__m256i b) {
515
+ #if defined(SIMDE_SVML_NATIVE) && defined(SIMDE_SVML_AVX)
516
+ return _mm256_div_epi64(a, b);
517
+ #else
518
+ simde__m256i_private
519
+ r_,
520
+ a_ = simde__m256i_to_private(a),
521
+ b_ = simde__m256i_to_private(b);
522
+
523
+ #if defined(SIMDE_VECTOR_SUBSCRIPT_OPS)
524
+ r_.u64 = a_.u64 / b_.u64;
525
+ #else
526
+ SIMDE__VECTORIZE
527
+ for (size_t i = 0 ; i < (sizeof(r_.u64) / sizeof(r_.u64[0])) ; i++) {
528
+ r_.u64[i] = a_.u64[i] / b_.u64[i];
529
+ }
530
+ #endif
531
+
532
+ return simde__m256i_from_private(r_);
533
+ #endif
534
+ }
535
+ #if defined(SIMDE_SVML_ENABLE_NATIVE_ALIASES)
536
+ # define _mm256_div_epu64(a, b) simde_mm256_div_epu64((a), (b))
537
+ #endif
538
+
539
+ SIMDE__END_DECLS
540
+
541
+ HEDLEY_DIAGNOSTIC_POP
542
+
543
+ #endif /* !defined(SIMDE__SVML_H) */
@@ -0,0 +1,166 @@
1
+ cmake_minimum_required(VERSION 3.0)
2
+
3
+ project(simde-tests)
4
+
5
+ set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
6
+ include (ExtraWarningFlags)
7
+
8
+ enable_testing()
9
+
10
+ option(BUILD_CPP_TESTS "Build C++ tests" ON)
11
+ option(ALWAYS_BUILD_NATIVE_TESTS "Build 'native' tests even if the native instructions aren't available" OFF)
12
+
13
+ if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/munit/munit.c")
14
+ find_program(GIT git)
15
+ if(GIT)
16
+ execute_process(COMMAND ${GIT} submodule update --init --recursive)
17
+ else()
18
+ message (FATAL_ERROR "It looks like you don't have submodules checked out. Please run `git submodule update --init --recursive'")
19
+ endif()
20
+ endif()
21
+
22
+ if(CMAKE_BUILD_TYPE STREQUAL "")
23
+ set(CMAKE_BUILD_TYPE "Debug")
24
+ elseif(CMAKE_BUILD_TYPE STREQUAL "Coverage")
25
+ set(orig_req_libs "${CMAKE_REQUIRED_LIBRARIES}")
26
+ set(CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES};--coverage")
27
+ check_c_compiler_flag("--coverage" CFLAG___coverage)
28
+ set(CMAKE_REQUIRED_LIBRARIES "${orig_req_libs}")
29
+
30
+ if(CFLAG___coverage)
31
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage")
32
+ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_C_FLAGS} --coverage")
33
+ add_definitions("-DSIMDE_NO_INLINE")
34
+ else()
35
+ set(CMAKE_BUILD_TYPE "Debug")
36
+ endif()
37
+ endif()
38
+
39
+ add_library(munit STATIC munit/munit.c)
40
+
41
+ include(CheckFunctionExists)
42
+ check_function_exists(clock_gettime CLOCK_GETTIME_RES)
43
+ if(CLOCK_GETTIME_RES)
44
+ set(CLOCK_GETTIME_EXISTS yes)
45
+ else()
46
+ set(orig_req_libs "${CMAKE_REQUIRED_LIBRARIES}")
47
+ set(CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES};rt")
48
+
49
+ check_function_exists(clock_gettime CLOCK_GETTIME_LIBRT_RES)
50
+ if(CLOCK_GETTIME_LIBRT_RES)
51
+ set(CLOCK_GETTIME_EXISTS yes)
52
+ set(CLOCK_GETTIME_LIBRARY "rt")
53
+ endif()
54
+
55
+ set(CMAKE_REQUIRED_LIBRARIES "${orig_req_libs}")
56
+ unset(orig_req_libs)
57
+ endif()
58
+
59
+ check_function_exists(fegetround FEGETROUND_EXISTS)
60
+ if(NOT FEGETROUND_EXISTS)
61
+ unset(FEGETROUND_EXISTS CACHE)
62
+ list(APPEND CMAKE_REQUIRED_LIBRARIES m)
63
+ check_function_exists(fegetround FEGETROUND_EXISTS)
64
+ if(FEGETROUND_EXISTS)
65
+ set(NEED_LIBM True)
66
+ else()
67
+ message(FATAL_ERROR "Unable to find fegetround")
68
+ endif()
69
+ endif(NOT FEGETROUND_EXISTS)
70
+
71
+ set_property(TARGET munit PROPERTY C_STANDARD "99")
72
+ if("${CLOCK_GETTIME_EXISTS}")
73
+ target_compile_definitions(munit PRIVATE "MUNIT_ALLOW_CLOCK_GETTIME")
74
+ target_link_libraries(munit "${CLOCK_GETTIME_LIBRARY}")
75
+ endif()
76
+
77
+ if("${OPENMP_SIMD_FLAGS}" STREQUAL "")
78
+ foreach(omp_simd_flag "-fopenmp-simd" "-qopenmp-simd")
79
+ string (REGEX REPLACE "[^a-zA-Z0-9]+" "_" omp_simd_flag_name "CFLAG_${omp_simd_flag}")
80
+ check_c_compiler_flag("${omp_simd_flag}" "${omp_simd_flag_name}")
81
+
82
+ if(${omp_simd_flag_name})
83
+ set(OPENMP_SIMD_FLAGS "-DSIMDE_ENABLE_OPENMP ${omp_simd_flag}")
84
+ break()
85
+ endif()
86
+ endforeach()
87
+ endif()
88
+
89
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OPENMP_SIMD_FLAGS}")
90
+
91
+ set(TEST_SOURCES_C
92
+ x86/mmx.c
93
+ x86/sse.c
94
+ x86/sse2.c
95
+ x86/sse3.c
96
+ x86/ssse3.c
97
+ x86/sse4.1.c
98
+ x86/sse4.2.c
99
+ x86/avx.c
100
+ x86/avx2.c
101
+ x86/avx512f.c
102
+ x86/avx512bw.c
103
+ x86/avx512vl.c
104
+ x86/fma.c
105
+ x86/svml.c
106
+
107
+ arm/neon/vadd.c
108
+ arm/neon/vdup_n.c
109
+ arm/neon/vmul.c
110
+ arm/neon/vsub.c)
111
+
112
+ set(TEST_RUNNER_SOURCES
113
+ run-tests.c
114
+ x86/test-x86.c
115
+ arm/neon/test-neon.c
116
+ arm/test-arm.c)
117
+ add_executable(run-tests ${TEST_RUNNER_SOURCES})
118
+ set_property(TARGET run-tests PROPERTY C_STANDARD "99")
119
+ target_link_libraries(run-tests munit)
120
+ target_add_compiler_flags (munit "-w")
121
+ if(NEED_LIBM)
122
+ target_link_libraries(run-tests m)
123
+ endif(NEED_LIBM)
124
+
125
+ set(TEST_SOURCES_CPP)
126
+ if(BUILD_CPP_TESTS)
127
+ foreach(csource ${TEST_SOURCES_C})
128
+ configure_file("${csource}" "${CMAKE_CURRENT_BINARY_DIR}/${csource}pp")
129
+ list(APPEND TEST_SOURCES_CPP "${CMAKE_CURRENT_BINARY_DIR}/${csource}pp")
130
+ endforeach()
131
+
132
+ add_definitions(-DSIMDE_BUILD_CPP_TESTS)
133
+ endif(BUILD_CPP_TESTS)
134
+
135
+ foreach(native native emul)
136
+ add_library(simde-test-${native} STATIC ${TEST_SOURCES_C} ${TEST_SOURCES_CPP})
137
+
138
+ target_include_directories(simde-test-${native} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/..")
139
+ set_property(TARGET simde-test-${native} PROPERTY C_STANDARD "99")
140
+
141
+ if(ALWAYS_BUILD_NATIVE_TESTS)
142
+ target_compile_definitions(simde-test-${native} PRIVATE SIMDE_ALWAYS_BUILD_NATIVE_TESTS)
143
+ endif(ALWAYS_BUILD_NATIVE_TESTS)
144
+
145
+ target_link_libraries(run-tests simde-test-${native})
146
+ endforeach(native native emul)
147
+ target_compile_definitions(simde-test-emul PRIVATE SIMDE_NO_NATIVE)
148
+
149
+ foreach(tst
150
+ "/x86/mmx"
151
+ "/x86/sse"
152
+ "/x86/sse2"
153
+ "/x86/sse3"
154
+ "/x86/ssse3"
155
+ "/x86/sse4.1"
156
+ "/x86/sse4.2"
157
+ "/x86/avx"
158
+ "/x86/fma"
159
+ "/x86/avx2"
160
+ "/x86/avx512f"
161
+ "/x86/avx512bw"
162
+ "/x86/avx512vl"
163
+ "/x86/svml"
164
+ )
165
+ add_test(NAME "${tst}/${variant}" COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:run-tests> "${tst}")
166
+ endforeach()
@@ -0,0 +1,4 @@
1
+ subdir('neon')
2
+
3
+ simde_tests_arm = static_library('simde-tests-arm', 'test-arm.c',
4
+ link_with: [simde_tests_arm_neon])