1
2
3
4
5
6
7
8
9 package simd_test
10
11 import (
12 "simd/archsimd"
13 "testing"
14 )
15
16
17 func testInt8x16ConvertToInt8x16(t *testing.T, f func(x archsimd.Int8x16) archsimd.Int8x16, want func(x []int8) []int8) {
18 n := 16
19 t.Helper()
20 forSlice(t, int8s, n, func(x []int8) bool {
21 t.Helper()
22 a := archsimd.LoadInt8x16(x)
23 g := make([]int8, 16)
24 f(a).Store(g)
25 w := want(x)
26 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
27 })
28 }
29
30
31 func testInt16x8ConvertToInt8x16(t *testing.T, f func(x archsimd.Int16x8) archsimd.Int8x16, want func(x []int16) []int8) {
32 n := 8
33 t.Helper()
34 forSlice(t, int16s, n, func(x []int16) bool {
35 t.Helper()
36 a := archsimd.LoadInt16x8(x)
37 g := make([]int8, 16)
38 f(a).Store(g)
39 w := want(x)
40 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
41 })
42 }
43
44
45 func testInt32x4ConvertToInt8x16(t *testing.T, f func(x archsimd.Int32x4) archsimd.Int8x16, want func(x []int32) []int8) {
46 n := 4
47 t.Helper()
48 forSlice(t, int32s, n, func(x []int32) bool {
49 t.Helper()
50 a := archsimd.LoadInt32x4(x)
51 g := make([]int8, 16)
52 f(a).Store(g)
53 w := want(x)
54 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
55 })
56 }
57
58
59 func testInt64x2ConvertToInt8x16(t *testing.T, f func(x archsimd.Int64x2) archsimd.Int8x16, want func(x []int64) []int8) {
60 n := 2
61 t.Helper()
62 forSlice(t, int64s, n, func(x []int64) bool {
63 t.Helper()
64 a := archsimd.LoadInt64x2(x)
65 g := make([]int8, 16)
66 f(a).Store(g)
67 w := want(x)
68 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
69 })
70 }
71
72
73 func testUint8x16ConvertToInt8x16(t *testing.T, f func(x archsimd.Uint8x16) archsimd.Int8x16, want func(x []uint8) []int8) {
74 n := 16
75 t.Helper()
76 forSlice(t, uint8s, n, func(x []uint8) bool {
77 t.Helper()
78 a := archsimd.LoadUint8x16(x)
79 g := make([]int8, 16)
80 f(a).Store(g)
81 w := want(x)
82 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
83 })
84 }
85
86
87 func testUint16x8ConvertToInt8x16(t *testing.T, f func(x archsimd.Uint16x8) archsimd.Int8x16, want func(x []uint16) []int8) {
88 n := 8
89 t.Helper()
90 forSlice(t, uint16s, n, func(x []uint16) bool {
91 t.Helper()
92 a := archsimd.LoadUint16x8(x)
93 g := make([]int8, 16)
94 f(a).Store(g)
95 w := want(x)
96 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
97 })
98 }
99
100
101 func testUint32x4ConvertToInt8x16(t *testing.T, f func(x archsimd.Uint32x4) archsimd.Int8x16, want func(x []uint32) []int8) {
102 n := 4
103 t.Helper()
104 forSlice(t, uint32s, n, func(x []uint32) bool {
105 t.Helper()
106 a := archsimd.LoadUint32x4(x)
107 g := make([]int8, 16)
108 f(a).Store(g)
109 w := want(x)
110 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
111 })
112 }
113
114
115 func testUint64x2ConvertToInt8x16(t *testing.T, f func(x archsimd.Uint64x2) archsimd.Int8x16, want func(x []uint64) []int8) {
116 n := 2
117 t.Helper()
118 forSlice(t, uint64s, n, func(x []uint64) bool {
119 t.Helper()
120 a := archsimd.LoadUint64x2(x)
121 g := make([]int8, 16)
122 f(a).Store(g)
123 w := want(x)
124 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
125 })
126 }
127
128
129 func testFloat32x4ConvertToInt8x16(t *testing.T, f func(x archsimd.Float32x4) archsimd.Int8x16, want func(x []float32) []int8) {
130 n := 4
131 t.Helper()
132 forSlice(t, float32s, n, func(x []float32) bool {
133 t.Helper()
134 a := archsimd.LoadFloat32x4(x)
135 g := make([]int8, 16)
136 f(a).Store(g)
137 w := want(x)
138 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
139 })
140 }
141
142
143 func testFloat64x2ConvertToInt8x16(t *testing.T, f func(x archsimd.Float64x2) archsimd.Int8x16, want func(x []float64) []int8) {
144 n := 2
145 t.Helper()
146 forSlice(t, float64s, n, func(x []float64) bool {
147 t.Helper()
148 a := archsimd.LoadFloat64x2(x)
149 g := make([]int8, 16)
150 f(a).Store(g)
151 w := want(x)
152 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
153 })
154 }
155
156
157 func testInt8x16ConvertToUint8x16(t *testing.T, f func(x archsimd.Int8x16) archsimd.Uint8x16, want func(x []int8) []uint8) {
158 n := 16
159 t.Helper()
160 forSlice(t, int8s, n, func(x []int8) bool {
161 t.Helper()
162 a := archsimd.LoadInt8x16(x)
163 g := make([]uint8, 16)
164 f(a).Store(g)
165 w := want(x)
166 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
167 })
168 }
169
170
171 func testInt16x8ConvertToUint8x16(t *testing.T, f func(x archsimd.Int16x8) archsimd.Uint8x16, want func(x []int16) []uint8) {
172 n := 8
173 t.Helper()
174 forSlice(t, int16s, n, func(x []int16) bool {
175 t.Helper()
176 a := archsimd.LoadInt16x8(x)
177 g := make([]uint8, 16)
178 f(a).Store(g)
179 w := want(x)
180 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
181 })
182 }
183
184
185 func testInt32x4ConvertToUint8x16(t *testing.T, f func(x archsimd.Int32x4) archsimd.Uint8x16, want func(x []int32) []uint8) {
186 n := 4
187 t.Helper()
188 forSlice(t, int32s, n, func(x []int32) bool {
189 t.Helper()
190 a := archsimd.LoadInt32x4(x)
191 g := make([]uint8, 16)
192 f(a).Store(g)
193 w := want(x)
194 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
195 })
196 }
197
198
199 func testInt64x2ConvertToUint8x16(t *testing.T, f func(x archsimd.Int64x2) archsimd.Uint8x16, want func(x []int64) []uint8) {
200 n := 2
201 t.Helper()
202 forSlice(t, int64s, n, func(x []int64) bool {
203 t.Helper()
204 a := archsimd.LoadInt64x2(x)
205 g := make([]uint8, 16)
206 f(a).Store(g)
207 w := want(x)
208 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
209 })
210 }
211
212
213 func testUint8x16ConvertToUint8x16(t *testing.T, f func(x archsimd.Uint8x16) archsimd.Uint8x16, want func(x []uint8) []uint8) {
214 n := 16
215 t.Helper()
216 forSlice(t, uint8s, n, func(x []uint8) bool {
217 t.Helper()
218 a := archsimd.LoadUint8x16(x)
219 g := make([]uint8, 16)
220 f(a).Store(g)
221 w := want(x)
222 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
223 })
224 }
225
226
227 func testUint16x8ConvertToUint8x16(t *testing.T, f func(x archsimd.Uint16x8) archsimd.Uint8x16, want func(x []uint16) []uint8) {
228 n := 8
229 t.Helper()
230 forSlice(t, uint16s, n, func(x []uint16) bool {
231 t.Helper()
232 a := archsimd.LoadUint16x8(x)
233 g := make([]uint8, 16)
234 f(a).Store(g)
235 w := want(x)
236 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
237 })
238 }
239
240
241 func testUint32x4ConvertToUint8x16(t *testing.T, f func(x archsimd.Uint32x4) archsimd.Uint8x16, want func(x []uint32) []uint8) {
242 n := 4
243 t.Helper()
244 forSlice(t, uint32s, n, func(x []uint32) bool {
245 t.Helper()
246 a := archsimd.LoadUint32x4(x)
247 g := make([]uint8, 16)
248 f(a).Store(g)
249 w := want(x)
250 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
251 })
252 }
253
254
255 func testUint64x2ConvertToUint8x16(t *testing.T, f func(x archsimd.Uint64x2) archsimd.Uint8x16, want func(x []uint64) []uint8) {
256 n := 2
257 t.Helper()
258 forSlice(t, uint64s, n, func(x []uint64) bool {
259 t.Helper()
260 a := archsimd.LoadUint64x2(x)
261 g := make([]uint8, 16)
262 f(a).Store(g)
263 w := want(x)
264 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
265 })
266 }
267
268
269 func testFloat32x4ConvertToUint8x16(t *testing.T, f func(x archsimd.Float32x4) archsimd.Uint8x16, want func(x []float32) []uint8) {
270 n := 4
271 t.Helper()
272 forSlice(t, float32s, n, func(x []float32) bool {
273 t.Helper()
274 a := archsimd.LoadFloat32x4(x)
275 g := make([]uint8, 16)
276 f(a).Store(g)
277 w := want(x)
278 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
279 })
280 }
281
282
283 func testFloat64x2ConvertToUint8x16(t *testing.T, f func(x archsimd.Float64x2) archsimd.Uint8x16, want func(x []float64) []uint8) {
284 n := 2
285 t.Helper()
286 forSlice(t, float64s, n, func(x []float64) bool {
287 t.Helper()
288 a := archsimd.LoadFloat64x2(x)
289 g := make([]uint8, 16)
290 f(a).Store(g)
291 w := want(x)
292 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
293 })
294 }
295
296
297 func testInt8x16ConvertToInt16x8(t *testing.T, f func(x archsimd.Int8x16) archsimd.Int16x8, want func(x []int8) []int16) {
298 n := 16
299 t.Helper()
300 forSlice(t, int8s, n, func(x []int8) bool {
301 t.Helper()
302 a := archsimd.LoadInt8x16(x)
303 g := make([]int16, 8)
304 f(a).Store(g)
305 w := want(x)
306 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
307 })
308 }
309
310
311 func testInt16x8ConvertToInt16x8(t *testing.T, f func(x archsimd.Int16x8) archsimd.Int16x8, want func(x []int16) []int16) {
312 n := 8
313 t.Helper()
314 forSlice(t, int16s, n, func(x []int16) bool {
315 t.Helper()
316 a := archsimd.LoadInt16x8(x)
317 g := make([]int16, 8)
318 f(a).Store(g)
319 w := want(x)
320 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
321 })
322 }
323
324
325 func testInt32x4ConvertToInt16x8(t *testing.T, f func(x archsimd.Int32x4) archsimd.Int16x8, want func(x []int32) []int16) {
326 n := 4
327 t.Helper()
328 forSlice(t, int32s, n, func(x []int32) bool {
329 t.Helper()
330 a := archsimd.LoadInt32x4(x)
331 g := make([]int16, 8)
332 f(a).Store(g)
333 w := want(x)
334 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
335 })
336 }
337
338
339 func testInt64x2ConvertToInt16x8(t *testing.T, f func(x archsimd.Int64x2) archsimd.Int16x8, want func(x []int64) []int16) {
340 n := 2
341 t.Helper()
342 forSlice(t, int64s, n, func(x []int64) bool {
343 t.Helper()
344 a := archsimd.LoadInt64x2(x)
345 g := make([]int16, 8)
346 f(a).Store(g)
347 w := want(x)
348 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
349 })
350 }
351
352
353 func testUint8x16ConvertToInt16x8(t *testing.T, f func(x archsimd.Uint8x16) archsimd.Int16x8, want func(x []uint8) []int16) {
354 n := 16
355 t.Helper()
356 forSlice(t, uint8s, n, func(x []uint8) bool {
357 t.Helper()
358 a := archsimd.LoadUint8x16(x)
359 g := make([]int16, 8)
360 f(a).Store(g)
361 w := want(x)
362 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
363 })
364 }
365
366
367 func testUint16x8ConvertToInt16x8(t *testing.T, f func(x archsimd.Uint16x8) archsimd.Int16x8, want func(x []uint16) []int16) {
368 n := 8
369 t.Helper()
370 forSlice(t, uint16s, n, func(x []uint16) bool {
371 t.Helper()
372 a := archsimd.LoadUint16x8(x)
373 g := make([]int16, 8)
374 f(a).Store(g)
375 w := want(x)
376 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
377 })
378 }
379
380
381 func testUint32x4ConvertToInt16x8(t *testing.T, f func(x archsimd.Uint32x4) archsimd.Int16x8, want func(x []uint32) []int16) {
382 n := 4
383 t.Helper()
384 forSlice(t, uint32s, n, func(x []uint32) bool {
385 t.Helper()
386 a := archsimd.LoadUint32x4(x)
387 g := make([]int16, 8)
388 f(a).Store(g)
389 w := want(x)
390 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
391 })
392 }
393
394
395 func testUint64x2ConvertToInt16x8(t *testing.T, f func(x archsimd.Uint64x2) archsimd.Int16x8, want func(x []uint64) []int16) {
396 n := 2
397 t.Helper()
398 forSlice(t, uint64s, n, func(x []uint64) bool {
399 t.Helper()
400 a := archsimd.LoadUint64x2(x)
401 g := make([]int16, 8)
402 f(a).Store(g)
403 w := want(x)
404 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
405 })
406 }
407
408
409 func testFloat32x4ConvertToInt16x8(t *testing.T, f func(x archsimd.Float32x4) archsimd.Int16x8, want func(x []float32) []int16) {
410 n := 4
411 t.Helper()
412 forSlice(t, float32s, n, func(x []float32) bool {
413 t.Helper()
414 a := archsimd.LoadFloat32x4(x)
415 g := make([]int16, 8)
416 f(a).Store(g)
417 w := want(x)
418 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
419 })
420 }
421
422
423 func testFloat64x2ConvertToInt16x8(t *testing.T, f func(x archsimd.Float64x2) archsimd.Int16x8, want func(x []float64) []int16) {
424 n := 2
425 t.Helper()
426 forSlice(t, float64s, n, func(x []float64) bool {
427 t.Helper()
428 a := archsimd.LoadFloat64x2(x)
429 g := make([]int16, 8)
430 f(a).Store(g)
431 w := want(x)
432 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
433 })
434 }
435
436
437 func testInt8x16ConvertToUint16x8(t *testing.T, f func(x archsimd.Int8x16) archsimd.Uint16x8, want func(x []int8) []uint16) {
438 n := 16
439 t.Helper()
440 forSlice(t, int8s, n, func(x []int8) bool {
441 t.Helper()
442 a := archsimd.LoadInt8x16(x)
443 g := make([]uint16, 8)
444 f(a).Store(g)
445 w := want(x)
446 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
447 })
448 }
449
450
451 func testInt16x8ConvertToUint16x8(t *testing.T, f func(x archsimd.Int16x8) archsimd.Uint16x8, want func(x []int16) []uint16) {
452 n := 8
453 t.Helper()
454 forSlice(t, int16s, n, func(x []int16) bool {
455 t.Helper()
456 a := archsimd.LoadInt16x8(x)
457 g := make([]uint16, 8)
458 f(a).Store(g)
459 w := want(x)
460 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
461 })
462 }
463
464
465 func testInt32x4ConvertToUint16x8(t *testing.T, f func(x archsimd.Int32x4) archsimd.Uint16x8, want func(x []int32) []uint16) {
466 n := 4
467 t.Helper()
468 forSlice(t, int32s, n, func(x []int32) bool {
469 t.Helper()
470 a := archsimd.LoadInt32x4(x)
471 g := make([]uint16, 8)
472 f(a).Store(g)
473 w := want(x)
474 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
475 })
476 }
477
478
479 func testInt64x2ConvertToUint16x8(t *testing.T, f func(x archsimd.Int64x2) archsimd.Uint16x8, want func(x []int64) []uint16) {
480 n := 2
481 t.Helper()
482 forSlice(t, int64s, n, func(x []int64) bool {
483 t.Helper()
484 a := archsimd.LoadInt64x2(x)
485 g := make([]uint16, 8)
486 f(a).Store(g)
487 w := want(x)
488 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
489 })
490 }
491
492
493 func testUint8x16ConvertToUint16x8(t *testing.T, f func(x archsimd.Uint8x16) archsimd.Uint16x8, want func(x []uint8) []uint16) {
494 n := 16
495 t.Helper()
496 forSlice(t, uint8s, n, func(x []uint8) bool {
497 t.Helper()
498 a := archsimd.LoadUint8x16(x)
499 g := make([]uint16, 8)
500 f(a).Store(g)
501 w := want(x)
502 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
503 })
504 }
505
506
507 func testUint16x8ConvertToUint16x8(t *testing.T, f func(x archsimd.Uint16x8) archsimd.Uint16x8, want func(x []uint16) []uint16) {
508 n := 8
509 t.Helper()
510 forSlice(t, uint16s, n, func(x []uint16) bool {
511 t.Helper()
512 a := archsimd.LoadUint16x8(x)
513 g := make([]uint16, 8)
514 f(a).Store(g)
515 w := want(x)
516 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
517 })
518 }
519
520
521 func testUint32x4ConvertToUint16x8(t *testing.T, f func(x archsimd.Uint32x4) archsimd.Uint16x8, want func(x []uint32) []uint16) {
522 n := 4
523 t.Helper()
524 forSlice(t, uint32s, n, func(x []uint32) bool {
525 t.Helper()
526 a := archsimd.LoadUint32x4(x)
527 g := make([]uint16, 8)
528 f(a).Store(g)
529 w := want(x)
530 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
531 })
532 }
533
534
535 func testUint64x2ConvertToUint16x8(t *testing.T, f func(x archsimd.Uint64x2) archsimd.Uint16x8, want func(x []uint64) []uint16) {
536 n := 2
537 t.Helper()
538 forSlice(t, uint64s, n, func(x []uint64) bool {
539 t.Helper()
540 a := archsimd.LoadUint64x2(x)
541 g := make([]uint16, 8)
542 f(a).Store(g)
543 w := want(x)
544 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
545 })
546 }
547
548
549 func testFloat32x4ConvertToUint16x8(t *testing.T, f func(x archsimd.Float32x4) archsimd.Uint16x8, want func(x []float32) []uint16) {
550 n := 4
551 t.Helper()
552 forSlice(t, float32s, n, func(x []float32) bool {
553 t.Helper()
554 a := archsimd.LoadFloat32x4(x)
555 g := make([]uint16, 8)
556 f(a).Store(g)
557 w := want(x)
558 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
559 })
560 }
561
562
563 func testFloat64x2ConvertToUint16x8(t *testing.T, f func(x archsimd.Float64x2) archsimd.Uint16x8, want func(x []float64) []uint16) {
564 n := 2
565 t.Helper()
566 forSlice(t, float64s, n, func(x []float64) bool {
567 t.Helper()
568 a := archsimd.LoadFloat64x2(x)
569 g := make([]uint16, 8)
570 f(a).Store(g)
571 w := want(x)
572 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
573 })
574 }
575
576
577 func testInt8x16ConvertToInt32x4(t *testing.T, f func(x archsimd.Int8x16) archsimd.Int32x4, want func(x []int8) []int32) {
578 n := 16
579 t.Helper()
580 forSlice(t, int8s, n, func(x []int8) bool {
581 t.Helper()
582 a := archsimd.LoadInt8x16(x)
583 g := make([]int32, 4)
584 f(a).Store(g)
585 w := want(x)
586 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
587 })
588 }
589
590
591 func testInt16x8ConvertToInt32x4(t *testing.T, f func(x archsimd.Int16x8) archsimd.Int32x4, want func(x []int16) []int32) {
592 n := 8
593 t.Helper()
594 forSlice(t, int16s, n, func(x []int16) bool {
595 t.Helper()
596 a := archsimd.LoadInt16x8(x)
597 g := make([]int32, 4)
598 f(a).Store(g)
599 w := want(x)
600 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
601 })
602 }
603
604
605 func testInt32x4ConvertToInt32x4(t *testing.T, f func(x archsimd.Int32x4) archsimd.Int32x4, want func(x []int32) []int32) {
606 n := 4
607 t.Helper()
608 forSlice(t, int32s, n, func(x []int32) bool {
609 t.Helper()
610 a := archsimd.LoadInt32x4(x)
611 g := make([]int32, 4)
612 f(a).Store(g)
613 w := want(x)
614 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
615 })
616 }
617
618
619 func testInt64x2ConvertToInt32x4(t *testing.T, f func(x archsimd.Int64x2) archsimd.Int32x4, want func(x []int64) []int32) {
620 n := 2
621 t.Helper()
622 forSlice(t, int64s, n, func(x []int64) bool {
623 t.Helper()
624 a := archsimd.LoadInt64x2(x)
625 g := make([]int32, 4)
626 f(a).Store(g)
627 w := want(x)
628 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
629 })
630 }
631
632
633 func testUint8x16ConvertToInt32x4(t *testing.T, f func(x archsimd.Uint8x16) archsimd.Int32x4, want func(x []uint8) []int32) {
634 n := 16
635 t.Helper()
636 forSlice(t, uint8s, n, func(x []uint8) bool {
637 t.Helper()
638 a := archsimd.LoadUint8x16(x)
639 g := make([]int32, 4)
640 f(a).Store(g)
641 w := want(x)
642 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
643 })
644 }
645
646
647 func testUint16x8ConvertToInt32x4(t *testing.T, f func(x archsimd.Uint16x8) archsimd.Int32x4, want func(x []uint16) []int32) {
648 n := 8
649 t.Helper()
650 forSlice(t, uint16s, n, func(x []uint16) bool {
651 t.Helper()
652 a := archsimd.LoadUint16x8(x)
653 g := make([]int32, 4)
654 f(a).Store(g)
655 w := want(x)
656 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
657 })
658 }
659
660
661 func testUint32x4ConvertToInt32x4(t *testing.T, f func(x archsimd.Uint32x4) archsimd.Int32x4, want func(x []uint32) []int32) {
662 n := 4
663 t.Helper()
664 forSlice(t, uint32s, n, func(x []uint32) bool {
665 t.Helper()
666 a := archsimd.LoadUint32x4(x)
667 g := make([]int32, 4)
668 f(a).Store(g)
669 w := want(x)
670 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
671 })
672 }
673
674
675 func testUint64x2ConvertToInt32x4(t *testing.T, f func(x archsimd.Uint64x2) archsimd.Int32x4, want func(x []uint64) []int32) {
676 n := 2
677 t.Helper()
678 forSlice(t, uint64s, n, func(x []uint64) bool {
679 t.Helper()
680 a := archsimd.LoadUint64x2(x)
681 g := make([]int32, 4)
682 f(a).Store(g)
683 w := want(x)
684 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
685 })
686 }
687
688
689 func testFloat32x4ConvertToInt32x4(t *testing.T, f func(x archsimd.Float32x4) archsimd.Int32x4, want func(x []float32) []int32) {
690 n := 4
691 t.Helper()
692 forSlice(t, float32s, n, func(x []float32) bool {
693 t.Helper()
694 a := archsimd.LoadFloat32x4(x)
695 g := make([]int32, 4)
696 f(a).Store(g)
697 w := want(x)
698 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
699 })
700 }
701
702
703 func testFloat64x2ConvertToInt32x4(t *testing.T, f func(x archsimd.Float64x2) archsimd.Int32x4, want func(x []float64) []int32) {
704 n := 2
705 t.Helper()
706 forSlice(t, float64s, n, func(x []float64) bool {
707 t.Helper()
708 a := archsimd.LoadFloat64x2(x)
709 g := make([]int32, 4)
710 f(a).Store(g)
711 w := want(x)
712 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
713 })
714 }
715
716
717 func testInt8x16ConvertToUint32x4(t *testing.T, f func(x archsimd.Int8x16) archsimd.Uint32x4, want func(x []int8) []uint32) {
718 n := 16
719 t.Helper()
720 forSlice(t, int8s, n, func(x []int8) bool {
721 t.Helper()
722 a := archsimd.LoadInt8x16(x)
723 g := make([]uint32, 4)
724 f(a).Store(g)
725 w := want(x)
726 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
727 })
728 }
729
730
731 func testInt16x8ConvertToUint32x4(t *testing.T, f func(x archsimd.Int16x8) archsimd.Uint32x4, want func(x []int16) []uint32) {
732 n := 8
733 t.Helper()
734 forSlice(t, int16s, n, func(x []int16) bool {
735 t.Helper()
736 a := archsimd.LoadInt16x8(x)
737 g := make([]uint32, 4)
738 f(a).Store(g)
739 w := want(x)
740 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
741 })
742 }
743
744
745 func testInt32x4ConvertToUint32x4(t *testing.T, f func(x archsimd.Int32x4) archsimd.Uint32x4, want func(x []int32) []uint32) {
746 n := 4
747 t.Helper()
748 forSlice(t, int32s, n, func(x []int32) bool {
749 t.Helper()
750 a := archsimd.LoadInt32x4(x)
751 g := make([]uint32, 4)
752 f(a).Store(g)
753 w := want(x)
754 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
755 })
756 }
757
758
759 func testInt64x2ConvertToUint32x4(t *testing.T, f func(x archsimd.Int64x2) archsimd.Uint32x4, want func(x []int64) []uint32) {
760 n := 2
761 t.Helper()
762 forSlice(t, int64s, n, func(x []int64) bool {
763 t.Helper()
764 a := archsimd.LoadInt64x2(x)
765 g := make([]uint32, 4)
766 f(a).Store(g)
767 w := want(x)
768 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
769 })
770 }
771
772
773 func testUint8x16ConvertToUint32x4(t *testing.T, f func(x archsimd.Uint8x16) archsimd.Uint32x4, want func(x []uint8) []uint32) {
774 n := 16
775 t.Helper()
776 forSlice(t, uint8s, n, func(x []uint8) bool {
777 t.Helper()
778 a := archsimd.LoadUint8x16(x)
779 g := make([]uint32, 4)
780 f(a).Store(g)
781 w := want(x)
782 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
783 })
784 }
785
786
787 func testUint16x8ConvertToUint32x4(t *testing.T, f func(x archsimd.Uint16x8) archsimd.Uint32x4, want func(x []uint16) []uint32) {
788 n := 8
789 t.Helper()
790 forSlice(t, uint16s, n, func(x []uint16) bool {
791 t.Helper()
792 a := archsimd.LoadUint16x8(x)
793 g := make([]uint32, 4)
794 f(a).Store(g)
795 w := want(x)
796 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
797 })
798 }
799
800
801 func testUint32x4ConvertToUint32x4(t *testing.T, f func(x archsimd.Uint32x4) archsimd.Uint32x4, want func(x []uint32) []uint32) {
802 n := 4
803 t.Helper()
804 forSlice(t, uint32s, n, func(x []uint32) bool {
805 t.Helper()
806 a := archsimd.LoadUint32x4(x)
807 g := make([]uint32, 4)
808 f(a).Store(g)
809 w := want(x)
810 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
811 })
812 }
813
814
815 func testUint64x2ConvertToUint32x4(t *testing.T, f func(x archsimd.Uint64x2) archsimd.Uint32x4, want func(x []uint64) []uint32) {
816 n := 2
817 t.Helper()
818 forSlice(t, uint64s, n, func(x []uint64) bool {
819 t.Helper()
820 a := archsimd.LoadUint64x2(x)
821 g := make([]uint32, 4)
822 f(a).Store(g)
823 w := want(x)
824 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
825 })
826 }
827
828
829 func testFloat32x4ConvertToUint32x4(t *testing.T, f func(x archsimd.Float32x4) archsimd.Uint32x4, want func(x []float32) []uint32) {
830 n := 4
831 t.Helper()
832 forSlice(t, float32s, n, func(x []float32) bool {
833 t.Helper()
834 a := archsimd.LoadFloat32x4(x)
835 g := make([]uint32, 4)
836 f(a).Store(g)
837 w := want(x)
838 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
839 })
840 }
841
842
843 func testFloat64x2ConvertToUint32x4(t *testing.T, f func(x archsimd.Float64x2) archsimd.Uint32x4, want func(x []float64) []uint32) {
844 n := 2
845 t.Helper()
846 forSlice(t, float64s, n, func(x []float64) bool {
847 t.Helper()
848 a := archsimd.LoadFloat64x2(x)
849 g := make([]uint32, 4)
850 f(a).Store(g)
851 w := want(x)
852 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
853 })
854 }
855
856
857 func testInt8x16ConvertToInt64x2(t *testing.T, f func(x archsimd.Int8x16) archsimd.Int64x2, want func(x []int8) []int64) {
858 n := 16
859 t.Helper()
860 forSlice(t, int8s, n, func(x []int8) bool {
861 t.Helper()
862 a := archsimd.LoadInt8x16(x)
863 g := make([]int64, 2)
864 f(a).Store(g)
865 w := want(x)
866 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
867 })
868 }
869
870
871 func testInt16x8ConvertToInt64x2(t *testing.T, f func(x archsimd.Int16x8) archsimd.Int64x2, want func(x []int16) []int64) {
872 n := 8
873 t.Helper()
874 forSlice(t, int16s, n, func(x []int16) bool {
875 t.Helper()
876 a := archsimd.LoadInt16x8(x)
877 g := make([]int64, 2)
878 f(a).Store(g)
879 w := want(x)
880 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
881 })
882 }
883
884
885 func testInt32x4ConvertToInt64x2(t *testing.T, f func(x archsimd.Int32x4) archsimd.Int64x2, want func(x []int32) []int64) {
886 n := 4
887 t.Helper()
888 forSlice(t, int32s, n, func(x []int32) bool {
889 t.Helper()
890 a := archsimd.LoadInt32x4(x)
891 g := make([]int64, 2)
892 f(a).Store(g)
893 w := want(x)
894 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
895 })
896 }
897
898
899 func testInt64x2ConvertToInt64x2(t *testing.T, f func(x archsimd.Int64x2) archsimd.Int64x2, want func(x []int64) []int64) {
900 n := 2
901 t.Helper()
902 forSlice(t, int64s, n, func(x []int64) bool {
903 t.Helper()
904 a := archsimd.LoadInt64x2(x)
905 g := make([]int64, 2)
906 f(a).Store(g)
907 w := want(x)
908 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
909 })
910 }
911
912
913 func testUint8x16ConvertToInt64x2(t *testing.T, f func(x archsimd.Uint8x16) archsimd.Int64x2, want func(x []uint8) []int64) {
914 n := 16
915 t.Helper()
916 forSlice(t, uint8s, n, func(x []uint8) bool {
917 t.Helper()
918 a := archsimd.LoadUint8x16(x)
919 g := make([]int64, 2)
920 f(a).Store(g)
921 w := want(x)
922 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
923 })
924 }
925
926
927 func testUint16x8ConvertToInt64x2(t *testing.T, f func(x archsimd.Uint16x8) archsimd.Int64x2, want func(x []uint16) []int64) {
928 n := 8
929 t.Helper()
930 forSlice(t, uint16s, n, func(x []uint16) bool {
931 t.Helper()
932 a := archsimd.LoadUint16x8(x)
933 g := make([]int64, 2)
934 f(a).Store(g)
935 w := want(x)
936 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
937 })
938 }
939
940
941 func testUint32x4ConvertToInt64x2(t *testing.T, f func(x archsimd.Uint32x4) archsimd.Int64x2, want func(x []uint32) []int64) {
942 n := 4
943 t.Helper()
944 forSlice(t, uint32s, n, func(x []uint32) bool {
945 t.Helper()
946 a := archsimd.LoadUint32x4(x)
947 g := make([]int64, 2)
948 f(a).Store(g)
949 w := want(x)
950 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
951 })
952 }
953
954
955 func testUint64x2ConvertToInt64x2(t *testing.T, f func(x archsimd.Uint64x2) archsimd.Int64x2, want func(x []uint64) []int64) {
956 n := 2
957 t.Helper()
958 forSlice(t, uint64s, n, func(x []uint64) bool {
959 t.Helper()
960 a := archsimd.LoadUint64x2(x)
961 g := make([]int64, 2)
962 f(a).Store(g)
963 w := want(x)
964 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
965 })
966 }
967
968
969 func testFloat32x4ConvertToInt64x2(t *testing.T, f func(x archsimd.Float32x4) archsimd.Int64x2, want func(x []float32) []int64) {
970 n := 4
971 t.Helper()
972 forSlice(t, float32s, n, func(x []float32) bool {
973 t.Helper()
974 a := archsimd.LoadFloat32x4(x)
975 g := make([]int64, 2)
976 f(a).Store(g)
977 w := want(x)
978 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
979 })
980 }
981
982
983 func testFloat64x2ConvertToInt64x2(t *testing.T, f func(x archsimd.Float64x2) archsimd.Int64x2, want func(x []float64) []int64) {
984 n := 2
985 t.Helper()
986 forSlice(t, float64s, n, func(x []float64) bool {
987 t.Helper()
988 a := archsimd.LoadFloat64x2(x)
989 g := make([]int64, 2)
990 f(a).Store(g)
991 w := want(x)
992 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
993 })
994 }
995
996
997 func testInt8x16ConvertToUint64x2(t *testing.T, f func(x archsimd.Int8x16) archsimd.Uint64x2, want func(x []int8) []uint64) {
998 n := 16
999 t.Helper()
1000 forSlice(t, int8s, n, func(x []int8) bool {
1001 t.Helper()
1002 a := archsimd.LoadInt8x16(x)
1003 g := make([]uint64, 2)
1004 f(a).Store(g)
1005 w := want(x)
1006 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
1007 })
1008 }
1009
1010
1011 func testInt16x8ConvertToUint64x2(t *testing.T, f func(x archsimd.Int16x8) archsimd.Uint64x2, want func(x []int16) []uint64) {
1012 n := 8
1013 t.Helper()
1014 forSlice(t, int16s, n, func(x []int16) bool {
1015 t.Helper()
1016 a := archsimd.LoadInt16x8(x)
1017 g := make([]uint64, 2)
1018 f(a).Store(g)
1019 w := want(x)
1020 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
1021 })
1022 }
1023
1024
1025 func testInt32x4ConvertToUint64x2(t *testing.T, f func(x archsimd.Int32x4) archsimd.Uint64x2, want func(x []int32) []uint64) {
1026 n := 4
1027 t.Helper()
1028 forSlice(t, int32s, n, func(x []int32) bool {
1029 t.Helper()
1030 a := archsimd.LoadInt32x4(x)
1031 g := make([]uint64, 2)
1032 f(a).Store(g)
1033 w := want(x)
1034 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
1035 })
1036 }
1037
1038
1039 func testInt64x2ConvertToUint64x2(t *testing.T, f func(x archsimd.Int64x2) archsimd.Uint64x2, want func(x []int64) []uint64) {
1040 n := 2
1041 t.Helper()
1042 forSlice(t, int64s, n, func(x []int64) bool {
1043 t.Helper()
1044 a := archsimd.LoadInt64x2(x)
1045 g := make([]uint64, 2)
1046 f(a).Store(g)
1047 w := want(x)
1048 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
1049 })
1050 }
1051
1052
1053 func testUint8x16ConvertToUint64x2(t *testing.T, f func(x archsimd.Uint8x16) archsimd.Uint64x2, want func(x []uint8) []uint64) {
1054 n := 16
1055 t.Helper()
1056 forSlice(t, uint8s, n, func(x []uint8) bool {
1057 t.Helper()
1058 a := archsimd.LoadUint8x16(x)
1059 g := make([]uint64, 2)
1060 f(a).Store(g)
1061 w := want(x)
1062 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
1063 })
1064 }
1065
1066
1067 func testUint16x8ConvertToUint64x2(t *testing.T, f func(x archsimd.Uint16x8) archsimd.Uint64x2, want func(x []uint16) []uint64) {
1068 n := 8
1069 t.Helper()
1070 forSlice(t, uint16s, n, func(x []uint16) bool {
1071 t.Helper()
1072 a := archsimd.LoadUint16x8(x)
1073 g := make([]uint64, 2)
1074 f(a).Store(g)
1075 w := want(x)
1076 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
1077 })
1078 }
1079
1080
1081 func testUint32x4ConvertToUint64x2(t *testing.T, f func(x archsimd.Uint32x4) archsimd.Uint64x2, want func(x []uint32) []uint64) {
1082 n := 4
1083 t.Helper()
1084 forSlice(t, uint32s, n, func(x []uint32) bool {
1085 t.Helper()
1086 a := archsimd.LoadUint32x4(x)
1087 g := make([]uint64, 2)
1088 f(a).Store(g)
1089 w := want(x)
1090 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
1091 })
1092 }
1093
1094
1095 func testUint64x2ConvertToUint64x2(t *testing.T, f func(x archsimd.Uint64x2) archsimd.Uint64x2, want func(x []uint64) []uint64) {
1096 n := 2
1097 t.Helper()
1098 forSlice(t, uint64s, n, func(x []uint64) bool {
1099 t.Helper()
1100 a := archsimd.LoadUint64x2(x)
1101 g := make([]uint64, 2)
1102 f(a).Store(g)
1103 w := want(x)
1104 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
1105 })
1106 }
1107
1108
1109 func testFloat32x4ConvertToUint64x2(t *testing.T, f func(x archsimd.Float32x4) archsimd.Uint64x2, want func(x []float32) []uint64) {
1110 n := 4
1111 t.Helper()
1112 forSlice(t, float32s, n, func(x []float32) bool {
1113 t.Helper()
1114 a := archsimd.LoadFloat32x4(x)
1115 g := make([]uint64, 2)
1116 f(a).Store(g)
1117 w := want(x)
1118 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
1119 })
1120 }
1121
1122
1123 func testFloat64x2ConvertToUint64x2(t *testing.T, f func(x archsimd.Float64x2) archsimd.Uint64x2, want func(x []float64) []uint64) {
1124 n := 2
1125 t.Helper()
1126 forSlice(t, float64s, n, func(x []float64) bool {
1127 t.Helper()
1128 a := archsimd.LoadFloat64x2(x)
1129 g := make([]uint64, 2)
1130 f(a).Store(g)
1131 w := want(x)
1132 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
1133 })
1134 }
1135
1136
1137 func testInt8x16ConvertToFloat32x4(t *testing.T, f func(x archsimd.Int8x16) archsimd.Float32x4, want func(x []int8) []float32) {
1138 n := 16
1139 t.Helper()
1140 forSlice(t, int8s, n, func(x []int8) bool {
1141 t.Helper()
1142 a := archsimd.LoadInt8x16(x)
1143 g := make([]float32, 4)
1144 f(a).Store(g)
1145 w := want(x)
1146 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
1147 })
1148 }
1149
1150
1151 func testInt16x8ConvertToFloat32x4(t *testing.T, f func(x archsimd.Int16x8) archsimd.Float32x4, want func(x []int16) []float32) {
1152 n := 8
1153 t.Helper()
1154 forSlice(t, int16s, n, func(x []int16) bool {
1155 t.Helper()
1156 a := archsimd.LoadInt16x8(x)
1157 g := make([]float32, 4)
1158 f(a).Store(g)
1159 w := want(x)
1160 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
1161 })
1162 }
1163
1164
1165 func testInt32x4ConvertToFloat32x4(t *testing.T, f func(x archsimd.Int32x4) archsimd.Float32x4, want func(x []int32) []float32) {
1166 n := 4
1167 t.Helper()
1168 forSlice(t, int32s, n, func(x []int32) bool {
1169 t.Helper()
1170 a := archsimd.LoadInt32x4(x)
1171 g := make([]float32, 4)
1172 f(a).Store(g)
1173 w := want(x)
1174 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
1175 })
1176 }
1177
1178
1179 func testInt64x2ConvertToFloat32x4(t *testing.T, f func(x archsimd.Int64x2) archsimd.Float32x4, want func(x []int64) []float32) {
1180 n := 2
1181 t.Helper()
1182 forSlice(t, int64s, n, func(x []int64) bool {
1183 t.Helper()
1184 a := archsimd.LoadInt64x2(x)
1185 g := make([]float32, 4)
1186 f(a).Store(g)
1187 w := want(x)
1188 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
1189 })
1190 }
1191
1192
1193 func testUint8x16ConvertToFloat32x4(t *testing.T, f func(x archsimd.Uint8x16) archsimd.Float32x4, want func(x []uint8) []float32) {
1194 n := 16
1195 t.Helper()
1196 forSlice(t, uint8s, n, func(x []uint8) bool {
1197 t.Helper()
1198 a := archsimd.LoadUint8x16(x)
1199 g := make([]float32, 4)
1200 f(a).Store(g)
1201 w := want(x)
1202 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
1203 })
1204 }
1205
1206
1207 func testUint16x8ConvertToFloat32x4(t *testing.T, f func(x archsimd.Uint16x8) archsimd.Float32x4, want func(x []uint16) []float32) {
1208 n := 8
1209 t.Helper()
1210 forSlice(t, uint16s, n, func(x []uint16) bool {
1211 t.Helper()
1212 a := archsimd.LoadUint16x8(x)
1213 g := make([]float32, 4)
1214 f(a).Store(g)
1215 w := want(x)
1216 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
1217 })
1218 }
1219
1220
1221 func testUint32x4ConvertToFloat32x4(t *testing.T, f func(x archsimd.Uint32x4) archsimd.Float32x4, want func(x []uint32) []float32) {
1222 n := 4
1223 t.Helper()
1224 forSlice(t, uint32s, n, func(x []uint32) bool {
1225 t.Helper()
1226 a := archsimd.LoadUint32x4(x)
1227 g := make([]float32, 4)
1228 f(a).Store(g)
1229 w := want(x)
1230 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
1231 })
1232 }
1233
1234
1235 func testUint64x2ConvertToFloat32x4(t *testing.T, f func(x archsimd.Uint64x2) archsimd.Float32x4, want func(x []uint64) []float32) {
1236 n := 2
1237 t.Helper()
1238 forSlice(t, uint64s, n, func(x []uint64) bool {
1239 t.Helper()
1240 a := archsimd.LoadUint64x2(x)
1241 g := make([]float32, 4)
1242 f(a).Store(g)
1243 w := want(x)
1244 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
1245 })
1246 }
1247
1248
1249 func testFloat32x4ConvertToFloat32x4(t *testing.T, f func(x archsimd.Float32x4) archsimd.Float32x4, want func(x []float32) []float32) {
1250 n := 4
1251 t.Helper()
1252 forSlice(t, float32s, n, func(x []float32) bool {
1253 t.Helper()
1254 a := archsimd.LoadFloat32x4(x)
1255 g := make([]float32, 4)
1256 f(a).Store(g)
1257 w := want(x)
1258 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
1259 })
1260 }
1261
1262
1263 func testFloat64x2ConvertToFloat32x4(t *testing.T, f func(x archsimd.Float64x2) archsimd.Float32x4, want func(x []float64) []float32) {
1264 n := 2
1265 t.Helper()
1266 forSlice(t, float64s, n, func(x []float64) bool {
1267 t.Helper()
1268 a := archsimd.LoadFloat64x2(x)
1269 g := make([]float32, 4)
1270 f(a).Store(g)
1271 w := want(x)
1272 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
1273 })
1274 }
1275
1276
1277 func testInt8x16ConvertToFloat64x2(t *testing.T, f func(x archsimd.Int8x16) archsimd.Float64x2, want func(x []int8) []float64) {
1278 n := 16
1279 t.Helper()
1280 forSlice(t, int8s, n, func(x []int8) bool {
1281 t.Helper()
1282 a := archsimd.LoadInt8x16(x)
1283 g := make([]float64, 2)
1284 f(a).Store(g)
1285 w := want(x)
1286 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
1287 })
1288 }
1289
1290
1291 func testInt16x8ConvertToFloat64x2(t *testing.T, f func(x archsimd.Int16x8) archsimd.Float64x2, want func(x []int16) []float64) {
1292 n := 8
1293 t.Helper()
1294 forSlice(t, int16s, n, func(x []int16) bool {
1295 t.Helper()
1296 a := archsimd.LoadInt16x8(x)
1297 g := make([]float64, 2)
1298 f(a).Store(g)
1299 w := want(x)
1300 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
1301 })
1302 }
1303
1304
1305 func testInt32x4ConvertToFloat64x2(t *testing.T, f func(x archsimd.Int32x4) archsimd.Float64x2, want func(x []int32) []float64) {
1306 n := 4
1307 t.Helper()
1308 forSlice(t, int32s, n, func(x []int32) bool {
1309 t.Helper()
1310 a := archsimd.LoadInt32x4(x)
1311 g := make([]float64, 2)
1312 f(a).Store(g)
1313 w := want(x)
1314 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
1315 })
1316 }
1317
1318
1319 func testInt64x2ConvertToFloat64x2(t *testing.T, f func(x archsimd.Int64x2) archsimd.Float64x2, want func(x []int64) []float64) {
1320 n := 2
1321 t.Helper()
1322 forSlice(t, int64s, n, func(x []int64) bool {
1323 t.Helper()
1324 a := archsimd.LoadInt64x2(x)
1325 g := make([]float64, 2)
1326 f(a).Store(g)
1327 w := want(x)
1328 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
1329 })
1330 }
1331
1332
1333 func testUint8x16ConvertToFloat64x2(t *testing.T, f func(x archsimd.Uint8x16) archsimd.Float64x2, want func(x []uint8) []float64) {
1334 n := 16
1335 t.Helper()
1336 forSlice(t, uint8s, n, func(x []uint8) bool {
1337 t.Helper()
1338 a := archsimd.LoadUint8x16(x)
1339 g := make([]float64, 2)
1340 f(a).Store(g)
1341 w := want(x)
1342 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
1343 })
1344 }
1345
1346
1347 func testUint16x8ConvertToFloat64x2(t *testing.T, f func(x archsimd.Uint16x8) archsimd.Float64x2, want func(x []uint16) []float64) {
1348 n := 8
1349 t.Helper()
1350 forSlice(t, uint16s, n, func(x []uint16) bool {
1351 t.Helper()
1352 a := archsimd.LoadUint16x8(x)
1353 g := make([]float64, 2)
1354 f(a).Store(g)
1355 w := want(x)
1356 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
1357 })
1358 }
1359
1360
1361 func testUint32x4ConvertToFloat64x2(t *testing.T, f func(x archsimd.Uint32x4) archsimd.Float64x2, want func(x []uint32) []float64) {
1362 n := 4
1363 t.Helper()
1364 forSlice(t, uint32s, n, func(x []uint32) bool {
1365 t.Helper()
1366 a := archsimd.LoadUint32x4(x)
1367 g := make([]float64, 2)
1368 f(a).Store(g)
1369 w := want(x)
1370 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
1371 })
1372 }
1373
1374
1375 func testUint64x2ConvertToFloat64x2(t *testing.T, f func(x archsimd.Uint64x2) archsimd.Float64x2, want func(x []uint64) []float64) {
1376 n := 2
1377 t.Helper()
1378 forSlice(t, uint64s, n, func(x []uint64) bool {
1379 t.Helper()
1380 a := archsimd.LoadUint64x2(x)
1381 g := make([]float64, 2)
1382 f(a).Store(g)
1383 w := want(x)
1384 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
1385 })
1386 }
1387
1388
1389 func testFloat32x4ConvertToFloat64x2(t *testing.T, f func(x archsimd.Float32x4) archsimd.Float64x2, want func(x []float32) []float64) {
1390 n := 4
1391 t.Helper()
1392 forSlice(t, float32s, n, func(x []float32) bool {
1393 t.Helper()
1394 a := archsimd.LoadFloat32x4(x)
1395 g := make([]float64, 2)
1396 f(a).Store(g)
1397 w := want(x)
1398 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
1399 })
1400 }
1401
1402
1403 func testFloat64x2ConvertToFloat64x2(t *testing.T, f func(x archsimd.Float64x2) archsimd.Float64x2, want func(x []float64) []float64) {
1404 n := 2
1405 t.Helper()
1406 forSlice(t, float64s, n, func(x []float64) bool {
1407 t.Helper()
1408 a := archsimd.LoadFloat64x2(x)
1409 g := make([]float64, 2)
1410 f(a).Store(g)
1411 w := want(x)
1412 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
1413 })
1414 }
1415
1416
1417 func testInt8x16Unary(t *testing.T, f func(_ archsimd.Int8x16) archsimd.Int8x16, want func(_ []int8) []int8) {
1418 n := 16
1419 t.Helper()
1420 forSlice(t, int8s, n, func(x []int8) bool {
1421 t.Helper()
1422 a := archsimd.LoadInt8x16(x)
1423 g := make([]int8, n)
1424 f(a).Store(g)
1425 w := want(x)
1426 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
1427 })
1428 }
1429
1430
1431 func testInt16x8Unary(t *testing.T, f func(_ archsimd.Int16x8) archsimd.Int16x8, want func(_ []int16) []int16) {
1432 n := 8
1433 t.Helper()
1434 forSlice(t, int16s, n, func(x []int16) bool {
1435 t.Helper()
1436 a := archsimd.LoadInt16x8(x)
1437 g := make([]int16, n)
1438 f(a).Store(g)
1439 w := want(x)
1440 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
1441 })
1442 }
1443
1444
1445 func testInt32x4Unary(t *testing.T, f func(_ archsimd.Int32x4) archsimd.Int32x4, want func(_ []int32) []int32) {
1446 n := 4
1447 t.Helper()
1448 forSlice(t, int32s, n, func(x []int32) bool {
1449 t.Helper()
1450 a := archsimd.LoadInt32x4(x)
1451 g := make([]int32, n)
1452 f(a).Store(g)
1453 w := want(x)
1454 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
1455 })
1456 }
1457
1458
1459 func testInt64x2Unary(t *testing.T, f func(_ archsimd.Int64x2) archsimd.Int64x2, want func(_ []int64) []int64) {
1460 n := 2
1461 t.Helper()
1462 forSlice(t, int64s, n, func(x []int64) bool {
1463 t.Helper()
1464 a := archsimd.LoadInt64x2(x)
1465 g := make([]int64, n)
1466 f(a).Store(g)
1467 w := want(x)
1468 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
1469 })
1470 }
1471
1472
1473 func testUint8x16Unary(t *testing.T, f func(_ archsimd.Uint8x16) archsimd.Uint8x16, want func(_ []uint8) []uint8) {
1474 n := 16
1475 t.Helper()
1476 forSlice(t, uint8s, n, func(x []uint8) bool {
1477 t.Helper()
1478 a := archsimd.LoadUint8x16(x)
1479 g := make([]uint8, n)
1480 f(a).Store(g)
1481 w := want(x)
1482 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
1483 })
1484 }
1485
1486
1487 func testUint16x8Unary(t *testing.T, f func(_ archsimd.Uint16x8) archsimd.Uint16x8, want func(_ []uint16) []uint16) {
1488 n := 8
1489 t.Helper()
1490 forSlice(t, uint16s, n, func(x []uint16) bool {
1491 t.Helper()
1492 a := archsimd.LoadUint16x8(x)
1493 g := make([]uint16, n)
1494 f(a).Store(g)
1495 w := want(x)
1496 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
1497 })
1498 }
1499
1500
1501 func testUint32x4Unary(t *testing.T, f func(_ archsimd.Uint32x4) archsimd.Uint32x4, want func(_ []uint32) []uint32) {
1502 n := 4
1503 t.Helper()
1504 forSlice(t, uint32s, n, func(x []uint32) bool {
1505 t.Helper()
1506 a := archsimd.LoadUint32x4(x)
1507 g := make([]uint32, n)
1508 f(a).Store(g)
1509 w := want(x)
1510 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
1511 })
1512 }
1513
1514
1515 func testUint64x2Unary(t *testing.T, f func(_ archsimd.Uint64x2) archsimd.Uint64x2, want func(_ []uint64) []uint64) {
1516 n := 2
1517 t.Helper()
1518 forSlice(t, uint64s, n, func(x []uint64) bool {
1519 t.Helper()
1520 a := archsimd.LoadUint64x2(x)
1521 g := make([]uint64, n)
1522 f(a).Store(g)
1523 w := want(x)
1524 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
1525 })
1526 }
1527
1528
1529 func testFloat32x4Unary(t *testing.T, f func(_ archsimd.Float32x4) archsimd.Float32x4, want func(_ []float32) []float32) {
1530 n := 4
1531 t.Helper()
1532 forSlice(t, float32s, n, func(x []float32) bool {
1533 t.Helper()
1534 a := archsimd.LoadFloat32x4(x)
1535 g := make([]float32, n)
1536 f(a).Store(g)
1537 w := want(x)
1538 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
1539 })
1540 }
1541
1542
1543 func testFloat64x2Unary(t *testing.T, f func(_ archsimd.Float64x2) archsimd.Float64x2, want func(_ []float64) []float64) {
1544 n := 2
1545 t.Helper()
1546 forSlice(t, float64s, n, func(x []float64) bool {
1547 t.Helper()
1548 a := archsimd.LoadFloat64x2(x)
1549 g := make([]float64, n)
1550 f(a).Store(g)
1551 w := want(x)
1552 return checkSlicesLogInput(t, g, w, 0.0, func() { t.Helper(); t.Logf("x=%v", x) })
1553 })
1554 }
1555
View as plain text