Source file
src/simd/slice_gen_amd64.go
1
2
3
4
5 package simd
6
7 import "unsafe"
8
9
10 func LoadInt8x16Slice(s []int8) Int8x16 {
11 return LoadInt8x16((*[16]int8)(s))
12 }
13
14
15 func (x Int8x16) StoreSlice(s []int8) {
16 x.Store((*[16]int8)(s))
17 }
18
19
20 func LoadInt16x8Slice(s []int16) Int16x8 {
21 return LoadInt16x8((*[8]int16)(s))
22 }
23
24
25 func (x Int16x8) StoreSlice(s []int16) {
26 x.Store((*[8]int16)(s))
27 }
28
29
30 func LoadInt32x4Slice(s []int32) Int32x4 {
31 return LoadInt32x4((*[4]int32)(s))
32 }
33
34
35 func (x Int32x4) StoreSlice(s []int32) {
36 x.Store((*[4]int32)(s))
37 }
38
39
40 func LoadInt64x2Slice(s []int64) Int64x2 {
41 return LoadInt64x2((*[2]int64)(s))
42 }
43
44
45 func (x Int64x2) StoreSlice(s []int64) {
46 x.Store((*[2]int64)(s))
47 }
48
49
50 func LoadUint8x16Slice(s []uint8) Uint8x16 {
51 return LoadUint8x16((*[16]uint8)(s))
52 }
53
54
55 func (x Uint8x16) StoreSlice(s []uint8) {
56 x.Store((*[16]uint8)(s))
57 }
58
59
60 func LoadUint16x8Slice(s []uint16) Uint16x8 {
61 return LoadUint16x8((*[8]uint16)(s))
62 }
63
64
65 func (x Uint16x8) StoreSlice(s []uint16) {
66 x.Store((*[8]uint16)(s))
67 }
68
69
70 func LoadUint32x4Slice(s []uint32) Uint32x4 {
71 return LoadUint32x4((*[4]uint32)(s))
72 }
73
74
75 func (x Uint32x4) StoreSlice(s []uint32) {
76 x.Store((*[4]uint32)(s))
77 }
78
79
80 func LoadUint64x2Slice(s []uint64) Uint64x2 {
81 return LoadUint64x2((*[2]uint64)(s))
82 }
83
84
85 func (x Uint64x2) StoreSlice(s []uint64) {
86 x.Store((*[2]uint64)(s))
87 }
88
89
90 func LoadFloat32x4Slice(s []float32) Float32x4 {
91 return LoadFloat32x4((*[4]float32)(s))
92 }
93
94
95 func (x Float32x4) StoreSlice(s []float32) {
96 x.Store((*[4]float32)(s))
97 }
98
99
100 func LoadFloat64x2Slice(s []float64) Float64x2 {
101 return LoadFloat64x2((*[2]float64)(s))
102 }
103
104
105 func (x Float64x2) StoreSlice(s []float64) {
106 x.Store((*[2]float64)(s))
107 }
108
109
110 func LoadInt8x32Slice(s []int8) Int8x32 {
111 return LoadInt8x32((*[32]int8)(s))
112 }
113
114
115 func (x Int8x32) StoreSlice(s []int8) {
116 x.Store((*[32]int8)(s))
117 }
118
119
120 func LoadInt16x16Slice(s []int16) Int16x16 {
121 return LoadInt16x16((*[16]int16)(s))
122 }
123
124
125 func (x Int16x16) StoreSlice(s []int16) {
126 x.Store((*[16]int16)(s))
127 }
128
129
130 func LoadInt32x8Slice(s []int32) Int32x8 {
131 return LoadInt32x8((*[8]int32)(s))
132 }
133
134
135 func (x Int32x8) StoreSlice(s []int32) {
136 x.Store((*[8]int32)(s))
137 }
138
139
140 func LoadInt64x4Slice(s []int64) Int64x4 {
141 return LoadInt64x4((*[4]int64)(s))
142 }
143
144
145 func (x Int64x4) StoreSlice(s []int64) {
146 x.Store((*[4]int64)(s))
147 }
148
149
150 func LoadUint8x32Slice(s []uint8) Uint8x32 {
151 return LoadUint8x32((*[32]uint8)(s))
152 }
153
154
155 func (x Uint8x32) StoreSlice(s []uint8) {
156 x.Store((*[32]uint8)(s))
157 }
158
159
160 func LoadUint16x16Slice(s []uint16) Uint16x16 {
161 return LoadUint16x16((*[16]uint16)(s))
162 }
163
164
165 func (x Uint16x16) StoreSlice(s []uint16) {
166 x.Store((*[16]uint16)(s))
167 }
168
169
170 func LoadUint32x8Slice(s []uint32) Uint32x8 {
171 return LoadUint32x8((*[8]uint32)(s))
172 }
173
174
175 func (x Uint32x8) StoreSlice(s []uint32) {
176 x.Store((*[8]uint32)(s))
177 }
178
179
180 func LoadUint64x4Slice(s []uint64) Uint64x4 {
181 return LoadUint64x4((*[4]uint64)(s))
182 }
183
184
185 func (x Uint64x4) StoreSlice(s []uint64) {
186 x.Store((*[4]uint64)(s))
187 }
188
189
190 func LoadFloat32x8Slice(s []float32) Float32x8 {
191 return LoadFloat32x8((*[8]float32)(s))
192 }
193
194
195 func (x Float32x8) StoreSlice(s []float32) {
196 x.Store((*[8]float32)(s))
197 }
198
199
200 func LoadFloat64x4Slice(s []float64) Float64x4 {
201 return LoadFloat64x4((*[4]float64)(s))
202 }
203
204
205 func (x Float64x4) StoreSlice(s []float64) {
206 x.Store((*[4]float64)(s))
207 }
208
209
210 func LoadInt8x64Slice(s []int8) Int8x64 {
211 return LoadInt8x64((*[64]int8)(s))
212 }
213
214
215 func (x Int8x64) StoreSlice(s []int8) {
216 x.Store((*[64]int8)(s))
217 }
218
219
220 func LoadInt16x32Slice(s []int16) Int16x32 {
221 return LoadInt16x32((*[32]int16)(s))
222 }
223
224
225 func (x Int16x32) StoreSlice(s []int16) {
226 x.Store((*[32]int16)(s))
227 }
228
229
230 func LoadInt32x16Slice(s []int32) Int32x16 {
231 return LoadInt32x16((*[16]int32)(s))
232 }
233
234
235 func (x Int32x16) StoreSlice(s []int32) {
236 x.Store((*[16]int32)(s))
237 }
238
239
240 func LoadInt64x8Slice(s []int64) Int64x8 {
241 return LoadInt64x8((*[8]int64)(s))
242 }
243
244
245 func (x Int64x8) StoreSlice(s []int64) {
246 x.Store((*[8]int64)(s))
247 }
248
249
250 func LoadUint8x64Slice(s []uint8) Uint8x64 {
251 return LoadUint8x64((*[64]uint8)(s))
252 }
253
254
255 func (x Uint8x64) StoreSlice(s []uint8) {
256 x.Store((*[64]uint8)(s))
257 }
258
259
260 func LoadUint16x32Slice(s []uint16) Uint16x32 {
261 return LoadUint16x32((*[32]uint16)(s))
262 }
263
264
265 func (x Uint16x32) StoreSlice(s []uint16) {
266 x.Store((*[32]uint16)(s))
267 }
268
269
270 func LoadUint32x16Slice(s []uint32) Uint32x16 {
271 return LoadUint32x16((*[16]uint32)(s))
272 }
273
274
275 func (x Uint32x16) StoreSlice(s []uint32) {
276 x.Store((*[16]uint32)(s))
277 }
278
279
280 func LoadUint64x8Slice(s []uint64) Uint64x8 {
281 return LoadUint64x8((*[8]uint64)(s))
282 }
283
284
285 func (x Uint64x8) StoreSlice(s []uint64) {
286 x.Store((*[8]uint64)(s))
287 }
288
289
290 func LoadFloat32x16Slice(s []float32) Float32x16 {
291 return LoadFloat32x16((*[16]float32)(s))
292 }
293
294
295 func (x Float32x16) StoreSlice(s []float32) {
296 x.Store((*[16]float32)(s))
297 }
298
299
300 func LoadFloat64x8Slice(s []float64) Float64x8 {
301 return LoadFloat64x8((*[8]float64)(s))
302 }
303
304
305 func (x Float64x8) StoreSlice(s []float64) {
306 x.Store((*[8]float64)(s))
307 }
308
309
310
311
312 func LoadInt8x64SlicePart(s []int8) Int8x64 {
313 l := len(s)
314 if l >= 64 {
315 return LoadInt8x64Slice(s)
316 }
317 if l == 0 {
318 var x Int8x64
319 return x
320 }
321 mask := Mask8x64FromBits(0xffffffffffffffff >> (64 - l))
322 return LoadMaskedInt8x64(paInt8x64(s), mask)
323 }
324
325
326
327
328 func (x Int8x64) StoreSlicePart(s []int8) {
329 l := len(s)
330 if l >= 64 {
331 x.StoreSlice(s)
332 return
333 }
334 if l == 0 {
335 return
336 }
337 mask := Mask8x64FromBits(0xffffffffffffffff >> (64 - l))
338 x.StoreMasked(paInt8x64(s), mask)
339 }
340
341
342
343
344 func LoadInt16x32SlicePart(s []int16) Int16x32 {
345 l := len(s)
346 if l >= 32 {
347 return LoadInt16x32Slice(s)
348 }
349 if l == 0 {
350 var x Int16x32
351 return x
352 }
353 mask := Mask16x32FromBits(0xffffffff >> (32 - l))
354 return LoadMaskedInt16x32(paInt16x32(s), mask)
355 }
356
357
358
359
360 func (x Int16x32) StoreSlicePart(s []int16) {
361 l := len(s)
362 if l >= 32 {
363 x.StoreSlice(s)
364 return
365 }
366 if l == 0 {
367 return
368 }
369 mask := Mask16x32FromBits(0xffffffff >> (32 - l))
370 x.StoreMasked(paInt16x32(s), mask)
371 }
372
373
374
375
376 func LoadInt32x16SlicePart(s []int32) Int32x16 {
377 l := len(s)
378 if l >= 16 {
379 return LoadInt32x16Slice(s)
380 }
381 if l == 0 {
382 var x Int32x16
383 return x
384 }
385 mask := Mask32x16FromBits(0xffff >> (16 - l))
386 return LoadMaskedInt32x16(paInt32x16(s), mask)
387 }
388
389
390
391
392 func (x Int32x16) StoreSlicePart(s []int32) {
393 l := len(s)
394 if l >= 16 {
395 x.StoreSlice(s)
396 return
397 }
398 if l == 0 {
399 return
400 }
401 mask := Mask32x16FromBits(0xffff >> (16 - l))
402 x.StoreMasked(paInt32x16(s), mask)
403 }
404
405
406
407
408 func LoadInt64x8SlicePart(s []int64) Int64x8 {
409 l := len(s)
410 if l >= 8 {
411 return LoadInt64x8Slice(s)
412 }
413 if l == 0 {
414 var x Int64x8
415 return x
416 }
417 mask := Mask64x8FromBits(0xff >> (8 - l))
418 return LoadMaskedInt64x8(paInt64x8(s), mask)
419 }
420
421
422
423
424 func (x Int64x8) StoreSlicePart(s []int64) {
425 l := len(s)
426 if l >= 8 {
427 x.StoreSlice(s)
428 return
429 }
430 if l == 0 {
431 return
432 }
433 mask := Mask64x8FromBits(0xff >> (8 - l))
434 x.StoreMasked(paInt64x8(s), mask)
435 }
436
437
438
439
440 func LoadUint8x64SlicePart(s []uint8) Uint8x64 {
441 l := len(s)
442 if l >= 64 {
443 return LoadUint8x64Slice(s)
444 }
445 if l == 0 {
446 var x Uint8x64
447 return x
448 }
449 mask := Mask8x64FromBits(0xffffffffffffffff >> (64 - l))
450 return LoadMaskedUint8x64(paUint8x64(s), mask)
451 }
452
453
454
455
456 func (x Uint8x64) StoreSlicePart(s []uint8) {
457 l := len(s)
458 if l >= 64 {
459 x.StoreSlice(s)
460 return
461 }
462 if l == 0 {
463 return
464 }
465 mask := Mask8x64FromBits(0xffffffffffffffff >> (64 - l))
466 x.StoreMasked(paUint8x64(s), mask)
467 }
468
469
470
471
472 func LoadUint16x32SlicePart(s []uint16) Uint16x32 {
473 l := len(s)
474 if l >= 32 {
475 return LoadUint16x32Slice(s)
476 }
477 if l == 0 {
478 var x Uint16x32
479 return x
480 }
481 mask := Mask16x32FromBits(0xffffffff >> (32 - l))
482 return LoadMaskedUint16x32(paUint16x32(s), mask)
483 }
484
485
486
487
488 func (x Uint16x32) StoreSlicePart(s []uint16) {
489 l := len(s)
490 if l >= 32 {
491 x.StoreSlice(s)
492 return
493 }
494 if l == 0 {
495 return
496 }
497 mask := Mask16x32FromBits(0xffffffff >> (32 - l))
498 x.StoreMasked(paUint16x32(s), mask)
499 }
500
501
502
503
504 func LoadUint32x16SlicePart(s []uint32) Uint32x16 {
505 l := len(s)
506 if l >= 16 {
507 return LoadUint32x16Slice(s)
508 }
509 if l == 0 {
510 var x Uint32x16
511 return x
512 }
513 mask := Mask32x16FromBits(0xffff >> (16 - l))
514 return LoadMaskedUint32x16(paUint32x16(s), mask)
515 }
516
517
518
519
520 func (x Uint32x16) StoreSlicePart(s []uint32) {
521 l := len(s)
522 if l >= 16 {
523 x.StoreSlice(s)
524 return
525 }
526 if l == 0 {
527 return
528 }
529 mask := Mask32x16FromBits(0xffff >> (16 - l))
530 x.StoreMasked(paUint32x16(s), mask)
531 }
532
533
534
535
536 func LoadUint64x8SlicePart(s []uint64) Uint64x8 {
537 l := len(s)
538 if l >= 8 {
539 return LoadUint64x8Slice(s)
540 }
541 if l == 0 {
542 var x Uint64x8
543 return x
544 }
545 mask := Mask64x8FromBits(0xff >> (8 - l))
546 return LoadMaskedUint64x8(paUint64x8(s), mask)
547 }
548
549
550
551
552 func (x Uint64x8) StoreSlicePart(s []uint64) {
553 l := len(s)
554 if l >= 8 {
555 x.StoreSlice(s)
556 return
557 }
558 if l == 0 {
559 return
560 }
561 mask := Mask64x8FromBits(0xff >> (8 - l))
562 x.StoreMasked(paUint64x8(s), mask)
563 }
564
565
566
567
568 func LoadFloat32x16SlicePart(s []float32) Float32x16 {
569 l := len(s)
570 if l >= 16 {
571 return LoadFloat32x16Slice(s)
572 }
573 if l == 0 {
574 var x Float32x16
575 return x
576 }
577 mask := Mask32x16FromBits(0xffff >> (16 - l))
578 return LoadMaskedFloat32x16(paFloat32x16(s), mask)
579 }
580
581
582
583
584 func (x Float32x16) StoreSlicePart(s []float32) {
585 l := len(s)
586 if l >= 16 {
587 x.StoreSlice(s)
588 return
589 }
590 if l == 0 {
591 return
592 }
593 mask := Mask32x16FromBits(0xffff >> (16 - l))
594 x.StoreMasked(paFloat32x16(s), mask)
595 }
596
597
598
599
600 func LoadFloat64x8SlicePart(s []float64) Float64x8 {
601 l := len(s)
602 if l >= 8 {
603 return LoadFloat64x8Slice(s)
604 }
605 if l == 0 {
606 var x Float64x8
607 return x
608 }
609 mask := Mask64x8FromBits(0xff >> (8 - l))
610 return LoadMaskedFloat64x8(paFloat64x8(s), mask)
611 }
612
613
614
615
616 func (x Float64x8) StoreSlicePart(s []float64) {
617 l := len(s)
618 if l >= 8 {
619 x.StoreSlice(s)
620 return
621 }
622 if l == 0 {
623 return
624 }
625 mask := Mask64x8FromBits(0xff >> (8 - l))
626 x.StoreMasked(paFloat64x8(s), mask)
627 }
628
629
630
631
632 func LoadInt32x4SlicePart(s []int32) Int32x4 {
633 l := len(s)
634 if l >= 4 {
635 return LoadInt32x4Slice(s)
636 }
637 if l == 0 {
638 var x Int32x4
639 return x
640 }
641 mask := vecMask32[len(vecMask32)/2-l:]
642 return LoadMaskedInt32x4(paInt32x4(s), LoadInt32x4Slice(mask).asMask())
643 }
644
645
646
647
648 func (x Int32x4) StoreSlicePart(s []int32) {
649 l := len(s)
650 if l >= 4 {
651 x.StoreSlice(s)
652 return
653 }
654 if l == 0 {
655 return
656 }
657 mask := vecMask32[len(vecMask32)/2-l:]
658 x.StoreMasked(paInt32x4(s), LoadInt32x4Slice(mask).asMask())
659 }
660
661
662
663
664 func LoadInt64x2SlicePart(s []int64) Int64x2 {
665 l := len(s)
666 if l >= 2 {
667 return LoadInt64x2Slice(s)
668 }
669 if l == 0 {
670 var x Int64x2
671 return x
672 }
673 mask := vecMask64[len(vecMask64)/2-l:]
674 return LoadMaskedInt64x2(paInt64x2(s), LoadInt64x2Slice(mask).asMask())
675 }
676
677
678
679
680 func (x Int64x2) StoreSlicePart(s []int64) {
681 l := len(s)
682 if l >= 2 {
683 x.StoreSlice(s)
684 return
685 }
686 if l == 0 {
687 return
688 }
689 mask := vecMask64[len(vecMask64)/2-l:]
690 x.StoreMasked(paInt64x2(s), LoadInt64x2Slice(mask).asMask())
691 }
692
693
694
695
696 func LoadUint32x4SlicePart(s []uint32) Uint32x4 {
697 l := len(s)
698 if l >= 4 {
699 return LoadUint32x4Slice(s)
700 }
701 if l == 0 {
702 var x Uint32x4
703 return x
704 }
705 mask := vecMask32[len(vecMask32)/2-l:]
706 return LoadMaskedUint32x4(paUint32x4(s), LoadInt32x4Slice(mask).asMask())
707 }
708
709
710
711
712 func (x Uint32x4) StoreSlicePart(s []uint32) {
713 l := len(s)
714 if l >= 4 {
715 x.StoreSlice(s)
716 return
717 }
718 if l == 0 {
719 return
720 }
721 mask := vecMask32[len(vecMask32)/2-l:]
722 x.StoreMasked(paUint32x4(s), LoadInt32x4Slice(mask).asMask())
723 }
724
725
726
727
728 func LoadUint64x2SlicePart(s []uint64) Uint64x2 {
729 l := len(s)
730 if l >= 2 {
731 return LoadUint64x2Slice(s)
732 }
733 if l == 0 {
734 var x Uint64x2
735 return x
736 }
737 mask := vecMask64[len(vecMask64)/2-l:]
738 return LoadMaskedUint64x2(paUint64x2(s), LoadInt64x2Slice(mask).asMask())
739 }
740
741
742
743
744 func (x Uint64x2) StoreSlicePart(s []uint64) {
745 l := len(s)
746 if l >= 2 {
747 x.StoreSlice(s)
748 return
749 }
750 if l == 0 {
751 return
752 }
753 mask := vecMask64[len(vecMask64)/2-l:]
754 x.StoreMasked(paUint64x2(s), LoadInt64x2Slice(mask).asMask())
755 }
756
757
758
759
760 func LoadFloat32x4SlicePart(s []float32) Float32x4 {
761 l := len(s)
762 if l >= 4 {
763 return LoadFloat32x4Slice(s)
764 }
765 if l == 0 {
766 var x Float32x4
767 return x
768 }
769 mask := vecMask32[len(vecMask32)/2-l:]
770 return LoadMaskedFloat32x4(paFloat32x4(s), LoadInt32x4Slice(mask).asMask())
771 }
772
773
774
775
776 func (x Float32x4) StoreSlicePart(s []float32) {
777 l := len(s)
778 if l >= 4 {
779 x.StoreSlice(s)
780 return
781 }
782 if l == 0 {
783 return
784 }
785 mask := vecMask32[len(vecMask32)/2-l:]
786 x.StoreMasked(paFloat32x4(s), LoadInt32x4Slice(mask).asMask())
787 }
788
789
790
791
792 func LoadFloat64x2SlicePart(s []float64) Float64x2 {
793 l := len(s)
794 if l >= 2 {
795 return LoadFloat64x2Slice(s)
796 }
797 if l == 0 {
798 var x Float64x2
799 return x
800 }
801 mask := vecMask64[len(vecMask64)/2-l:]
802 return LoadMaskedFloat64x2(paFloat64x2(s), LoadInt64x2Slice(mask).asMask())
803 }
804
805
806
807
808 func (x Float64x2) StoreSlicePart(s []float64) {
809 l := len(s)
810 if l >= 2 {
811 x.StoreSlice(s)
812 return
813 }
814 if l == 0 {
815 return
816 }
817 mask := vecMask64[len(vecMask64)/2-l:]
818 x.StoreMasked(paFloat64x2(s), LoadInt64x2Slice(mask).asMask())
819 }
820
821
822
823
824 func LoadInt32x8SlicePart(s []int32) Int32x8 {
825 l := len(s)
826 if l >= 8 {
827 return LoadInt32x8Slice(s)
828 }
829 if l == 0 {
830 var x Int32x8
831 return x
832 }
833 mask := vecMask32[len(vecMask32)/2-l:]
834 return LoadMaskedInt32x8(paInt32x8(s), LoadInt32x8Slice(mask).asMask())
835 }
836
837
838
839
840 func (x Int32x8) StoreSlicePart(s []int32) {
841 l := len(s)
842 if l >= 8 {
843 x.StoreSlice(s)
844 return
845 }
846 if l == 0 {
847 return
848 }
849 mask := vecMask32[len(vecMask32)/2-l:]
850 x.StoreMasked(paInt32x8(s), LoadInt32x8Slice(mask).asMask())
851 }
852
853
854
855
856 func LoadInt64x4SlicePart(s []int64) Int64x4 {
857 l := len(s)
858 if l >= 4 {
859 return LoadInt64x4Slice(s)
860 }
861 if l == 0 {
862 var x Int64x4
863 return x
864 }
865 mask := vecMask64[len(vecMask64)/2-l:]
866 return LoadMaskedInt64x4(paInt64x4(s), LoadInt64x4Slice(mask).asMask())
867 }
868
869
870
871
872 func (x Int64x4) StoreSlicePart(s []int64) {
873 l := len(s)
874 if l >= 4 {
875 x.StoreSlice(s)
876 return
877 }
878 if l == 0 {
879 return
880 }
881 mask := vecMask64[len(vecMask64)/2-l:]
882 x.StoreMasked(paInt64x4(s), LoadInt64x4Slice(mask).asMask())
883 }
884
885
886
887
888 func LoadUint32x8SlicePart(s []uint32) Uint32x8 {
889 l := len(s)
890 if l >= 8 {
891 return LoadUint32x8Slice(s)
892 }
893 if l == 0 {
894 var x Uint32x8
895 return x
896 }
897 mask := vecMask32[len(vecMask32)/2-l:]
898 return LoadMaskedUint32x8(paUint32x8(s), LoadInt32x8Slice(mask).asMask())
899 }
900
901
902
903
904 func (x Uint32x8) StoreSlicePart(s []uint32) {
905 l := len(s)
906 if l >= 8 {
907 x.StoreSlice(s)
908 return
909 }
910 if l == 0 {
911 return
912 }
913 mask := vecMask32[len(vecMask32)/2-l:]
914 x.StoreMasked(paUint32x8(s), LoadInt32x8Slice(mask).asMask())
915 }
916
917
918
919
920 func LoadUint64x4SlicePart(s []uint64) Uint64x4 {
921 l := len(s)
922 if l >= 4 {
923 return LoadUint64x4Slice(s)
924 }
925 if l == 0 {
926 var x Uint64x4
927 return x
928 }
929 mask := vecMask64[len(vecMask64)/2-l:]
930 return LoadMaskedUint64x4(paUint64x4(s), LoadInt64x4Slice(mask).asMask())
931 }
932
933
934
935
936 func (x Uint64x4) StoreSlicePart(s []uint64) {
937 l := len(s)
938 if l >= 4 {
939 x.StoreSlice(s)
940 return
941 }
942 if l == 0 {
943 return
944 }
945 mask := vecMask64[len(vecMask64)/2-l:]
946 x.StoreMasked(paUint64x4(s), LoadInt64x4Slice(mask).asMask())
947 }
948
949
950
951
952 func LoadFloat32x8SlicePart(s []float32) Float32x8 {
953 l := len(s)
954 if l >= 8 {
955 return LoadFloat32x8Slice(s)
956 }
957 if l == 0 {
958 var x Float32x8
959 return x
960 }
961 mask := vecMask32[len(vecMask32)/2-l:]
962 return LoadMaskedFloat32x8(paFloat32x8(s), LoadInt32x8Slice(mask).asMask())
963 }
964
965
966
967
968 func (x Float32x8) StoreSlicePart(s []float32) {
969 l := len(s)
970 if l >= 8 {
971 x.StoreSlice(s)
972 return
973 }
974 if l == 0 {
975 return
976 }
977 mask := vecMask32[len(vecMask32)/2-l:]
978 x.StoreMasked(paFloat32x8(s), LoadInt32x8Slice(mask).asMask())
979 }
980
981
982
983
984 func LoadFloat64x4SlicePart(s []float64) Float64x4 {
985 l := len(s)
986 if l >= 4 {
987 return LoadFloat64x4Slice(s)
988 }
989 if l == 0 {
990 var x Float64x4
991 return x
992 }
993 mask := vecMask64[len(vecMask64)/2-l:]
994 return LoadMaskedFloat64x4(paFloat64x4(s), LoadInt64x4Slice(mask).asMask())
995 }
996
997
998
999
1000 func (x Float64x4) StoreSlicePart(s []float64) {
1001 l := len(s)
1002 if l >= 4 {
1003 x.StoreSlice(s)
1004 return
1005 }
1006 if l == 0 {
1007 return
1008 }
1009 mask := vecMask64[len(vecMask64)/2-l:]
1010 x.StoreMasked(paFloat64x4(s), LoadInt64x4Slice(mask).asMask())
1011 }
1012
1013
1014
1015
1016 func LoadUint8x16SlicePart(s []uint8) Uint8x16 {
1017 if len(s) == 0 {
1018 var zero Uint8x16
1019 return zero
1020 }
1021 t := unsafe.Slice((*int8)(unsafe.Pointer(&s[0])), len(s))
1022 return LoadInt8x16SlicePart(t).AsUint8x16()
1023 }
1024
1025
1026
1027
1028 func (x Uint8x16) StoreSlicePart(s []uint8) {
1029 if len(s) == 0 {
1030 return
1031 }
1032 t := unsafe.Slice((*int8)(unsafe.Pointer(&s[0])), len(s))
1033 x.AsInt8x16().StoreSlicePart(t)
1034 }
1035
1036
1037
1038
1039 func LoadUint16x8SlicePart(s []uint16) Uint16x8 {
1040 if len(s) == 0 {
1041 var zero Uint16x8
1042 return zero
1043 }
1044 t := unsafe.Slice((*int16)(unsafe.Pointer(&s[0])), len(s))
1045 return LoadInt16x8SlicePart(t).AsUint16x8()
1046 }
1047
1048
1049
1050
1051 func (x Uint16x8) StoreSlicePart(s []uint16) {
1052 if len(s) == 0 {
1053 return
1054 }
1055 t := unsafe.Slice((*int16)(unsafe.Pointer(&s[0])), len(s))
1056 x.AsInt16x8().StoreSlicePart(t)
1057 }
1058
1059
1060
1061
1062 func LoadUint8x32SlicePart(s []uint8) Uint8x32 {
1063 if len(s) == 0 {
1064 var zero Uint8x32
1065 return zero
1066 }
1067 t := unsafe.Slice((*int8)(unsafe.Pointer(&s[0])), len(s))
1068 return LoadInt8x32SlicePart(t).AsUint8x32()
1069 }
1070
1071
1072
1073
1074 func (x Uint8x32) StoreSlicePart(s []uint8) {
1075 if len(s) == 0 {
1076 return
1077 }
1078 t := unsafe.Slice((*int8)(unsafe.Pointer(&s[0])), len(s))
1079 x.AsInt8x32().StoreSlicePart(t)
1080 }
1081
1082
1083
1084
1085 func LoadUint16x16SlicePart(s []uint16) Uint16x16 {
1086 if len(s) == 0 {
1087 var zero Uint16x16
1088 return zero
1089 }
1090 t := unsafe.Slice((*int16)(unsafe.Pointer(&s[0])), len(s))
1091 return LoadInt16x16SlicePart(t).AsUint16x16()
1092 }
1093
1094
1095
1096
1097 func (x Uint16x16) StoreSlicePart(s []uint16) {
1098 if len(s) == 0 {
1099 return
1100 }
1101 t := unsafe.Slice((*int16)(unsafe.Pointer(&s[0])), len(s))
1102 x.AsInt16x16().StoreSlicePart(t)
1103 }
1104
View as plain text