@@ -181,14 +181,6 @@ unsafe extern "unadjusted" {
181
181
182
182
#[ link_name = "llvm.s390.vcksm" ] fn vcksm ( a : vector_unsigned_int , b : vector_unsigned_int ) -> vector_unsigned_int ;
183
183
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
-
192
184
#[ link_name = "llvm.s390.vmhb" ] fn vmhb ( a : vector_signed_char , b : vector_signed_char ) -> vector_signed_char ;
193
185
#[ link_name = "llvm.s390.vmhh" ] fn vmhh ( a : vector_signed_short , b : vector_signed_short ) -> vector_signed_short ;
194
186
#[ 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> {
377
369
ShuffleMask ( mask)
378
370
}
379
371
380
- const fn pack ( ) -> Self {
372
+ const fn odd ( ) -> Self {
381
373
let mut mask = [ 0 ; N ] ;
382
374
let mut i = 1 ;
383
375
let mut index = 0 ;
@@ -390,6 +382,10 @@ impl<const N: usize> ShuffleMask<N> {
390
382
ShuffleMask ( mask)
391
383
}
392
384
385
+ const fn pack ( ) -> Self {
386
+ Self :: odd ( )
387
+ }
388
+
393
389
const fn unpack_low ( ) -> Self {
394
390
let mut mask = [ 0 ; N ] ;
395
391
let mut i = 0 ;
@@ -2647,36 +2643,36 @@ mod sealed {
2647
2643
unsafe fn vec_mule ( self , b : Self ) -> Result ;
2648
2644
}
2649
2645
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) => {
2652
2648
#[ inline]
2653
2649
#[ target_feature( enable = "vector" ) ]
2654
2650
#[ cfg_attr( test, assert_instr( $instr) ) ]
2655
2651
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>(
2658
2653
a,
2659
- const { ShuffleMask :: <$width>:: even( ) } ,
2654
+ a, // this argument is ignored entirely.
2655
+ const { ShuffleMask :: <$width>:: $mask( ) } ,
2660
2656
) ) ;
2661
2657
2662
- let even_b : $dst = simd_as( simd_shuffle:: <_, _, $shuffled>(
2658
+ let elems_b : $dst = simd_as( simd_shuffle:: <_, _, $shuffled>(
2663
2659
b,
2664
- b,
2665
- const { ShuffleMask :: <$width>:: even ( ) } ,
2660
+ b, // this argument is ignored entirely.
2661
+ const { ShuffleMask :: <$width>:: $mask ( ) } ,
2666
2662
) ) ;
2667
2663
2668
- simd_mul( even_a , even_b )
2664
+ simd_mul( elems_a , elems_b )
2669
2665
}
2670
2666
} ;
2671
2667
}
2672
2668
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 }
2676
2672
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 }
2680
2676
2681
2677
impl_mul ! ( [ VectorMule vec_mule] vmeb ( vector_signed_char, vector_signed_char) -> vector_signed_short ) ;
2682
2678
impl_mul ! ( [ VectorMule vec_mule] vmeh ( vector_signed_short, vector_signed_short) -> vector_signed_int) ;
@@ -2691,21 +2687,21 @@ mod sealed {
2691
2687
unsafe fn vec_mulo ( self , b : Self ) -> Result ;
2692
2688
}
2693
2689
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 }
2697
2693
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 }
2701
2697
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 ) ;
2705
2701
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 ) ;
2709
2705
2710
2706
#[ unstable( feature = "stdarch_s390x" , issue = "135681" ) ]
2711
2707
pub trait VectorMulh < Result > {
0 commit comments