@@ -209,6 +209,14 @@ unsafe extern "unadjusted" {
209209 #[ link_name = "llvm.s390.vmloh" ] fn vmloh ( a : vector_unsigned_short , b : vector_unsigned_short ) -> vector_unsigned_int ;
210210 #[ link_name = "llvm.s390.vmlof" ] fn vmlof ( a : vector_unsigned_int , b : vector_unsigned_int ) -> vector_unsigned_long_long ;
211211
212+ #[ link_name = "llvm.s390.vmhb" ] fn vmhb ( a : vector_signed_char , b : vector_signed_char ) -> vector_signed_char ;
213+ #[ link_name = "llvm.s390.vmhh" ] fn vmhh ( a : vector_signed_short , b : vector_signed_short ) -> vector_signed_short ;
214+ #[ link_name = "llvm.s390.vmhf" ] fn vmhf ( a : vector_signed_int , b : vector_signed_int ) -> vector_signed_int ;
215+
216+ #[ link_name = "llvm.s390.vmlhb" ] fn vmlhb ( a : vector_unsigned_char , b : vector_unsigned_char ) -> vector_unsigned_char ;
217+ #[ link_name = "llvm.s390.vmlhh" ] fn vmlhh ( a : vector_unsigned_short , b : vector_unsigned_short ) -> vector_unsigned_short ;
218+ #[ link_name = "llvm.s390.vmlhf" ] fn vmlhf ( a : vector_unsigned_int , b : vector_unsigned_int ) -> vector_unsigned_int ;
219+
212220 #[ link_name = "llvm.s390.vgfmb" ] fn vgfmb ( a : vector_unsigned_char , b : vector_unsigned_char ) -> vector_unsigned_short ;
213221 #[ link_name = "llvm.s390.vgfmh" ] fn vgfmh ( a : vector_unsigned_short , b : vector_unsigned_short ) -> vector_unsigned_int ;
214222 #[ link_name = "llvm.s390.vgfmf" ] fn vgfmf ( a : vector_unsigned_int , b : vector_unsigned_int ) -> vector_unsigned_long_long ;
@@ -2649,6 +2657,27 @@ mod sealed {
26492657 impl_mul ! ( [ VectorMulo vec_mulo] vec_vmloh ( vector_unsigned_short, vector_unsigned_short) -> vector_unsigned_int) ;
26502658 impl_mul ! ( [ VectorMulo vec_mulo] vec_vmlof ( vector_unsigned_int, vector_unsigned_int) -> vector_unsigned_long_long ) ;
26512659
2660+ #[ unstable( feature = "stdarch_s390x" , issue = "135681" ) ]
2661+ pub trait VectorMulh < Result > {
2662+ unsafe fn vec_mulh ( self , b : Self ) -> Result ;
2663+ }
2664+
2665+ test_impl ! { vec_vmhb( a: vector_signed_char, b: vector_signed_char) -> vector_signed_char [ vmhb, vmhb ] }
2666+ test_impl ! { vec_vmhh( a: vector_signed_short, b: vector_signed_short) -> vector_signed_short [ vmhh, vmhh ] }
2667+ test_impl ! { vec_vmhf( a: vector_signed_int, b: vector_signed_int) -> vector_signed_int [ vmhf, vmhf ] }
2668+
2669+ test_impl ! { vec_vmlhb( a: vector_unsigned_char, b: vector_unsigned_char) -> vector_unsigned_char [ vmlhb, vmlhb ] }
2670+ test_impl ! { vec_vmlhh( a: vector_unsigned_short, b: vector_unsigned_short) -> vector_unsigned_short [ vmlhh, vmlhh ] }
2671+ test_impl ! { vec_vmlhf( a: vector_unsigned_int, b: vector_unsigned_int) -> vector_unsigned_int [ vmlhf, vmlhf ] }
2672+
2673+ impl_mul ! ( [ VectorMulh vec_mulh] vec_vmhb ( vector_signed_char, vector_signed_char) -> vector_signed_char) ;
2674+ impl_mul ! ( [ VectorMulh vec_mulh] vec_vmhh ( vector_signed_short, vector_signed_short) -> vector_signed_short) ;
2675+ impl_mul ! ( [ VectorMulh vec_mulh] vec_vmhf ( vector_signed_int, vector_signed_int) -> vector_signed_int) ;
2676+
2677+ impl_mul ! ( [ VectorMulh vec_mulh] vec_vmlhb ( vector_unsigned_char, vector_unsigned_char) -> vector_unsigned_char) ;
2678+ impl_mul ! ( [ VectorMulh vec_mulh] vec_vmlhh ( vector_unsigned_short, vector_unsigned_short) -> vector_unsigned_short) ;
2679+ impl_mul ! ( [ VectorMulh vec_mulh] vec_vmlhf ( vector_unsigned_int, vector_unsigned_int) -> vector_unsigned_int) ;
2680+
26522681 #[ unstable( feature = "stdarch_s390x" , issue = "135681" ) ]
26532682 pub trait VectorGfmsum < Result > {
26542683 unsafe fn vec_gfmsum ( self , b : Self ) -> Result ;
@@ -4765,6 +4794,14 @@ pub unsafe fn vec_mulo<T: sealed::VectorMulo<U>, U>(a: T, b: T) -> U {
47654794 a. vec_mulo ( b)
47664795}
47674796
4797+ /// Vector Multiply High
4798+ #[ inline]
4799+ #[ target_feature( enable = "vector" ) ]
4800+ #[ unstable( feature = "stdarch_s390x" , issue = "135681" ) ]
4801+ pub unsafe fn vec_mulh < T : sealed:: VectorMulh < U > , U > ( a : T , b : T ) -> U {
4802+ a. vec_mulh ( b)
4803+ }
4804+
47684805/// Vector Galois Field Multiply Sum
47694806#[ inline]
47704807#[ target_feature( enable = "vector" ) ]
@@ -6443,6 +6480,18 @@ mod tests {
64436480 [ 0x4000_0000 , -8 , 0xFFFE , 2 ]
64446481 }
64456482
6483+ test_vec_2 ! { test_vec_mulh_u, vec_mulh, u32x4, u32x4 -> u32x4,
6484+ [ u32 :: MAX , 2 , 2 , 1 ] ,
6485+ [ u32 :: MAX , 4 , u32 :: MAX , 2 ] ,
6486+ [ u32 :: MAX - 1 , 0 , 1 , 0 ]
6487+ }
6488+
6489+ test_vec_2 ! { test_vec_mulh_i, vec_mulh, i32x4, i32x4 -> i32x4,
6490+ [ i32 :: MIN , -2 , 2 , 1 ] ,
6491+ [ i32 :: MIN , 4 , i32 :: MAX , 2 ] ,
6492+ [ 0x4000_0000 , -1 , 0 , 0 ]
6493+ }
6494+
64466495 test_vec_2 ! { test_vec_gfmsum_1, vec_gfmsum, u16x8, u16x8 -> u32x4,
64476496 [ 0x1234 , 0x5678 , 0x9ABC , 0xDEF0 , 0x1357 , 0x2468 , 0xACE0 , 0xBDF0 ] ,
64486497 [ 0xFFFF , 0x0001 , 0x8000 , 0x7FFF , 0xAAAA , 0x5555 , 0x1234 , 0x5678 ] ,
0 commit comments