@@ -520,8 +520,31 @@ mod sealed {
520520 // instructions in later facilities. Add tests when possible.
521521 test_impl ! { vec_popcnt_signed +( a: vector_signed_char) -> vector_signed_char [ simd_ctpop, vpopctb] }
522522 test_impl ! { vec_popcnt_unsigned +( a: vector_unsigned_char) -> vector_unsigned_char [ simd_ctpop, vpopctb] }
523- }
524523
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+ }
525548
526549/// Vector element-wise addition.
527550#[ inline]
@@ -641,6 +664,39 @@ where
641664 a. vec_splats ( )
642665}
643666
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+
644700#[ cfg( test) ]
645701mod tests {
646702 use super :: * ;
0 commit comments