@@ -202,6 +202,10 @@ unsafe extern "unadjusted" {
202
202
#[ link_name = "llvm.s390.vgfmf" ] fn vgfmf ( a : vector_unsigned_int , b : vector_unsigned_int ) -> vector_unsigned_long_long ;
203
203
#[ link_name = "llvm.s390.vgfmg" ] fn vgfmg ( a : vector_unsigned_long_long , b : vector_unsigned_long_long ) -> u128 ;
204
204
205
+ #[ link_name = "llvm.s390.vgfmab" ] fn vgfmab ( a : vector_unsigned_char , b : vector_unsigned_char , c : vector_unsigned_short ) -> vector_unsigned_short ;
206
+ #[ link_name = "llvm.s390.vgfmah" ] fn vgfmah ( a : vector_unsigned_short , b : vector_unsigned_short , c : vector_unsigned_int ) -> vector_unsigned_int ;
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
+ #[ link_name = "llvm.s390.vgfmag" ] fn vgfmag ( a : vector_unsigned_long_long , b : vector_unsigned_long_long , c : u128 ) -> u128 ;
205
209
}
206
210
207
211
impl_from ! { i8x16, u8x16, i16x8, u16x8, i32x4, u32x4, i64x2, u64x2, f32x4, f64x2 }
@@ -2510,6 +2514,44 @@ mod sealed {
2510
2514
impl_mul ! ( [ VectorGfmsum vec_gfmsum] vec_vgfmb ( vector_unsigned_char, vector_unsigned_char) -> vector_unsigned_short ) ;
2511
2515
impl_mul ! ( [ VectorGfmsum vec_gfmsum] vec_vgfmh ( vector_unsigned_short, vector_unsigned_short) -> vector_unsigned_int) ;
2512
2516
impl_mul ! ( [ VectorGfmsum vec_gfmsum] vec_vgfmf ( vector_unsigned_int, vector_unsigned_int) -> vector_unsigned_long_long ) ;
2517
+
2518
+ #[ unstable( feature = "stdarch_s390x" , issue = "135681" ) ]
2519
+ pub trait VectorGfmsumAccum {
2520
+ type Result ;
2521
+ unsafe fn vec_gfmsum_accum ( self , b : Self , c : Self :: Result ) -> Self :: Result ;
2522
+ }
2523
+
2524
+ test_impl ! { vec_vgfmab( a: vector_unsigned_char, b: vector_unsigned_char, c: vector_unsigned_short) -> vector_unsigned_short [ vgfmab, vgfmab ] }
2525
+ test_impl ! { vec_vgfmah( a: vector_unsigned_short, b: vector_unsigned_short, c: vector_unsigned_int) -> vector_unsigned_int[ vgfmah, vgfmah] }
2526
+ test_impl ! { vec_vgfmaf( a: vector_unsigned_int, b: vector_unsigned_int, c: vector_unsigned_long_long) -> vector_unsigned_long_long [ vgfmaf, vgfmaf ] }
2527
+
2528
+ #[ unstable( feature = "stdarch_s390x" , issue = "135681" ) ]
2529
+ impl VectorGfmsumAccum for vector_unsigned_char {
2530
+ type Result = vector_unsigned_short ;
2531
+ #[ inline]
2532
+ #[ target_feature( enable = "vector" ) ]
2533
+ unsafe fn vec_gfmsum_accum ( self , b : Self , c : Self :: Result ) -> Self :: Result {
2534
+ vec_vgfmab ( self , b, c)
2535
+ }
2536
+ }
2537
+ #[ unstable( feature = "stdarch_s390x" , issue = "135681" ) ]
2538
+ impl VectorGfmsumAccum for vector_unsigned_short {
2539
+ type Result = vector_unsigned_int ;
2540
+ #[ inline]
2541
+ #[ target_feature( enable = "vector" ) ]
2542
+ unsafe fn vec_gfmsum_accum ( self , b : Self , c : Self :: Result ) -> Self :: Result {
2543
+ vec_vgfmah ( self , b, c)
2544
+ }
2545
+ }
2546
+ #[ unstable( feature = "stdarch_s390x" , issue = "135681" ) ]
2547
+ impl VectorGfmsumAccum for vector_unsigned_int {
2548
+ type Result = vector_unsigned_long_long ;
2549
+ #[ inline]
2550
+ #[ target_feature( enable = "vector" ) ]
2551
+ unsafe fn vec_gfmsum_accum ( self , b : Self , c : Self :: Result ) -> Self :: Result {
2552
+ vec_vgfmaf ( self , b, c)
2553
+ }
2554
+ }
2513
2555
}
2514
2556
2515
2557
/// Load Count to Block Boundary
@@ -3611,6 +3653,18 @@ pub unsafe fn vec_gfmsum<T: sealed::VectorGfmsum<U>, U>(a: T, b: T) -> U {
3611
3653
a. vec_gfmsum ( b)
3612
3654
}
3613
3655
3656
+ /// Vector Galois Field Multiply Sum
3657
+ #[ inline]
3658
+ #[ target_feature( enable = "vector" ) ]
3659
+ #[ unstable( feature = "stdarch_s390x" , issue = "135681" ) ]
3660
+ pub unsafe fn vec_gfmsum_accum < T : sealed:: VectorGfmsumAccum > (
3661
+ a : T ,
3662
+ b : T ,
3663
+ c : T :: Result ,
3664
+ ) -> T :: Result {
3665
+ a. vec_gfmsum_accum ( b, c)
3666
+ }
3667
+
3614
3668
/// Vector Galois Field Multiply Sum 128-bits
3615
3669
#[ inline]
3616
3670
#[ target_feature( enable = "vector" ) ]
@@ -3623,6 +3677,19 @@ pub unsafe fn vec_gfmsum_128(
3623
3677
transmute ( vgfmg ( a, b) )
3624
3678
}
3625
3679
3680
+ /// Vector Galois Field Multiply Sum and Accumulate 128-bits
3681
+ #[ inline]
3682
+ #[ target_feature( enable = "vector" ) ]
3683
+ #[ unstable( feature = "stdarch_s390x" , issue = "135681" ) ]
3684
+ #[ cfg_attr( test, assert_instr( vgfmag) ) ]
3685
+ pub unsafe fn vec_gfmsum_accum_128 (
3686
+ a : vector_unsigned_long_long ,
3687
+ b : vector_unsigned_long_long ,
3688
+ c : vector_unsigned_char ,
3689
+ ) -> vector_unsigned_char {
3690
+ transmute ( vgfmag ( a, b, transmute ( c) ) )
3691
+ }
3692
+
3626
3693
#[ cfg( test) ]
3627
3694
mod tests {
3628
3695
use super :: * ;
0 commit comments