@@ -181,14 +181,6 @@ unsafe extern "unadjusted" {
181181
182182 #[ link_name = "llvm.s390.vcksm" ] fn vcksm ( a : vector_unsigned_int , b : vector_unsigned_int ) -> vector_unsigned_int ;
183183
184- #[ link_name = "llvm.s390.vmob" ] fn vmob ( a : vector_signed_char , b : vector_signed_char ) -> vector_signed_short ;
185- #[ link_name = "llvm.s390.vmoh" ] fn vmoh ( a : vector_signed_short , b : vector_signed_short ) -> vector_signed_int ;
186- #[ link_name = "llvm.s390.vmof" ] fn vmof ( a : vector_signed_int , b : vector_signed_int ) -> vector_signed_long_long ;
187-
188- #[ link_name = "llvm.s390.vmlob" ] fn vmlob ( a : vector_unsigned_char , b : vector_unsigned_char ) -> vector_unsigned_short ;
189- #[ link_name = "llvm.s390.vmloh" ] fn vmloh ( a : vector_unsigned_short , b : vector_unsigned_short ) -> vector_unsigned_int ;
190- #[ link_name = "llvm.s390.vmlof" ] fn vmlof ( a : vector_unsigned_int , b : vector_unsigned_int ) -> vector_unsigned_long_long ;
191-
192184 #[ link_name = "llvm.s390.vmhb" ] fn vmhb ( a : vector_signed_char , b : vector_signed_char ) -> vector_signed_char ;
193185 #[ link_name = "llvm.s390.vmhh" ] fn vmhh ( a : vector_signed_short , b : vector_signed_short ) -> vector_signed_short ;
194186 #[ link_name = "llvm.s390.vmhf" ] fn vmhf ( a : vector_signed_int , b : vector_signed_int ) -> vector_signed_int ;
@@ -377,7 +369,7 @@ impl<const N: usize> ShuffleMask<N> {
377369 ShuffleMask ( mask)
378370 }
379371
380- const fn pack ( ) -> Self {
372+ const fn odd ( ) -> Self {
381373 let mut mask = [ 0 ; N ] ;
382374 let mut i = 1 ;
383375 let mut index = 0 ;
@@ -390,6 +382,10 @@ impl<const N: usize> ShuffleMask<N> {
390382 ShuffleMask ( mask)
391383 }
392384
385+ const fn pack ( ) -> Self {
386+ Self :: odd ( )
387+ }
388+
393389 const fn unpack_low ( ) -> Self {
394390 let mut mask = [ 0 ; N ] ;
395391 let mut i = 0 ;
@@ -2647,36 +2643,36 @@ mod sealed {
26472643 unsafe fn vec_mule ( self , b : Self ) -> Result ;
26482644 }
26492645
2650- macro_rules! impl_vec_mule {
2651- ( $instr: ident $src: ident $shuffled: ident $dst: ident $width: literal) => {
2646+ macro_rules! impl_vec_mul_even_odd {
2647+ ( $mask : ident $ instr: ident $src: ident $shuffled: ident $dst: ident $width: literal) => {
26522648 #[ inline]
26532649 #[ target_feature( enable = "vector" ) ]
26542650 #[ cfg_attr( test, assert_instr( $instr) ) ]
26552651 unsafe fn $instr( a: $src, b: $src) -> $dst {
2656- let even_a: $dst = simd_as( simd_shuffle:: <_, _, $shuffled>(
2657- a,
2652+ let elems_a: $dst = simd_as( simd_shuffle:: <_, _, $shuffled>(
26582653 a,
2659- const { ShuffleMask :: <$width>:: even( ) } ,
2654+ a, // this argument is ignored entirely.
2655+ const { ShuffleMask :: <$width>:: $mask( ) } ,
26602656 ) ) ;
26612657
2662- let even_b : $dst = simd_as( simd_shuffle:: <_, _, $shuffled>(
2658+ let elems_b : $dst = simd_as( simd_shuffle:: <_, _, $shuffled>(
26632659 b,
2664- b,
2665- const { ShuffleMask :: <$width>:: even ( ) } ,
2660+ b, // this argument is ignored entirely.
2661+ const { ShuffleMask :: <$width>:: $mask ( ) } ,
26662662 ) ) ;
26672663
2668- simd_mul( even_a , even_b )
2664+ simd_mul( elems_a , elems_b )
26692665 }
26702666 } ;
26712667 }
26722668
2673- impl_vec_mule ! { vmeb vector_signed_char i8x8 vector_signed_short 8 }
2674- impl_vec_mule ! { vmeh vector_signed_short i16x4 vector_signed_int 4 }
2675- impl_vec_mule ! { vmef vector_signed_int i32x2 vector_signed_long_long 2 }
2669+ impl_vec_mul_even_odd ! { even vmeb vector_signed_char i8x8 vector_signed_short 8 }
2670+ impl_vec_mul_even_odd ! { even vmeh vector_signed_short i16x4 vector_signed_int 4 }
2671+ impl_vec_mul_even_odd ! { even vmef vector_signed_int i32x2 vector_signed_long_long 2 }
26762672
2677- impl_vec_mule ! { vmleb vector_unsigned_char u8x8 vector_unsigned_short 8 }
2678- impl_vec_mule ! { vmleh vector_unsigned_short u16x4 vector_unsigned_int 4 }
2679- impl_vec_mule ! { vmlef vector_unsigned_int u32x2 vector_unsigned_long_long 2 }
2673+ impl_vec_mul_even_odd ! { even vmleb vector_unsigned_char u8x8 vector_unsigned_short 8 }
2674+ impl_vec_mul_even_odd ! { even vmleh vector_unsigned_short u16x4 vector_unsigned_int 4 }
2675+ impl_vec_mul_even_odd ! { even vmlef vector_unsigned_int u32x2 vector_unsigned_long_long 2 }
26802676
26812677 impl_mul ! ( [ VectorMule vec_mule] vmeb ( vector_signed_char, vector_signed_char) -> vector_signed_short ) ;
26822678 impl_mul ! ( [ VectorMule vec_mule] vmeh ( vector_signed_short, vector_signed_short) -> vector_signed_int) ;
@@ -2691,21 +2687,21 @@ mod sealed {
26912687 unsafe fn vec_mulo ( self , b : Self ) -> Result ;
26922688 }
26932689
2694- test_impl ! { vec_vmob ( a : vector_signed_char , b : vector_signed_char) -> vector_signed_short [ vmob , vmob ] }
2695- test_impl ! { vec_vmoh ( a : vector_signed_short , b : vector_signed_short) -> vector_signed_int[ vmoh , vmoh ] }
2696- test_impl ! { vec_vmof ( a : vector_signed_int , b : vector_signed_int) -> vector_signed_long_long [ vmof , vmof ] }
2690+ impl_vec_mul_even_odd ! { odd vmob vector_signed_char i8x8 vector_signed_short 8 }
2691+ impl_vec_mul_even_odd ! { odd vmoh vector_signed_short i16x4 vector_signed_int 4 }
2692+ impl_vec_mul_even_odd ! { odd vmof vector_signed_int i32x2 vector_signed_long_long 2 }
26972693
2698- test_impl ! { vec_vmlob ( a : vector_unsigned_char , b : vector_unsigned_char) -> vector_unsigned_short [ vmlob , vmlob ] }
2699- test_impl ! { vec_vmloh ( a : vector_unsigned_short , b : vector_unsigned_short) -> vector_unsigned_int[ vmloh , vmloh ] }
2700- test_impl ! { vec_vmlof ( a : vector_unsigned_int , b : vector_unsigned_int) -> vector_unsigned_long_long [ vmlof , vmlof ] }
2694+ impl_vec_mul_even_odd ! { odd vmlob vector_unsigned_char u8x8 vector_unsigned_short 8 }
2695+ impl_vec_mul_even_odd ! { odd vmloh vector_unsigned_short u16x4 vector_unsigned_int 4 }
2696+ impl_vec_mul_even_odd ! { odd vmlof vector_unsigned_int u32x2 vector_unsigned_long_long 2 }
27012697
2702- impl_mul ! ( [ VectorMulo vec_mulo] vec_vmob ( vector_signed_char, vector_signed_char) -> vector_signed_short ) ;
2703- impl_mul ! ( [ VectorMulo vec_mulo] vec_vmoh ( vector_signed_short, vector_signed_short) -> vector_signed_int) ;
2704- impl_mul ! ( [ VectorMulo vec_mulo] vec_vmof ( vector_signed_int, vector_signed_int) -> vector_signed_long_long ) ;
2698+ impl_mul ! ( [ VectorMulo vec_mulo] vmob ( vector_signed_char, vector_signed_char) -> vector_signed_short ) ;
2699+ impl_mul ! ( [ VectorMulo vec_mulo] vmoh ( vector_signed_short, vector_signed_short) -> vector_signed_int) ;
2700+ impl_mul ! ( [ VectorMulo vec_mulo] vmof ( vector_signed_int, vector_signed_int) -> vector_signed_long_long ) ;
27052701
2706- impl_mul ! ( [ VectorMulo vec_mulo] vec_vmlob ( vector_unsigned_char, vector_unsigned_char) -> vector_unsigned_short ) ;
2707- impl_mul ! ( [ VectorMulo vec_mulo] vec_vmloh ( vector_unsigned_short, vector_unsigned_short) -> vector_unsigned_int) ;
2708- impl_mul ! ( [ VectorMulo vec_mulo] vec_vmlof ( vector_unsigned_int, vector_unsigned_int) -> vector_unsigned_long_long ) ;
2702+ impl_mul ! ( [ VectorMulo vec_mulo] vmlob ( vector_unsigned_char, vector_unsigned_char) -> vector_unsigned_short ) ;
2703+ impl_mul ! ( [ VectorMulo vec_mulo] vmloh ( vector_unsigned_short, vector_unsigned_short) -> vector_unsigned_int) ;
2704+ impl_mul ! ( [ VectorMulo vec_mulo] vmlof ( vector_unsigned_int, vector_unsigned_int) -> vector_unsigned_long_long ) ;
27092705
27102706 #[ unstable( feature = "stdarch_s390x" , issue = "135681" ) ]
27112707 pub trait VectorMulh < Result > {
0 commit comments