@@ -200,6 +200,8 @@ unsafe extern "unadjusted" {
200
200
#[ link_name = "llvm.s390.vgfmb" ] fn vgfmb ( a : vector_unsigned_char , b : vector_unsigned_char ) -> vector_unsigned_short ;
201
201
#[ link_name = "llvm.s390.vgfmh" ] fn vgfmh ( a : vector_unsigned_short , b : vector_unsigned_short ) -> vector_unsigned_int ;
202
202
#[ link_name = "llvm.s390.vgfmf" ] fn vgfmf ( a : vector_unsigned_int , b : vector_unsigned_int ) -> vector_unsigned_long_long ;
203
+ #[ link_name = "llvm.s390.vgfmg" ] fn vgfmg ( a : vector_unsigned_long_long , b : vector_unsigned_long_long ) -> u128 ;
204
+
203
205
}
204
206
205
207
impl_from ! { i8x16, u8x16, i16x8, u16x8, i32x4, u32x4, i64x2, u64x2, f32x4, f64x2 }
@@ -3609,6 +3611,18 @@ pub unsafe fn vec_gfmsum<T: sealed::VectorGfmsum<U>, U>(a: T, b: T) -> U {
3609
3611
a. vec_gfmsum ( b)
3610
3612
}
3611
3613
3614
+ /// Vector Galois Field Multiply Sum 128-bits
3615
+ #[ inline]
3616
+ #[ target_feature( enable = "vector" ) ]
3617
+ #[ unstable( feature = "stdarch_s390x" , issue = "135681" ) ]
3618
+ #[ cfg_attr( test, assert_instr( vgfmg) ) ]
3619
+ pub unsafe fn vec_gfmsum_128 (
3620
+ a : vector_unsigned_long_long ,
3621
+ b : vector_unsigned_long_long ,
3622
+ ) -> vector_unsigned_char {
3623
+ transmute ( vgfmg ( a, b) )
3624
+ }
3625
+
3612
3626
#[ cfg( test) ]
3613
3627
mod tests {
3614
3628
use super :: * ;
@@ -4531,4 +4545,19 @@ mod tests {
4531
4545
[ 0xFFFF , 0x0000 , 0x5555 , 0xAAAA , 0x0001 , 0x8000 , 0x7FFF , 0x1357 ] ,
4532
4546
[ 0 , 0 , 0x2B3C1234 , 0x3781D244 ]
4533
4547
}
4548
+
4549
+ #[ simd_test( enable = "vector" ) ]
4550
+ fn test_vec_gfmsum_128 ( ) {
4551
+ let a = vector_unsigned_long_long ( [ 1 , 2 ] ) ;
4552
+ let b = vector_unsigned_long_long ( [ 3 , 4 ] ) ;
4553
+
4554
+ let d: u128 = unsafe { transmute ( vec_gfmsum_128 ( a, b) ) } ;
4555
+ assert_eq ! ( d, 11 ) ;
4556
+
4557
+ let a = vector_unsigned_long_long ( [ 0x0101010101010101 , 0x0202020202020202 ] ) ;
4558
+ let b = vector_unsigned_long_long ( [ 0x0404040404040404 , 0x0505050505050505 ] ) ;
4559
+
4560
+ let d: u128 = unsafe { transmute ( vec_gfmsum_128 ( a, b) ) } ;
4561
+ assert_eq ! ( d, 0xE000E000E000E000E000E000E000E ) ;
4562
+ }
4534
4563
}
0 commit comments