@@ -213,6 +213,9 @@ extern "C" {
213
213
#[ link_name = "llvm.ppc.altivec.vsubuws" ]
214
214
fn vsubuws ( a : vector_unsigned_int , b : vector_unsigned_int ) -> vector_unsigned_int ;
215
215
216
+ #[ link_name = "llvm.ppc.altivec.vsubcuw" ]
217
+ fn vsubcuw ( a : vector_unsigned_int , b : vector_unsigned_int ) -> vector_unsigned_int ;
218
+
216
219
#[ link_name = "llvm.ppc.altivec.vaddcuw" ]
217
220
fn vaddcuw ( a : vector_unsigned_int , b : vector_unsigned_int ) -> vector_unsigned_int ;
218
221
@@ -1686,6 +1689,17 @@ mod sealed {
1686
1689
impl_vec_trait ! { [ VectorSub vec_sub] ~( simd_sub, simd_sub, simd_sub, simd_sub, simd_sub, simd_sub) }
1687
1690
impl_vec_trait ! { [ VectorSub vec_sub] simd_sub( vector_float, vector_float) -> vector_float }
1688
1691
1692
+ test_impl ! { vec_vsubcuw ( a: vector_unsigned_int, b: vector_unsigned_int) -> vector_unsigned_int [ vsubcuw, vsubcuw] }
1693
+
1694
+ #[ unstable( feature = "stdarch_powerpc" , issue = "111145" ) ]
1695
+ pub trait VectorSubc < Other > {
1696
+ type Result ;
1697
+ unsafe fn vec_subc ( self , b : Other ) -> Self :: Result ;
1698
+ }
1699
+
1700
+ impl_vec_trait ! { [ VectorSubc vec_subc] + vec_vsubcuw( vector_unsigned_int, vector_unsigned_int) -> vector_unsigned_int }
1701
+ impl_vec_trait ! { [ VectorSubc vec_subc] + vec_vsubcuw( vector_signed_int, vector_signed_int) -> vector_signed_int }
1702
+
1689
1703
test_impl ! { vec_vminsb ( a: vector_signed_char, b: vector_signed_char) -> vector_signed_char [ vminsb, vminsb] }
1690
1704
test_impl ! { vec_vminsh ( a: vector_signed_short, b: vector_signed_short) -> vector_signed_short [ vminsh, vminsh] }
1691
1705
test_impl ! { vec_vminsw ( a: vector_signed_int, b: vector_signed_int) -> vector_signed_int [ vminsw, vminsw] }
@@ -3872,6 +3886,26 @@ where
3872
3886
a. vec_sub ( b)
3873
3887
}
3874
3888
3889
+ /// Vector Subtract Carryout
3890
+ ///
3891
+ /// ## Purpose
3892
+ /// Returns a vector wherein each element contains the carry produced by subtracting the
3893
+ /// corresponding elements of the two source vectors.
3894
+ ///
3895
+ /// ## Result value
3896
+ /// The value of each element of r is the complement of the carry produced by subtract- ing the
3897
+ /// value of the corresponding element of b from the value of the corresponding element of a. The
3898
+ /// value is 0 if a borrow occurred, or 1 if no borrow occurred.
3899
+ #[ inline]
3900
+ #[ target_feature( enable = "altivec" ) ]
3901
+ #[ unstable( feature = "stdarch_powerpc" , issue = "111145" ) ]
3902
+ pub unsafe fn vec_subc < T , U > ( a : T , b : U ) -> <T as sealed:: VectorSubc < U > >:: Result
3903
+ where
3904
+ T : sealed:: VectorSubc < U > ,
3905
+ {
3906
+ a. vec_subc ( b)
3907
+ }
3908
+
3875
3909
/// Vector subs.
3876
3910
#[ inline]
3877
3911
#[ target_feature( enable = "altivec" ) ]
0 commit comments