@@ -2244,6 +2244,33 @@ mod sealed {
2244
2244
}
2245
2245
}
2246
2246
2247
+ #[ unstable( feature = "stdarch_powerpc" , issue = "111145" ) ]
2248
+ pub trait VectorAdde {
2249
+ unsafe fn vec_adde ( self , b : Self , c : Self ) -> Self ;
2250
+ }
2251
+
2252
+ #[ unstable( feature = "stdarch_powerpc" , issue = "111145" ) ]
2253
+ impl VectorAdde for vector_unsigned_int {
2254
+ #[ inline]
2255
+ #[ target_feature( enable = "altivec" ) ]
2256
+ unsafe fn vec_adde ( self , b : Self , c : Self ) -> Self {
2257
+ let mask: vector_unsigned_int = transmute ( u32x4:: new ( 1 , 1 , 1 , 1 ) ) ;
2258
+ let carry = vec_and ( c, mask) ;
2259
+ vec_add ( vec_add ( self , b) , carry)
2260
+ }
2261
+ }
2262
+
2263
+ #[ unstable( feature = "stdarch_powerpc" , issue = "111145" ) ]
2264
+ impl VectorAdde for vector_signed_int {
2265
+ #[ inline]
2266
+ #[ target_feature( enable = "altivec" ) ]
2267
+ unsafe fn vec_adde ( self , b : Self , c : Self ) -> Self {
2268
+ let mask: vector_signed_int = transmute ( i32x4:: new ( 1 , 1 , 1 , 1 ) ) ;
2269
+ let carry = vec_and ( c, mask) ;
2270
+ vec_add ( vec_add ( self , b) , carry)
2271
+ }
2272
+ }
2273
+
2247
2274
#[ unstable( feature = "stdarch_powerpc" , issue = "111145" ) ]
2248
2275
pub trait VectorMladd < Other > {
2249
2276
type Result ;
@@ -3523,6 +3550,22 @@ where
3523
3550
a. vec_add ( b)
3524
3551
}
3525
3552
3553
+ /// Vector Add Extended
3554
+ ///
3555
+ /// ## Result value
3556
+ /// The value of each element of r is produced by adding the corresponding elements of
3557
+ /// a and b with a carry specified in the corresponding element of c (1 if there is a carry, 0
3558
+ /// otherwise).
3559
+ #[ inline]
3560
+ #[ target_feature( enable = "altivec" ) ]
3561
+ #[ unstable( feature = "stdarch_powerpc" , issue = "111145" ) ]
3562
+ pub unsafe fn vec_adde < T > ( a : T , b : T , c : T ) -> T
3563
+ where
3564
+ T : sealed:: VectorAdde ,
3565
+ {
3566
+ a. vec_adde ( b, c)
3567
+ }
3568
+
3526
3569
/// Vector Convert to Floating-Point
3527
3570
#[ inline]
3528
3571
#[ target_feature( enable = "altivec" ) ]
0 commit comments