@@ -209,6 +209,14 @@ unsafe extern "unadjusted" {
209
209
#[ link_name = "llvm.s390.vmloh" ] fn vmloh ( a : vector_unsigned_short , b : vector_unsigned_short ) -> vector_unsigned_int ;
210
210
#[ link_name = "llvm.s390.vmlof" ] fn vmlof ( a : vector_unsigned_int , b : vector_unsigned_int ) -> vector_unsigned_long_long ;
211
211
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
+
212
220
#[ link_name = "llvm.s390.vgfmb" ] fn vgfmb ( a : vector_unsigned_char , b : vector_unsigned_char ) -> vector_unsigned_short ;
213
221
#[ link_name = "llvm.s390.vgfmh" ] fn vgfmh ( a : vector_unsigned_short , b : vector_unsigned_short ) -> vector_unsigned_int ;
214
222
#[ 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 {
2649
2657
impl_mul ! ( [ VectorMulo vec_mulo] vec_vmloh ( vector_unsigned_short, vector_unsigned_short) -> vector_unsigned_int) ;
2650
2658
impl_mul ! ( [ VectorMulo vec_mulo] vec_vmlof ( vector_unsigned_int, vector_unsigned_int) -> vector_unsigned_long_long ) ;
2651
2659
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
+
2652
2681
#[ unstable( feature = "stdarch_s390x" , issue = "135681" ) ]
2653
2682
pub trait VectorGfmsum < Result > {
2654
2683
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 {
4765
4794
a. vec_mulo ( b)
4766
4795
}
4767
4796
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
+
4768
4805
/// Vector Galois Field Multiply Sum
4769
4806
#[ inline]
4770
4807
#[ target_feature( enable = "vector" ) ]
@@ -6443,6 +6480,18 @@ mod tests {
6443
6480
[ 0x4000_0000 , -8 , 0xFFFE , 2 ]
6444
6481
}
6445
6482
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
+
6446
6495
test_vec_2 ! { test_vec_gfmsum_1, vec_gfmsum, u16x8, u16x8 -> u32x4,
6447
6496
[ 0x1234 , 0x5678 , 0x9ABC , 0xDEF0 , 0x1357 , 0x2468 , 0xACE0 , 0xBDF0 ] ,
6448
6497
[ 0xFFFF , 0x0001 , 0x8000 , 0x7FFF , 0xAAAA , 0x5555 , 0x1234 , 0x5678 ] ,
0 commit comments