@@ -520,8 +520,31 @@ mod sealed {
520
520
// instructions in later facilities. Add tests when possible.
521
521
test_impl ! { vec_popcnt_signed +( a: vector_signed_char) -> vector_signed_char [ simd_ctpop, vpopctb] }
522
522
test_impl ! { vec_popcnt_unsigned +( a: vector_unsigned_char) -> vector_unsigned_char [ simd_ctpop, vpopctb] }
523
- }
524
523
524
+ #[ unstable( feature = "stdarch_s390x" , issue = "135681" ) ]
525
+ pub trait VectorAnd < Other > {
526
+ type Result ;
527
+ unsafe fn vec_and ( self , b : Other ) -> Self :: Result ;
528
+ }
529
+
530
+ impl_vec_trait ! { [ VectorAnd vec_and] ~( simd_and) }
531
+
532
+ #[ unstable( feature = "stdarch_s390x" , issue = "135681" ) ]
533
+ pub trait VectorOr < Other > {
534
+ type Result ;
535
+ unsafe fn vec_or ( self , b : Other ) -> Self :: Result ;
536
+ }
537
+
538
+ impl_vec_trait ! { [ VectorOr vec_or] ~( simd_or) }
539
+
540
+ #[ unstable( feature = "stdarch_s390x" , issue = "135681" ) ]
541
+ pub trait VectorXor < Other > {
542
+ type Result ;
543
+ unsafe fn vec_xor ( self , b : Other ) -> Self :: Result ;
544
+ }
545
+
546
+ impl_vec_trait ! { [ VectorXor vec_xor] ~( simd_xor) }
547
+ }
525
548
526
549
/// Vector element-wise addition.
527
550
#[ inline]
@@ -641,6 +664,39 @@ where
641
664
a. vec_splats ( )
642
665
}
643
666
667
+ /// Vector and
668
+ #[ inline]
669
+ #[ target_feature( enable = "vector" ) ]
670
+ #[ unstable( feature = "stdarch_s390x" , issue = "135681" ) ]
671
+ pub unsafe fn vec_and < T , U > ( a : T , b : U ) -> <T as sealed:: VectorAnd < U > >:: Result
672
+ where
673
+ T : sealed:: VectorAnd < U > ,
674
+ {
675
+ a. vec_and ( b)
676
+ }
677
+
678
+ /// Vector or
679
+ #[ inline]
680
+ #[ target_feature( enable = "vector" ) ]
681
+ #[ unstable( feature = "stdarch_s390x" , issue = "135681" ) ]
682
+ pub unsafe fn vec_or < T , U > ( a : T , b : U ) -> <T as sealed:: VectorOr < U > >:: Result
683
+ where
684
+ T : sealed:: VectorOr < U > ,
685
+ {
686
+ a. vec_or ( b)
687
+ }
688
+
689
+ /// Vector xor
690
+ #[ inline]
691
+ #[ target_feature( enable = "vector" ) ]
692
+ #[ unstable( feature = "stdarch_s390x" , issue = "135681" ) ]
693
+ pub unsafe fn vec_xor < T , U > ( a : T , b : U ) -> <T as sealed:: VectorXor < U > >:: Result
694
+ where
695
+ T : sealed:: VectorXor < U > ,
696
+ {
697
+ a. vec_xor ( b)
698
+ }
699
+
644
700
#[ cfg( test) ]
645
701
mod tests {
646
702
use super :: * ;
0 commit comments