@@ -2547,6 +2547,31 @@ mod sealed {
2547
2547
2548
2548
impl_vec_trait ! { [ VectorNor vec_nor] + 2 b ( vec_vnorsb, vec_vnorsh, vec_vnorsw) }
2549
2549
2550
+ macro_rules! vector_vnand {
2551
+ ( $fun: ident $ty: ident) => {
2552
+ #[ inline]
2553
+ #[ target_feature( enable = "altivec" ) ]
2554
+ #[ cfg_attr( all( test, not( target_feature = "vsx" ) ) , assert_instr( vnand) ) ]
2555
+ #[ cfg_attr( all( test, target_feature = "vsx" ) , assert_instr( xxlnand) ) ]
2556
+ pub unsafe fn $fun( a: t_t_l!( $ty) , b: t_t_l!( $ty) ) -> t_t_l!( $ty) {
2557
+ let o = vec_splats( !0 as $ty) ;
2558
+ vec_xor( vec_and( a, b) , o)
2559
+ }
2560
+ } ;
2561
+ }
2562
+
2563
+ vector_vnand ! { vec_vnandsb i8 }
2564
+ vector_vnand ! { vec_vnandsh i16 }
2565
+ vector_vnand ! { vec_vnandsw i32 }
2566
+
2567
+ #[ unstable( feature = "stdarch_powerpc" , issue = "111145" ) ]
2568
+ pub trait VectorNand < Other > {
2569
+ type Result ;
2570
+ unsafe fn vec_nand ( self , b : Other ) -> Self :: Result ;
2571
+ }
2572
+
2573
+ impl_vec_trait ! { [ VectorNand vec_nand] + 2 b ( vec_vnandsb, vec_vnandsh, vec_vnandsw) }
2574
+
2550
2575
#[ inline]
2551
2576
#[ target_feature( enable = "altivec" ) ]
2552
2577
#[ cfg_attr( test, assert_instr( vcfsx, IMM5 = 1 ) ) ]
@@ -3744,6 +3769,23 @@ where
3744
3769
a. vec_or ( b)
3745
3770
}
3746
3771
3772
+ /// Vector NAND
3773
+ ///
3774
+ /// ## Purpose
3775
+ /// Performs a bitwise NAND of two vectors.
3776
+ ///
3777
+ /// ## Result value
3778
+ /// r is the bitwise NAND of a and b.
3779
+ #[ inline]
3780
+ #[ target_feature( enable = "altivec" ) ]
3781
+ #[ unstable( feature = "stdarch_powerpc" , issue = "111145" ) ]
3782
+ pub unsafe fn vec_nand < T , U > ( a : T , b : U ) -> <T as sealed:: VectorNand < U > >:: Result
3783
+ where
3784
+ T : sealed:: VectorNand < U > ,
3785
+ {
3786
+ a. vec_nand ( b)
3787
+ }
3788
+
3747
3789
/// Vector nor.
3748
3790
#[ inline]
3749
3791
#[ target_feature( enable = "altivec" ) ]
0 commit comments