@@ -121,6 +121,9 @@ unsafe extern "unadjusted" {
121
121
#[ link_name = "llvm.s390.vscbif" ] fn vscbif ( a : vector_unsigned_int , b : vector_unsigned_int ) -> vector_unsigned_int ;
122
122
#[ link_name = "llvm.s390.vscbig" ] fn vscbig ( a : vector_unsigned_long_long , b : vector_unsigned_long_long ) -> vector_unsigned_long_long ;
123
123
124
+ #[ link_name = "llvm.s390.vfaeb" ] fn vfaeb ( a : vector_signed_char , b : vector_signed_char , c : i32 ) -> vector_signed_char ;
125
+ #[ link_name = "llvm.s390.vfaeh" ] fn vfaeh ( a : vector_signed_short , b : vector_signed_short , c : i32 ) -> vector_signed_short ;
126
+ #[ link_name = "llvm.s390.vfaef" ] fn vfaef ( a : vector_signed_int , b : vector_signed_int , c : i32 ) -> vector_signed_int ;
124
127
}
125
128
126
129
impl_from ! { i8x16, u8x16, i16x8, u16x8, i32x4, u32x4, i64x2, u64x2, f32x4, f64x2 }
@@ -1525,6 +1528,90 @@ mod sealed {
1525
1528
1526
1529
impl_vec_trait ! { [ VectorSqrt vec_sqrt] vec_sqrt_f32 ( vector_float) }
1527
1530
impl_vec_trait ! { [ VectorSqrt vec_sqrt] vec_sqrt_f64 ( vector_double) }
1531
+
1532
+ #[ inline]
1533
+ #[ target_feature( enable = "vector" ) ]
1534
+ #[ cfg_attr( test, assert_instr( vfaeb, IMM = 0 ) ) ]
1535
+ unsafe fn vfaeb < const IMM : i32 > (
1536
+ a : vector_signed_char ,
1537
+ b : vector_signed_char ,
1538
+ ) -> vector_signed_char {
1539
+ super :: vfaeb ( a, b, IMM )
1540
+ }
1541
+ #[ inline]
1542
+ #[ target_feature( enable = "vector" ) ]
1543
+ #[ cfg_attr( test, assert_instr( vfaeh, IMM = 0 ) ) ]
1544
+ unsafe fn vfaeh < const IMM : i32 > (
1545
+ a : vector_signed_short ,
1546
+ b : vector_signed_short ,
1547
+ ) -> vector_signed_short {
1548
+ super :: vfaeh ( a, b, IMM )
1549
+ }
1550
+ #[ inline]
1551
+ #[ target_feature( enable = "vector" ) ]
1552
+ #[ cfg_attr( test, assert_instr( vfaef, IMM = 0 ) ) ]
1553
+ unsafe fn vfaef < const IMM : i32 > (
1554
+ a : vector_signed_int ,
1555
+ b : vector_signed_int ,
1556
+ ) -> vector_signed_int {
1557
+ super :: vfaef ( a, b, IMM )
1558
+ }
1559
+
1560
+ macro_rules! impl_vfae {
1561
+ ( [ $Trait: ident $m: ident] $imm: literal $( $fun: ident $ty: ident) * ) => {
1562
+ $(
1563
+ #[ unstable( feature = "stdarch_s390x" , issue = "135681" ) ]
1564
+ impl $Trait<Self > for $ty {
1565
+ type Result = t_b!( $ty) ;
1566
+ #[ inline]
1567
+ #[ target_feature( enable = "vector" ) ]
1568
+ unsafe fn $m( self , b: Self ) -> Self :: Result {
1569
+ transmute( $fun:: <$imm>( transmute( self ) , transmute( b) ) )
1570
+ }
1571
+ }
1572
+ ) *
1573
+ } ;
1574
+ }
1575
+
1576
+ #[ unstable( feature = "stdarch_s390x" , issue = "135681" ) ]
1577
+ pub trait VectorFindAnyEq < Other > {
1578
+ type Result ;
1579
+ unsafe fn vec_find_any_eq ( self , other : Other ) -> Self :: Result ;
1580
+ }
1581
+
1582
+ impl_vfae ! { [ VectorFindAnyEq vec_find_any_eq] 4
1583
+ vfaeb vector_signed_char
1584
+ vfaeb vector_unsigned_char
1585
+ vfaeb vector_bool_char
1586
+
1587
+ vfaeh vector_signed_short
1588
+ vfaeh vector_unsigned_short
1589
+ vfaeh vector_bool_short
1590
+
1591
+ vfaef vector_signed_int
1592
+ vfaef vector_unsigned_int
1593
+ vfaef vector_bool_int
1594
+ }
1595
+
1596
+ #[ unstable( feature = "stdarch_s390x" , issue = "135681" ) ]
1597
+ pub trait VectorFindAnyNe < Other > {
1598
+ type Result ;
1599
+ unsafe fn vec_find_any_ne ( self , other : Other ) -> Self :: Result ;
1600
+ }
1601
+
1602
+ impl_vfae ! { [ VectorFindAnyNe vec_find_any_ne] 12
1603
+ vfaeb vector_signed_char
1604
+ vfaeb vector_unsigned_char
1605
+ vfaeb vector_bool_char
1606
+
1607
+ vfaeh vector_signed_short
1608
+ vfaeh vector_unsigned_short
1609
+ vfaeh vector_bool_short
1610
+
1611
+ vfaef vector_signed_int
1612
+ vfaef vector_unsigned_int
1613
+ vfaef vector_bool_int
1614
+ }
1528
1615
}
1529
1616
1530
1617
/// Vector element-wise addition.
@@ -2310,6 +2397,26 @@ pub unsafe fn vec_splat_u64<const IMM: i16>() -> vector_unsigned_long_long {
2310
2397
vector_unsigned_long_long ( [ IMM as u64 ; 2 ] )
2311
2398
}
2312
2399
2400
+ #[ inline]
2401
+ #[ target_feature( enable = "vector" ) ]
2402
+ #[ unstable( feature = "stdarch_s390x" , issue = "135681" ) ]
2403
+ pub unsafe fn vec_find_any_eq < T , U > ( a : T , b : U ) -> <T as sealed:: VectorFindAnyEq < U > >:: Result
2404
+ where
2405
+ T : sealed:: VectorFindAnyEq < U > ,
2406
+ {
2407
+ a. vec_find_any_eq ( b)
2408
+ }
2409
+
2410
+ #[ inline]
2411
+ #[ target_feature( enable = "vector" ) ]
2412
+ #[ unstable( feature = "stdarch_s390x" , issue = "135681" ) ]
2413
+ pub unsafe fn vec_find_any_ne < T , U > ( a : T , b : U ) -> <T as sealed:: VectorFindAnyNe < U > >:: Result
2414
+ where
2415
+ T : sealed:: VectorFindAnyNe < U > ,
2416
+ {
2417
+ a. vec_find_any_ne ( b)
2418
+ }
2419
+
2313
2420
#[ cfg( test) ]
2314
2421
mod tests {
2315
2422
use super :: * ;
@@ -2825,4 +2932,16 @@ mod tests {
2825
2932
test_vec_1 ! { test_vec_sqrt, vec_sqrt, f32x4,
2826
2933
[ core:: f32 :: consts:: PI , 1.0 , 25.0 , 2.0 ] ,
2827
2934
[ core:: f32 :: consts:: PI . sqrt( ) , 1.0 , 5.0 , core:: f32 :: consts:: SQRT_2 ] }
2935
+
2936
+ test_vec_2 ! { test_vec_find_any_eq, vec_find_any_eq, i32x4, i32x4 -> u32x4,
2937
+ [ 1 , -2 , 3 , -4 ] ,
2938
+ [ -5 , 3 , -7 , 8 ] ,
2939
+ [ 0 , 0 , 0xFFFFFFFF , 0 ]
2940
+ }
2941
+
2942
+ test_vec_2 ! { test_vec_find_any_ne, vec_find_any_ne, i32x4, i32x4 -> u32x4,
2943
+ [ 1 , -2 , 3 , -4 ] ,
2944
+ [ -5 , 3 , -7 , 8 ] ,
2945
+ [ 0xFFFFFFFF , 0xFFFFFFFF , 0 , 0xFFFFFFFF ]
2946
+ }
2828
2947
}
0 commit comments