-
Notifications
You must be signed in to change notification settings - Fork 287
/
Copy pathaltivec.rs
6692 lines (5857 loc) · 224 KB
/
altivec.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
//! PowerPC AltiVec intrinsics.
//!
//! AltiVec is a brandname trademarked by Freescale (previously Motorola) for
//! the standard `Category:Vector` part of the Power ISA v.2.03 specification.
//! This Category is also known as VMX (used by IBM), and "Velocity Engine" (a
//! brand name previously used by Apple).
//!
//! The references are: [POWER ISA v2.07B (for POWER8 & POWER8 with NVIDIA
//! NVlink)] and [POWER ISA v3.0B (for POWER9)].
//!
//! [POWER ISA v2.07B (for POWER8 & POWER8 with NVIDIA NVlink)]: https://ibm.box.com/s/jd5w15gz301s5b5dt375mshpq9c3lh4u
//! [POWER ISA v3.0B (for POWER9)]: https://ibm.box.com/s/1hzcwkwf8rbju5h9iyf44wm94amnlcrv
#![allow(non_camel_case_types)]
use crate::{core_arch::simd::*, intrinsics::simd::*, mem, mem::transmute};
#[cfg(test)]
use stdarch_test::assert_instr;
use super::macros::*;
types! {
#![unstable(feature = "stdarch_powerpc", issue = "111145")]
/// PowerPC-specific 128-bit wide vector of sixteen packed `i8`
pub struct vector_signed_char(16 x i8);
/// PowerPC-specific 128-bit wide vector of sixteen packed `u8`
pub struct vector_unsigned_char(16 x u8);
/// PowerPC-specific 128-bit wide vector mask of sixteen packed elements
pub struct vector_bool_char(16 x i8);
/// PowerPC-specific 128-bit wide vector of eight packed `i16`
pub struct vector_signed_short(8 x i16);
/// PowerPC-specific 128-bit wide vector of eight packed `u16`
pub struct vector_unsigned_short(8 x u16);
/// PowerPC-specific 128-bit wide vector mask of eight packed elements
pub struct vector_bool_short(8 x i16);
// pub struct vector_pixel(???);
/// PowerPC-specific 128-bit wide vector of four packed `i32`
pub struct vector_signed_int(4 x i32);
/// PowerPC-specific 128-bit wide vector of four packed `u32`
pub struct vector_unsigned_int(4 x u32);
/// PowerPC-specific 128-bit wide vector mask of four packed elements
pub struct vector_bool_int(4 x i32);
/// PowerPC-specific 128-bit wide vector of four packed `f32`
pub struct vector_float(4 x f32);
}
#[allow(improper_ctypes)]
unsafe extern "C" {
#[link_name = "llvm.ppc.altivec.lvx"]
fn lvx(p: *const i8) -> vector_unsigned_int;
#[link_name = "llvm.ppc.altivec.lvebx"]
fn lvebx(p: *const i8) -> vector_signed_char;
#[link_name = "llvm.ppc.altivec.lvehx"]
fn lvehx(p: *const i8) -> vector_signed_short;
#[link_name = "llvm.ppc.altivec.lvewx"]
fn lvewx(p: *const i8) -> vector_signed_int;
#[link_name = "llvm.ppc.altivec.lvxl"]
fn lvxl(p: *const i8) -> vector_unsigned_int;
#[link_name = "llvm.ppc.altivec.stvx"]
fn stvx(a: vector_signed_int, p: *const i8);
#[link_name = "llvm.ppc.altivec.stvebx"]
fn stvebx(a: vector_signed_char, p: *const i8);
#[link_name = "llvm.ppc.altivec.stvehx"]
fn stvehx(a: vector_signed_short, p: *const i8);
#[link_name = "llvm.ppc.altivec.stvewx"]
fn stvewx(a: vector_signed_int, p: *const i8);
#[link_name = "llvm.ppc.altivec.stvxl"]
fn stvxl(a: vector_signed_int, p: *const i8);
#[link_name = "llvm.ppc.altivec.vperm"]
fn vperm(
a: vector_signed_int,
b: vector_signed_int,
c: vector_unsigned_char,
) -> vector_signed_int;
#[link_name = "llvm.ppc.altivec.vmhaddshs"]
fn vmhaddshs(
a: vector_signed_short,
b: vector_signed_short,
c: vector_signed_short,
) -> vector_signed_short;
#[link_name = "llvm.ppc.altivec.vmhraddshs"]
fn vmhraddshs(
a: vector_signed_short,
b: vector_signed_short,
c: vector_signed_short,
) -> vector_signed_short;
#[link_name = "llvm.ppc.altivec.vmsumuhs"]
fn vmsumuhs(
a: vector_unsigned_short,
b: vector_unsigned_short,
c: vector_unsigned_int,
) -> vector_unsigned_int;
#[link_name = "llvm.ppc.altivec.vmsumshs"]
fn vmsumshs(
a: vector_signed_short,
b: vector_signed_short,
c: vector_signed_int,
) -> vector_signed_int;
#[link_name = "llvm.ppc.altivec.vmsumubm"]
fn vmsumubm(
a: vector_unsigned_char,
b: vector_unsigned_char,
c: vector_unsigned_int,
) -> vector_unsigned_int;
#[link_name = "llvm.ppc.altivec.vmsummbm"]
fn vmsummbm(
a: vector_signed_char,
b: vector_unsigned_char,
c: vector_signed_int,
) -> vector_signed_int;
#[link_name = "llvm.ppc.altivec.vmsumuhm"]
fn vmsumuhm(
a: vector_unsigned_short,
b: vector_unsigned_short,
c: vector_unsigned_int,
) -> vector_unsigned_int;
#[link_name = "llvm.ppc.altivec.vmsumshm"]
fn vmsumshm(
a: vector_signed_short,
b: vector_signed_short,
c: vector_signed_int,
) -> vector_signed_int;
#[link_name = "llvm.ppc.altivec.vnmsubfp"]
fn vnmsubfp(a: vector_float, b: vector_float, c: vector_float) -> vector_float;
#[link_name = "llvm.ppc.altivec.vsum2sws"]
fn vsum2sws(a: vector_signed_int, b: vector_signed_int) -> vector_signed_int;
#[link_name = "llvm.ppc.altivec.vsum4ubs"]
fn vsum4ubs(a: vector_unsigned_char, b: vector_unsigned_int) -> vector_unsigned_int;
#[link_name = "llvm.ppc.altivec.vsum4sbs"]
fn vsum4sbs(a: vector_signed_char, b: vector_signed_int) -> vector_signed_int;
#[link_name = "llvm.ppc.altivec.vsum4shs"]
fn vsum4shs(a: vector_signed_short, b: vector_signed_int) -> vector_signed_int;
#[link_name = "llvm.ppc.altivec.vmuleub"]
fn vmuleub(a: vector_unsigned_char, b: vector_unsigned_char) -> vector_unsigned_short;
#[link_name = "llvm.ppc.altivec.vmulesb"]
fn vmulesb(a: vector_signed_char, b: vector_signed_char) -> vector_signed_short;
#[link_name = "llvm.ppc.altivec.vmuleuh"]
fn vmuleuh(a: vector_unsigned_short, b: vector_unsigned_short) -> vector_unsigned_int;
#[link_name = "llvm.ppc.altivec.vmulesh"]
fn vmulesh(a: vector_signed_short, b: vector_signed_short) -> vector_signed_int;
#[link_name = "llvm.ppc.altivec.vmuloub"]
fn vmuloub(a: vector_unsigned_char, b: vector_unsigned_char) -> vector_unsigned_short;
#[link_name = "llvm.ppc.altivec.vmulosb"]
fn vmulosb(a: vector_signed_char, b: vector_signed_char) -> vector_signed_short;
#[link_name = "llvm.ppc.altivec.vmulouh"]
fn vmulouh(a: vector_unsigned_short, b: vector_unsigned_short) -> vector_unsigned_int;
#[link_name = "llvm.ppc.altivec.vmulosh"]
fn vmulosh(a: vector_signed_short, b: vector_signed_short) -> vector_signed_int;
#[link_name = "llvm.smax.v16i8"]
fn vmaxsb(a: vector_signed_char, b: vector_signed_char) -> vector_signed_char;
#[link_name = "llvm.smax.v8i16"]
fn vmaxsh(a: vector_signed_short, b: vector_signed_short) -> vector_signed_short;
#[link_name = "llvm.smax.v4i32"]
fn vmaxsw(a: vector_signed_int, b: vector_signed_int) -> vector_signed_int;
#[link_name = "llvm.umax.v16i8"]
fn vmaxub(a: vector_unsigned_char, b: vector_unsigned_char) -> vector_unsigned_char;
#[link_name = "llvm.umax.v8i16"]
fn vmaxuh(a: vector_unsigned_short, b: vector_unsigned_short) -> vector_unsigned_short;
#[link_name = "llvm.umax.v4i32"]
fn vmaxuw(a: vector_unsigned_int, b: vector_unsigned_int) -> vector_unsigned_int;
#[link_name = "llvm.smin.v16i8"]
fn vminsb(a: vector_signed_char, b: vector_signed_char) -> vector_signed_char;
#[link_name = "llvm.smin.v8i16"]
fn vminsh(a: vector_signed_short, b: vector_signed_short) -> vector_signed_short;
#[link_name = "llvm.smin.v4i32"]
fn vminsw(a: vector_signed_int, b: vector_signed_int) -> vector_signed_int;
#[link_name = "llvm.umin.v16i8"]
fn vminub(a: vector_unsigned_char, b: vector_unsigned_char) -> vector_unsigned_char;
#[link_name = "llvm.umin.v8i16"]
fn vminuh(a: vector_unsigned_short, b: vector_unsigned_short) -> vector_unsigned_short;
#[link_name = "llvm.umin.v4i32"]
fn vminuw(a: vector_unsigned_int, b: vector_unsigned_int) -> vector_unsigned_int;
#[link_name = "llvm.ppc.altivec.vsubsbs"]
fn vsubsbs(a: vector_signed_char, b: vector_signed_char) -> vector_signed_char;
#[link_name = "llvm.ppc.altivec.vsubshs"]
fn vsubshs(a: vector_signed_short, b: vector_signed_short) -> vector_signed_short;
#[link_name = "llvm.ppc.altivec.vsubsws"]
fn vsubsws(a: vector_signed_int, b: vector_signed_int) -> vector_signed_int;
#[link_name = "llvm.ppc.altivec.vsububs"]
fn vsububs(a: vector_unsigned_char, b: vector_unsigned_char) -> vector_unsigned_char;
#[link_name = "llvm.ppc.altivec.vsubuhs"]
fn vsubuhs(a: vector_unsigned_short, b: vector_unsigned_short) -> vector_unsigned_short;
#[link_name = "llvm.ppc.altivec.vsubuws"]
fn vsubuws(a: vector_unsigned_int, b: vector_unsigned_int) -> vector_unsigned_int;
#[link_name = "llvm.ppc.altivec.vsubcuw"]
fn vsubcuw(a: vector_unsigned_int, b: vector_unsigned_int) -> vector_unsigned_int;
#[link_name = "llvm.ppc.altivec.vaddcuw"]
fn vaddcuw(a: vector_unsigned_int, b: vector_unsigned_int) -> vector_unsigned_int;
#[link_name = "llvm.ppc.altivec.vaddsbs"]
fn vaddsbs(a: vector_signed_char, b: vector_signed_char) -> vector_signed_char;
#[link_name = "llvm.ppc.altivec.vaddshs"]
fn vaddshs(a: vector_signed_short, b: vector_signed_short) -> vector_signed_short;
#[link_name = "llvm.ppc.altivec.vaddsws"]
fn vaddsws(a: vector_signed_int, b: vector_signed_int) -> vector_signed_int;
#[link_name = "llvm.ppc.altivec.vaddubs"]
fn vaddubs(a: vector_unsigned_char, b: vector_unsigned_char) -> vector_unsigned_char;
#[link_name = "llvm.ppc.altivec.vadduhs"]
fn vadduhs(a: vector_unsigned_short, b: vector_unsigned_short) -> vector_unsigned_short;
#[link_name = "llvm.ppc.altivec.vadduws"]
fn vadduws(a: vector_unsigned_int, b: vector_unsigned_int) -> vector_unsigned_int;
#[link_name = "llvm.ppc.altivec.vavgsb"]
fn vavgsb(a: vector_signed_char, b: vector_signed_char) -> vector_signed_char;
#[link_name = "llvm.ppc.altivec.vavgsh"]
fn vavgsh(a: vector_signed_short, b: vector_signed_short) -> vector_signed_short;
#[link_name = "llvm.ppc.altivec.vavgsw"]
fn vavgsw(a: vector_signed_int, b: vector_signed_int) -> vector_signed_int;
#[link_name = "llvm.ppc.altivec.vavgub"]
fn vavgub(a: vector_unsigned_char, b: vector_unsigned_char) -> vector_unsigned_char;
#[link_name = "llvm.ppc.altivec.vavguh"]
fn vavguh(a: vector_unsigned_short, b: vector_unsigned_short) -> vector_unsigned_short;
#[link_name = "llvm.ppc.altivec.vavguw"]
fn vavguw(a: vector_unsigned_int, b: vector_unsigned_int) -> vector_unsigned_int;
#[link_name = "llvm.ppc.altivec.vcmpbfp"]
fn vcmpbfp(a: vector_float, b: vector_float) -> vector_signed_int;
#[link_name = "llvm.ppc.altivec.vcmpequb"]
fn vcmpequb(a: vector_unsigned_char, b: vector_unsigned_char) -> vector_bool_char;
#[link_name = "llvm.ppc.altivec.vcmpequh"]
fn vcmpequh(a: vector_unsigned_short, b: vector_unsigned_short) -> vector_bool_short;
#[link_name = "llvm.ppc.altivec.vcmpequw"]
fn vcmpequw(a: vector_unsigned_int, b: vector_unsigned_int) -> vector_bool_int;
#[link_name = "llvm.ppc.altivec.vcmpneb"]
fn vcmpneb(a: vector_signed_char, b: vector_signed_char) -> vector_bool_char;
#[link_name = "llvm.ppc.altivec.vcmpneh"]
fn vcmpneh(a: vector_signed_short, b: vector_signed_short) -> vector_bool_short;
#[link_name = "llvm.ppc.altivec.vcmpnew"]
fn vcmpnew(a: vector_signed_int, b: vector_signed_int) -> vector_bool_int;
#[link_name = "llvm.ppc.altivec.vcmpgefp"]
fn vcmpgefp(a: vector_float, b: vector_float) -> vector_bool_int;
#[link_name = "llvm.ppc.altivec.vcmpgtub"]
fn vcmpgtub(a: vector_unsigned_char, b: vector_unsigned_char) -> vector_bool_char;
#[link_name = "llvm.ppc.altivec.vcmpgtuh"]
fn vcmpgtuh(a: vector_unsigned_short, b: vector_unsigned_short) -> vector_bool_short;
#[link_name = "llvm.ppc.altivec.vcmpgtuw"]
fn vcmpgtuw(a: vector_unsigned_int, b: vector_unsigned_int) -> vector_bool_int;
#[link_name = "llvm.ppc.altivec.vcmpgtsb"]
fn vcmpgtsb(a: vector_signed_char, b: vector_signed_char) -> vector_bool_char;
#[link_name = "llvm.ppc.altivec.vcmpgtsh"]
fn vcmpgtsh(a: vector_signed_short, b: vector_signed_short) -> vector_bool_short;
#[link_name = "llvm.ppc.altivec.vcmpgtsw"]
fn vcmpgtsw(a: vector_signed_int, b: vector_signed_int) -> vector_bool_int;
#[link_name = "llvm.ppc.altivec.vexptefp"]
fn vexptefp(a: vector_float) -> vector_float;
#[link_name = "llvm.ppc.altivec.vcmpequb.p"]
fn vcmpequb_p(cr: i32, a: vector_unsigned_char, b: vector_unsigned_char) -> i32;
#[link_name = "llvm.ppc.altivec.vcmpequh.p"]
fn vcmpequh_p(cr: i32, a: vector_unsigned_short, b: vector_unsigned_short) -> i32;
#[link_name = "llvm.ppc.altivec.vcmpequw.p"]
fn vcmpequw_p(cr: i32, a: vector_unsigned_int, b: vector_unsigned_int) -> i32;
#[link_name = "llvm.ppc.altivec.vcmpeqfp.p"]
fn vcmpeqfp_p(cr: i32, a: vector_float, b: vector_float) -> i32;
#[link_name = "llvm.ppc.altivec.vcmpgtub.p"]
fn vcmpgtub_p(cr: i32, a: vector_unsigned_char, b: vector_unsigned_char) -> i32;
#[link_name = "llvm.ppc.altivec.vcmpgtuh.p"]
fn vcmpgtuh_p(cr: i32, a: vector_unsigned_short, b: vector_unsigned_short) -> i32;
#[link_name = "llvm.ppc.altivec.vcmpgtuw.p"]
fn vcmpgtuw_p(cr: i32, a: vector_unsigned_int, b: vector_unsigned_int) -> i32;
#[link_name = "llvm.ppc.altivec.vcmpgtsb.p"]
fn vcmpgtsb_p(cr: i32, a: vector_signed_char, b: vector_signed_char) -> i32;
#[link_name = "llvm.ppc.altivec.vcmpgtsh.p"]
fn vcmpgtsh_p(cr: i32, a: vector_signed_short, b: vector_signed_short) -> i32;
#[link_name = "llvm.ppc.altivec.vcmpgtsw.p"]
fn vcmpgtsw_p(cr: i32, a: vector_signed_int, b: vector_signed_int) -> i32;
#[link_name = "llvm.ppc.altivec.vcmpgefp.p"]
fn vcmpgefp_p(cr: i32, a: vector_float, b: vector_float) -> i32;
#[link_name = "llvm.ppc.altivec.vcmpgtfp.p"]
fn vcmpgtfp_p(cr: i32, a: vector_float, b: vector_float) -> i32;
#[link_name = "llvm.ppc.altivec.vcmpbfp.p"]
fn vcmpbfp_p(cr: i32, a: vector_float, b: vector_float) -> i32;
#[link_name = "llvm.ppc.altivec.vcfsx"]
fn vcfsx(a: vector_signed_int, b: i32) -> vector_float;
#[link_name = "llvm.ppc.altivec.vcfux"]
fn vcfux(a: vector_unsigned_int, b: i32) -> vector_float;
#[link_name = "llvm.ppc.altivec.vctsxs"]
fn vctsxs(a: vector_float, b: i32) -> vector_signed_int;
#[link_name = "llvm.ppc.altivec.vctuxs"]
fn vctuxs(a: vector_float, b: i32) -> vector_unsigned_int;
#[link_name = "llvm.ppc.altivec.vpkshss"]
fn vpkshss(a: vector_signed_short, b: vector_signed_short) -> vector_signed_char;
#[link_name = "llvm.ppc.altivec.vpkshus"]
fn vpkshus(a: vector_signed_short, b: vector_signed_short) -> vector_unsigned_char;
#[link_name = "llvm.ppc.altivec.vpkuhus"]
fn vpkuhus(a: vector_unsigned_short, b: vector_unsigned_short) -> vector_unsigned_char;
#[link_name = "llvm.ppc.altivec.vpkswss"]
fn vpkswss(a: vector_signed_int, b: vector_signed_int) -> vector_signed_short;
#[link_name = "llvm.ppc.altivec.vpkswus"]
fn vpkswus(a: vector_signed_int, b: vector_signed_int) -> vector_unsigned_short;
#[link_name = "llvm.ppc.altivec.vpkuwus"]
fn vpkuwus(a: vector_unsigned_int, b: vector_unsigned_int) -> vector_unsigned_short;
#[link_name = "llvm.ppc.altivec.vupkhsb"]
fn vupkhsb(a: vector_signed_char) -> vector_signed_short;
#[link_name = "llvm.ppc.altivec.vupklsb"]
fn vupklsb(a: vector_signed_char) -> vector_signed_short;
#[link_name = "llvm.ppc.altivec.vupkhsh"]
fn vupkhsh(a: vector_signed_short) -> vector_signed_int;
#[link_name = "llvm.ppc.altivec.vupklsh"]
fn vupklsh(a: vector_signed_short) -> vector_signed_int;
#[link_name = "llvm.ppc.altivec.mfvscr"]
fn mfvscr() -> vector_unsigned_short;
#[link_name = "llvm.ppc.altivec.vlogefp"]
fn vlogefp(a: vector_float) -> vector_float;
#[link_name = "llvm.ppc.altivec.sll"]
fn vsl(a: vector_signed_int, b: vector_signed_int) -> vector_signed_int;
#[link_name = "llvm.ppc.altivec.slo"]
fn vslo(a: vector_signed_int, b: vector_signed_int) -> vector_signed_int;
#[link_name = "llvm.ppc.altivec.srab"]
fn vsrab(a: vector_signed_char, b: vector_unsigned_char) -> vector_signed_char;
#[link_name = "llvm.ppc.altivec.srah"]
fn vsrah(a: vector_signed_short, b: vector_unsigned_short) -> vector_signed_short;
#[link_name = "llvm.ppc.altivec.sraw"]
fn vsraw(a: vector_signed_int, b: vector_unsigned_int) -> vector_signed_int;
#[link_name = "llvm.ppc.altivec.srl"]
fn vsr(a: vector_signed_int, b: vector_signed_int) -> vector_signed_int;
#[link_name = "llvm.ppc.altivec.sro"]
fn vsro(a: vector_signed_int, b: vector_signed_int) -> vector_signed_int;
#[link_name = "llvm.ppc.altivec.slv"]
fn vslv(a: vector_unsigned_char, b: vector_unsigned_char) -> vector_unsigned_char;
#[link_name = "llvm.ppc.altivec.srv"]
fn vsrv(a: vector_unsigned_char, b: vector_unsigned_char) -> vector_unsigned_char;
#[link_name = "llvm.fshl.v16i8"]
fn fshlb(
a: vector_unsigned_char,
b: vector_unsigned_char,
c: vector_unsigned_char,
) -> vector_unsigned_char;
#[link_name = "llvm.fshl.v8i16"]
fn fshlh(
a: vector_unsigned_short,
b: vector_unsigned_short,
c: vector_unsigned_short,
) -> vector_unsigned_short;
#[link_name = "llvm.fshl.v4i32"]
fn fshlw(
a: vector_unsigned_int,
b: vector_unsigned_int,
c: vector_unsigned_int,
) -> vector_unsigned_int;
#[link_name = "llvm.nearbyint.v4f32"]
fn vrfin(a: vector_float) -> vector_float;
}
impl_from! { i8x16, u8x16, i16x8, u16x8, i32x4, u32x4, f32x4 }
impl_neg! { i8x16 : 0 }
impl_neg! { i16x8 : 0 }
impl_neg! { i32x4 : 0 }
impl_neg! { f32x4 : 0f32 }
#[macro_use]
mod sealed {
use super::*;
#[unstable(feature = "stdarch_powerpc", issue = "111145")]
pub trait VectorInsert {
type Scalar;
unsafe fn vec_insert<const IDX: u32>(self, s: Self::Scalar) -> Self;
}
const fn idx_in_vec<T, const IDX: u32>() -> u32 {
IDX & (16 / crate::mem::size_of::<T>() as u32)
}
macro_rules! impl_vec_insert {
($ty:ident) => {
#[unstable(feature = "stdarch_powerpc", issue = "111145")]
impl VectorInsert for t_t_l!($ty) {
type Scalar = $ty;
#[inline]
#[target_feature(enable = "altivec")]
unsafe fn vec_insert<const IDX: u32>(self, s: Self::Scalar) -> Self {
simd_insert(self, const { idx_in_vec::<Self::Scalar, IDX>() }, s)
}
}
};
}
impl_vec_insert! { i8 }
impl_vec_insert! { u8 }
impl_vec_insert! { i16 }
impl_vec_insert! { u16 }
impl_vec_insert! { i32 }
impl_vec_insert! { u32 }
impl_vec_insert! { f32 }
#[unstable(feature = "stdarch_powerpc", issue = "111145")]
pub trait VectorExtract {
type Scalar;
unsafe fn vec_extract<const IDX: u32>(self) -> Self::Scalar;
}
macro_rules! impl_vec_extract {
($ty:ident) => {
#[unstable(feature = "stdarch_powerpc", issue = "111145")]
impl VectorExtract for t_t_l!($ty) {
type Scalar = $ty;
#[inline]
#[target_feature(enable = "altivec")]
unsafe fn vec_extract<const IDX: u32>(self) -> Self::Scalar {
simd_extract(self, const { idx_in_vec::<Self::Scalar, IDX>() })
}
}
};
}
impl_vec_extract! { i8 }
impl_vec_extract! { u8 }
impl_vec_extract! { i16 }
impl_vec_extract! { u16 }
impl_vec_extract! { i32 }
impl_vec_extract! { u32 }
impl_vec_extract! { f32 }
macro_rules! impl_vec_cmp {
([$Trait:ident $m:ident] ($b:ident, $h:ident, $w:ident)) => {
impl_vec_cmp! { [$Trait $m] ($b, $b, $h, $h, $w, $w) }
};
([$Trait:ident $m:ident] ($ub:ident, $sb:ident, $uh:ident, $sh:ident, $uw:ident, $sw:ident)) => {
impl_vec_trait!{ [$Trait $m] $ub (vector_unsigned_char, vector_unsigned_char) -> vector_bool_char }
impl_vec_trait!{ [$Trait $m] $sb (vector_signed_char, vector_signed_char) -> vector_bool_char }
impl_vec_trait!{ [$Trait $m] $uh (vector_unsigned_short, vector_unsigned_short) -> vector_bool_short }
impl_vec_trait!{ [$Trait $m] $sh (vector_signed_short, vector_signed_short) -> vector_bool_short }
impl_vec_trait!{ [$Trait $m] $uw (vector_unsigned_int, vector_unsigned_int) -> vector_bool_int }
impl_vec_trait!{ [$Trait $m] $sw (vector_signed_int, vector_signed_int) -> vector_bool_int }
}
}
macro_rules! impl_vec_any_all {
([$Trait:ident $m:ident] ($b:ident, $h:ident, $w:ident)) => {
impl_vec_any_all! { [$Trait $m] ($b, $b, $h, $h, $w, $w) }
};
([$Trait:ident $m:ident] ($ub:ident, $sb:ident, $uh:ident, $sh:ident, $uw:ident, $sw:ident)) => {
impl_vec_trait!{ [$Trait $m] $ub (vector_unsigned_char, vector_unsigned_char) -> bool }
impl_vec_trait!{ [$Trait $m] $sb (vector_signed_char, vector_signed_char) -> bool }
impl_vec_trait!{ [$Trait $m] $uh (vector_unsigned_short, vector_unsigned_short) -> bool }
impl_vec_trait!{ [$Trait $m] $sh (vector_signed_short, vector_signed_short) -> bool }
impl_vec_trait!{ [$Trait $m] $uw (vector_unsigned_int, vector_unsigned_int) -> bool }
impl_vec_trait!{ [$Trait $m] $sw (vector_signed_int, vector_signed_int) -> bool }
}
}
#[unstable(feature = "stdarch_powerpc", issue = "111145")]
pub trait VectorLd {
type Result;
unsafe fn vec_ld(self, off: isize) -> Self::Result;
unsafe fn vec_ldl(self, off: isize) -> Self::Result;
}
macro_rules! impl_vec_ld {
($fun:ident $fun_lru:ident $ty:ident) => {
#[inline]
#[target_feature(enable = "altivec")]
#[cfg_attr(test, assert_instr(lvx))]
pub unsafe fn $fun(off: isize, p: *const $ty) -> t_t_l!($ty) {
let addr = (p as *const i8).offset(off);
transmute(lvx(addr))
}
#[inline]
#[target_feature(enable = "altivec")]
#[cfg_attr(test, assert_instr(lvxl))]
pub unsafe fn $fun_lru(off: isize, p: *const $ty) -> t_t_l!($ty) {
let addr = (p as *const i8).offset(off);
transmute(lvxl(addr))
}
#[unstable(feature = "stdarch_powerpc", issue = "111145")]
impl VectorLd for *const $ty {
type Result = t_t_l!($ty);
#[inline]
#[target_feature(enable = "altivec")]
unsafe fn vec_ld(self, off: isize) -> Self::Result {
$fun(off, self)
}
#[inline]
#[target_feature(enable = "altivec")]
unsafe fn vec_ldl(self, off: isize) -> Self::Result {
$fun_lru(off, self)
}
}
};
}
impl_vec_ld! { vec_ld_u8 vec_ldl_u8 u8 }
impl_vec_ld! { vec_ld_i8 vec_ldl_i8 i8 }
impl_vec_ld! { vec_ld_u16 vec_ldl_u16 u16 }
impl_vec_ld! { vec_ld_i16 vec_ldl_i16 i16 }
impl_vec_ld! { vec_ld_u32 vec_ldl_u32 u32 }
impl_vec_ld! { vec_ld_i32 vec_ldl_i32 i32 }
impl_vec_ld! { vec_ld_f32 vec_ldl_f32 f32 }
#[unstable(feature = "stdarch_powerpc", issue = "111145")]
pub trait VectorLde {
type Result;
unsafe fn vec_lde(self, a: isize) -> Self::Result;
}
macro_rules! impl_vec_lde {
($fun:ident $instr:ident $ty:ident) => {
#[inline]
#[target_feature(enable = "altivec")]
#[cfg_attr(test, assert_instr($instr))]
pub unsafe fn $fun(a: isize, b: *const $ty) -> t_t_l!($ty) {
let addr = (b as *const i8).offset(a);
transmute($instr(addr))
}
#[unstable(feature = "stdarch_powerpc", issue = "111145")]
impl VectorLde for *const $ty {
type Result = t_t_l!($ty);
#[inline]
#[target_feature(enable = "altivec")]
unsafe fn vec_lde(self, a: isize) -> Self::Result {
$fun(a, self)
}
}
};
}
impl_vec_lde! { vec_lde_u8 lvebx u8 }
impl_vec_lde! { vec_lde_i8 lvebx i8 }
impl_vec_lde! { vec_lde_u16 lvehx u16 }
impl_vec_lde! { vec_lde_i16 lvehx i16 }
impl_vec_lde! { vec_lde_u32 lvewx u32 }
impl_vec_lde! { vec_lde_i32 lvewx i32 }
impl_vec_lde! { vec_lde_f32 lvewx f32 }
#[unstable(feature = "stdarch_powerpc", issue = "111145")]
pub trait VectorSt {
type Target;
unsafe fn vec_st(self, off: isize, p: Self::Target);
unsafe fn vec_stl(self, off: isize, p: Self::Target);
}
macro_rules! impl_vec_st {
($fun:ident $fun_lru:ident $ty:ident) => {
#[inline]
#[target_feature(enable = "altivec")]
#[cfg_attr(test, assert_instr(stvx))]
pub unsafe fn $fun(a: t_t_l!($ty), off: isize, p: *const $ty) {
let addr = (p as *const i8).offset(off);
stvx(transmute(a), addr)
}
#[inline]
#[target_feature(enable = "altivec")]
#[cfg_attr(test, assert_instr(stvxl))]
pub unsafe fn $fun_lru(a: t_t_l!($ty), off: isize, p: *const $ty) {
let addr = (p as *const i8).offset(off as isize);
stvxl(transmute(a), addr)
}
#[unstable(feature = "stdarch_powerpc", issue = "111145")]
impl VectorSt for t_t_l!($ty) {
type Target = *const $ty;
#[inline]
#[target_feature(enable = "altivec")]
unsafe fn vec_st(self, off: isize, p: Self::Target) {
$fun(self, off, p)
}
#[inline]
#[target_feature(enable = "altivec")]
unsafe fn vec_stl(self, off: isize, p: Self::Target) {
$fun(self, off, p)
}
}
};
}
impl_vec_st! { vec_st_u8 vec_stl_u8 u8 }
impl_vec_st! { vec_st_i8 vec_stl_i8 i8 }
impl_vec_st! { vec_st_u16 vec_stl_u16 u16 }
impl_vec_st! { vec_st_i16 vec_stl_i16 i16 }
impl_vec_st! { vec_st_u32 vec_stl_u32 u32 }
impl_vec_st! { vec_st_i32 vec_stl_i32 i32 }
impl_vec_st! { vec_st_f32 vec_stl_f32 f32 }
#[unstable(feature = "stdarch_powerpc", issue = "111145")]
pub trait VectorSte {
type Target;
unsafe fn vec_ste(self, off: isize, p: Self::Target);
}
macro_rules! impl_vec_ste {
($fun:ident $instr:ident $ty:ident) => {
#[inline]
#[target_feature(enable = "altivec")]
#[cfg_attr(test, assert_instr($instr))]
pub unsafe fn $fun(a: t_t_l!($ty), off: isize, p: *const $ty) {
let addr = (p as *const i8).offset(off);
$instr(transmute(a), addr)
}
#[unstable(feature = "stdarch_powerpc", issue = "111145")]
impl VectorSte for t_t_l!($ty) {
type Target = *const $ty;
#[inline]
#[target_feature(enable = "altivec")]
unsafe fn vec_ste(self, off: isize, p: Self::Target) {
$fun(self, off, p)
}
}
};
}
impl_vec_ste! { vec_ste_u8 stvebx u8 }
impl_vec_ste! { vec_ste_i8 stvebx i8 }
impl_vec_ste! { vec_ste_u16 stvehx u16 }
impl_vec_ste! { vec_ste_i16 stvehx i16 }
impl_vec_ste! { vec_ste_u32 stvewx u32 }
impl_vec_ste! { vec_ste_i32 stvewx i32 }
impl_vec_ste! { vec_ste_f32 stvewx f32 }
#[unstable(feature = "stdarch_powerpc", issue = "111145")]
pub trait VectorXl {
type Result;
unsafe fn vec_xl(self, a: isize) -> Self::Result;
}
macro_rules! impl_vec_xl {
($fun:ident $notpwr9:ident / $pwr9:ident $ty:ident) => {
#[inline]
#[target_feature(enable = "altivec")]
#[cfg_attr(
all(test, not(target_feature = "power9-altivec")),
assert_instr($notpwr9)
)]
#[cfg_attr(all(test, target_feature = "power9-altivec"), assert_instr($pwr9))]
pub unsafe fn $fun(a: isize, b: *const $ty) -> t_t_l!($ty) {
let addr = (b as *const u8).offset(a);
let mut r = mem::MaybeUninit::uninit();
crate::ptr::copy_nonoverlapping(
addr,
r.as_mut_ptr() as *mut u8,
mem::size_of::<t_t_l!($ty)>(),
);
r.assume_init()
}
#[unstable(feature = "stdarch_powerpc", issue = "111145")]
impl VectorXl for *const $ty {
type Result = t_t_l!($ty);
#[inline]
#[target_feature(enable = "altivec")]
unsafe fn vec_xl(self, a: isize) -> Self::Result {
$fun(a, self)
}
}
};
}
impl_vec_xl! { vec_xl_i8 lxvd2x / lxv i8 }
impl_vec_xl! { vec_xl_u8 lxvd2x / lxv u8 }
impl_vec_xl! { vec_xl_i16 lxvd2x / lxv i16 }
impl_vec_xl! { vec_xl_u16 lxvd2x / lxv u16 }
impl_vec_xl! { vec_xl_i32 lxvd2x / lxv i32 }
impl_vec_xl! { vec_xl_u32 lxvd2x / lxv u32 }
impl_vec_xl! { vec_xl_f32 lxvd2x / lxv f32 }
#[unstable(feature = "stdarch_powerpc", issue = "111145")]
pub trait VectorXst {
type Out;
unsafe fn vec_xst(self, a: isize, p: Self::Out);
}
macro_rules! impl_vec_xst {
($fun:ident $notpwr9:ident / $pwr9:ident $ty:ident) => {
#[inline]
#[target_feature(enable = "altivec")]
#[cfg_attr(
all(test, not(target_feature = "power9-altivec")),
assert_instr($notpwr9)
)]
#[cfg_attr(all(test, target_feature = "power9-altivec"), assert_instr($pwr9))]
pub unsafe fn $fun(s: t_t_l!($ty), a: isize, b: *mut $ty) {
let addr = (b as *mut u8).offset(a);
crate::ptr::copy_nonoverlapping(
&s as *const _ as *const u8,
addr,
mem::size_of::<t_t_l!($ty)>(),
);
}
#[unstable(feature = "stdarch_powerpc", issue = "111145")]
impl VectorXst for t_t_l!($ty) {
type Out = *mut $ty;
#[inline]
#[target_feature(enable = "altivec")]
unsafe fn vec_xst(self, a: isize, b: Self::Out) {
$fun(self, a, b)
}
}
};
}
impl_vec_xst! { vec_xst_i8 stxvd2x / stxv i8 }
impl_vec_xst! { vec_xst_u8 stxvd2x / stxv u8 }
impl_vec_xst! { vec_xst_i16 stxvd2x / stxv i16 }
impl_vec_xst! { vec_xst_u16 stxvd2x / stxv u16 }
impl_vec_xst! { vec_xst_i32 stxvd2x / stxv i32 }
impl_vec_xst! { vec_xst_u32 stxvd2x / stxv u32 }
impl_vec_xst! { vec_xst_f32 stxvd2x / stxv f32 }
test_impl! { vec_floor(a: vector_float) -> vector_float [ simd_floor, vrfim / xvrspim ] }
test_impl! { vec_vexptefp(a: vector_float) -> vector_float [ vexptefp, vexptefp ] }
test_impl! { vec_vcmpgtub(a: vector_unsigned_char, b: vector_unsigned_char) -> vector_bool_char [ vcmpgtub, vcmpgtub ] }
test_impl! { vec_vcmpgtuh(a: vector_unsigned_short, b: vector_unsigned_short) -> vector_bool_short [ vcmpgtuh, vcmpgtuh ] }
test_impl! { vec_vcmpgtuw(a: vector_unsigned_int, b: vector_unsigned_int) -> vector_bool_int [ vcmpgtuw, vcmpgtuw ] }
test_impl! { vec_vcmpgtsb(a: vector_signed_char, b: vector_signed_char) -> vector_bool_char [ vcmpgtsb, vcmpgtsb ] }
test_impl! { vec_vcmpgtsh(a: vector_signed_short, b: vector_signed_short) -> vector_bool_short [ vcmpgtsh, vcmpgtsh ] }
test_impl! { vec_vcmpgtsw(a: vector_signed_int, b: vector_signed_int) -> vector_bool_int [ vcmpgtsw, vcmpgtsw ] }
#[unstable(feature = "stdarch_powerpc", issue = "111145")]
pub trait VectorCmpGt<Other> {
type Result;
unsafe fn vec_cmpgt(self, b: Other) -> Self::Result;
}
impl_vec_cmp! { [VectorCmpGt vec_cmpgt] ( vec_vcmpgtub, vec_vcmpgtsb, vec_vcmpgtuh, vec_vcmpgtsh, vec_vcmpgtuw, vec_vcmpgtsw ) }
test_impl! { vec_vcmpgefp(a: vector_float, b: vector_float) -> vector_bool_int [ vcmpgefp, vcmpgefp ] }
test_impl! { vec_vcmpequb(a: vector_unsigned_char, b: vector_unsigned_char) -> vector_bool_char [ vcmpequb, vcmpequb ] }
test_impl! { vec_vcmpequh(a: vector_unsigned_short, b: vector_unsigned_short) -> vector_bool_short [ vcmpequh, vcmpequh ] }
test_impl! { vec_vcmpequw(a: vector_unsigned_int, b: vector_unsigned_int) -> vector_bool_int [ vcmpequw, vcmpequw ] }
#[unstable(feature = "stdarch_powerpc", issue = "111145")]
pub trait VectorCmpEq<Other> {
type Result;
unsafe fn vec_cmpeq(self, b: Other) -> Self::Result;
}
impl_vec_cmp! { [VectorCmpEq vec_cmpeq] (vec_vcmpequb, vec_vcmpequh, vec_vcmpequw) }
macro_rules! impl_cmpne {
($fun:ident ($ty:ident) -> $r:ident $([ $pwr9:ident ])? ) => {
#[inline]
#[target_feature(enable = "altivec")]
$( #[cfg_attr(all(test, target_feature = "power9-altivec"), assert_instr($pwr9))] )?
unsafe fn $fun(a: $ty, b: $ty) -> $r {
$( if cfg!(target_feature = "power9-altivec") {
transmute($pwr9(transmute(a), transmute(b)))
} else )? {
let zero = transmute(i32x4::new(0, 0, 0, 0));
vec_nor(vec_cmpeq(a, b), zero)
}
}
};
}
impl_cmpne! { vec_vcmpneb(vector_signed_char) -> vector_bool_char [ vcmpneb ] }
impl_cmpne! { vec_vcmpneh(vector_signed_short) -> vector_bool_short [ vcmpneh ] }
impl_cmpne! { vec_vcmpnew(vector_signed_int) -> vector_bool_int [ vcmpnew ] }
#[unstable(feature = "stdarch_powerpc", issue = "111145")]
pub trait VectorCmpNe<Other> {
type Result;
unsafe fn vec_cmpne(self, b: Other) -> Self::Result;
}
impl_vec_cmp! { [VectorCmpNe vec_cmpne] (vec_vcmpneb, vec_vcmpneh, vec_vcmpnew) }
test_impl! { vec_vcmpbfp(a: vector_float, b: vector_float) -> vector_signed_int [vcmpbfp, vcmpbfp] }
#[inline]
#[target_feature(enable = "altivec")]
#[cfg_attr(test, assert_instr(vcmpequb.))]
unsafe fn vcmpequb_all(a: vector_unsigned_char, b: vector_unsigned_char) -> bool {
vcmpequb_p(2, a, b) != 0
}
#[inline]
#[target_feature(enable = "altivec")]
#[cfg_attr(test, assert_instr(vcmpequb.))]
unsafe fn vcmpequb_any(a: vector_unsigned_char, b: vector_unsigned_char) -> bool {
vcmpequb_p(1, a, b) != 0
}
#[inline]
#[target_feature(enable = "altivec")]
#[cfg_attr(test, assert_instr(vcmpequh.))]
unsafe fn vcmpequh_all(a: vector_unsigned_short, b: vector_unsigned_short) -> bool {
vcmpequh_p(2, a, b) != 0
}
#[inline]
#[target_feature(enable = "altivec")]
#[cfg_attr(test, assert_instr(vcmpequh.))]
unsafe fn vcmpequh_any(a: vector_unsigned_short, b: vector_unsigned_short) -> bool {
vcmpequh_p(1, a, b) != 0
}
#[inline]
#[target_feature(enable = "altivec")]
#[cfg_attr(test, assert_instr(vcmpequw.))]
unsafe fn vcmpequw_all(a: vector_unsigned_int, b: vector_unsigned_int) -> bool {
vcmpequw_p(2, a, b) != 0
}
#[inline]
#[target_feature(enable = "altivec")]
#[cfg_attr(test, assert_instr(vcmpequw.))]
unsafe fn vcmpequw_any(a: vector_unsigned_int, b: vector_unsigned_int) -> bool {
vcmpequw_p(1, a, b) != 0
}
#[unstable(feature = "stdarch_powerpc", issue = "111145")]
pub trait VectorAllEq<Other> {
type Result;
unsafe fn vec_all_eq(self, b: Other) -> Self::Result;
}
impl_vec_any_all! { [VectorAllEq vec_all_eq] (vcmpequb_all, vcmpequh_all, vcmpequw_all) }
// TODO: vsx encoding
#[inline]
#[target_feature(enable = "altivec")]
#[cfg_attr(test, assert_instr(vcmpeqfp.))]
unsafe fn vcmpeqfp_all(a: vector_float, b: vector_float) -> bool {
vcmpeqfp_p(2, a, b) != 0
}
#[unstable(feature = "stdarch_powerpc", issue = "111145")]
impl VectorAllEq<vector_float> for vector_float {
type Result = bool;
#[inline]
unsafe fn vec_all_eq(self, b: vector_float) -> Self::Result {
vcmpeqfp_all(self, b)
}
}
#[unstable(feature = "stdarch_powerpc", issue = "111145")]
pub trait VectorAnyEq<Other> {
type Result;
unsafe fn vec_any_eq(self, b: Other) -> Self::Result;
}
impl_vec_any_all! { [VectorAnyEq vec_any_eq] (vcmpequb_any, vcmpequh_any, vcmpequw_any) }
#[inline]
#[target_feature(enable = "altivec")]
#[cfg_attr(test, assert_instr(vcmpeqfp.))]
unsafe fn vcmpeqfp_any(a: vector_float, b: vector_float) -> bool {
vcmpeqfp_p(1, a, b) != 0
}
#[unstable(feature = "stdarch_powerpc", issue = "111145")]
impl VectorAnyEq<vector_float> for vector_float {
type Result = bool;
#[inline]
unsafe fn vec_any_eq(self, b: vector_float) -> Self::Result {
vcmpeqfp_any(self, b)
}
}
// All/Any GreaterEqual
#[inline]
#[target_feature(enable = "altivec")]
#[cfg_attr(test, assert_instr(vcmpgtsb.))]
unsafe fn vcmpgesb_all(a: vector_signed_char, b: vector_signed_char) -> bool {
vcmpgtsb_p(0, b, a) != 0
}
#[inline]
#[target_feature(enable = "altivec")]
#[cfg_attr(test, assert_instr(vcmpgtsb.))]
unsafe fn vcmpgesb_any(a: vector_signed_char, b: vector_signed_char) -> bool {
vcmpgtsb_p(3, b, a) != 0
}
#[inline]
#[target_feature(enable = "altivec")]
#[cfg_attr(test, assert_instr(vcmpgtsh.))]
unsafe fn vcmpgesh_all(a: vector_signed_short, b: vector_signed_short) -> bool {
vcmpgtsh_p(0, b, a) != 0
}
#[inline]
#[target_feature(enable = "altivec")]
#[cfg_attr(test, assert_instr(vcmpgtsh.))]
unsafe fn vcmpgesh_any(a: vector_signed_short, b: vector_signed_short) -> bool {
vcmpgtsh_p(3, b, a) != 0
}
#[inline]
#[target_feature(enable = "altivec")]
#[cfg_attr(test, assert_instr(vcmpgtsw.))]
unsafe fn vcmpgesw_all(a: vector_signed_int, b: vector_signed_int) -> bool {
vcmpgtsw_p(0, b, a) != 0
}
#[inline]
#[target_feature(enable = "altivec")]
#[cfg_attr(test, assert_instr(vcmpgtsw.))]
unsafe fn vcmpgesw_any(a: vector_signed_int, b: vector_signed_int) -> bool {
vcmpgtsw_p(3, b, a) != 0
}
#[inline]
#[target_feature(enable = "altivec")]
#[cfg_attr(test, assert_instr(vcmpgtub.))]
unsafe fn vcmpgeub_all(a: vector_unsigned_char, b: vector_unsigned_char) -> bool {
vcmpgtub_p(0, b, a) != 0
}
#[inline]
#[target_feature(enable = "altivec")]
#[cfg_attr(test, assert_instr(vcmpgtub.))]
unsafe fn vcmpgeub_any(a: vector_unsigned_char, b: vector_unsigned_char) -> bool {
vcmpgtub_p(3, b, a) != 0
}
#[inline]
#[target_feature(enable = "altivec")]
#[cfg_attr(test, assert_instr(vcmpgtuh.))]
unsafe fn vcmpgeuh_all(a: vector_unsigned_short, b: vector_unsigned_short) -> bool {
vcmpgtuh_p(0, b, a) != 0
}
#[inline]
#[target_feature(enable = "altivec")]
#[cfg_attr(test, assert_instr(vcmpgtuh.))]
unsafe fn vcmpgeuh_any(a: vector_unsigned_short, b: vector_unsigned_short) -> bool {
vcmpgtuh_p(3, b, a) != 0
}
#[inline]
#[target_feature(enable = "altivec")]
#[cfg_attr(test, assert_instr(vcmpgtuw.))]
unsafe fn vcmpgeuw_all(a: vector_unsigned_int, b: vector_unsigned_int) -> bool {
vcmpgtuw_p(0, b, a) != 0
}
#[inline]
#[target_feature(enable = "altivec")]
#[cfg_attr(test, assert_instr(vcmpgtuw.))]
unsafe fn vcmpgeuw_any(a: vector_unsigned_int, b: vector_unsigned_int) -> bool {