@@ -206,6 +206,8 @@ unsafe extern "unadjusted" {
206
206
#[ link_name = "llvm.s390.vgfmah" ] fn vgfmah ( a : vector_unsigned_short , b : vector_unsigned_short , c : vector_unsigned_int ) -> vector_unsigned_int ;
207
207
#[ link_name = "llvm.s390.vgfmaf" ] fn vgfmaf ( a : vector_unsigned_int , b : vector_unsigned_int , c : vector_unsigned_long_long ) -> vector_unsigned_long_long ;
208
208
#[ link_name = "llvm.s390.vgfmag" ] fn vgfmag ( a : vector_unsigned_long_long , b : vector_unsigned_long_long , c : u128 ) -> u128 ;
209
+
210
+ #[ link_name = "llvm.s390.vbperm" ] fn vbperm ( a : vector_unsigned_char , b : vector_unsigned_char ) -> vector_unsigned_long_long ;
209
211
}
210
212
211
213
impl_from ! { i8x16, u8x16, i16x8, u16x8, i32x4, u32x4, i64x2, u64x2, f32x4, f64x2 }
@@ -3811,6 +3813,19 @@ pub unsafe fn vec_gfmsum_accum_128(
3811
3813
transmute ( vgfmag ( a, b, transmute ( c) ) )
3812
3814
}
3813
3815
3816
+ /// Vector Bit Permute
3817
+ #[ inline]
3818
+ #[ target_feature( enable = "vector-enhancements-1" ) ]
3819
+ #[ unstable( feature = "stdarch_s390x" , issue = "135681" ) ]
3820
+ #[ cfg_attr( test, assert_instr( vbperm) ) ]
3821
+ pub unsafe fn vec_bperm_u128 (
3822
+ a : vector_unsigned_char ,
3823
+ b : vector_unsigned_char ,
3824
+ ) -> vector_unsigned_long_long {
3825
+ vbperm ( a, b)
3826
+ }
3827
+
3828
+ /// Vector Gather Element
3814
3829
#[ inline]
3815
3830
#[ target_feature( enable = "vector" ) ]
3816
3831
#[ unstable( feature = "stdarch_s390x" , issue = "135681" ) ]
@@ -4760,6 +4775,16 @@ mod tests {
4760
4775
assert_eq ! ( d, 0xE000E000E000E000E000E000E000E ) ;
4761
4776
}
4762
4777
4778
+ #[ simd_test( enable = "vector-enhancements-1" ) ]
4779
+ fn test_vec_bperm_u128 ( ) {
4780
+ let a = vector_unsigned_char ( [ 65 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 ] ) ;
4781
+ let b = vector_unsigned_char ( [
4782
+ 0 , 0 , 0 , 0 , 1 , 1 , 1 , 1 , 128 , 128 , 128 , 128 , 255 , 255 , 255 , 255 ,
4783
+ ] ) ;
4784
+ let d = unsafe { vec_bperm_u128 ( a, b) } ;
4785
+ assert_eq ! ( d. as_array( ) , & [ 0xF00 , 0 ] ) ;
4786
+ }
4787
+
4763
4788
#[ simd_test( enable = "vector" ) ]
4764
4789
fn test_vec_gather_element ( ) {
4765
4790
let a1: [ u32 ; 10 ] = [ 10 , 11 , 12 , 13 , 14 , 15 , 16 , 17 , 18 , 19 ] ;
0 commit comments