@@ -1658,26 +1658,21 @@ pub unsafe fn _mm_i64gather_epi64<const SCALE: i32>(
1658
1658
/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_i64gather_epi64)
1659
1659
#[ inline]
1660
1660
#[ target_feature( enable = "avx2" ) ]
1661
- #[ cfg_attr( test, assert_instr( vpgatherqq, scale = 1 ) ) ]
1662
- #[ rustc_args_required_const ( 4 ) ]
1661
+ #[ cfg_attr( test, assert_instr( vpgatherqq, SCALE = 1 ) ) ]
1662
+ #[ rustc_legacy_const_generics ( 4 ) ]
1663
1663
#[ stable( feature = "simd_x86" , since = "1.27.0" ) ]
1664
- pub unsafe fn _mm_mask_i64gather_epi64 (
1664
+ pub unsafe fn _mm_mask_i64gather_epi64 < const SCALE : i32 > (
1665
1665
src : __m128i ,
1666
1666
slice : * const i64 ,
1667
1667
offsets : __m128i ,
1668
1668
mask : __m128i ,
1669
- scale : i32 ,
1670
1669
) -> __m128i {
1670
+ static_assert_imm8_scale ! ( SCALE ) ;
1671
1671
let src = src. as_i64x2 ( ) ;
1672
1672
let mask = mask. as_i64x2 ( ) ;
1673
1673
let offsets = offsets. as_i64x2 ( ) ;
1674
1674
let slice = slice as * const i8 ;
1675
- macro_rules! call {
1676
- ( $imm8: expr) => {
1677
- pgatherqq( src, slice, offsets, mask, $imm8)
1678
- } ;
1679
- }
1680
- let r = constify_imm8_gather ! ( scale, call) ;
1675
+ let r = pgatherqq ( src, slice, offsets, mask, SCALE as i8 ) ;
1681
1676
transmute ( r)
1682
1677
}
1683
1678
@@ -5849,12 +5844,11 @@ mod tests {
5849
5844
arr[ i as usize ] = i;
5850
5845
}
5851
5846
// A multiplier of 8 is word-addressing for i64s
5852
- let r = _mm_mask_i64gather_epi64 (
5847
+ let r = _mm_mask_i64gather_epi64 :: < 8 > (
5853
5848
_mm_set1_epi64x ( 256 ) ,
5854
5849
arr. as_ptr ( ) ,
5855
5850
_mm_setr_epi64x ( 16 , 16 ) ,
5856
5851
_mm_setr_epi64x ( -1 , 0 ) ,
5857
- 8 ,
5858
5852
) ;
5859
5853
assert_eq_m128i ( r, _mm_setr_epi64x ( 16 , 256 ) ) ;
5860
5854
}
0 commit comments