@@ -1707,26 +1707,21 @@ pub unsafe fn _mm256_i64gather_epi64<const SCALE: i32>(
1707
1707
/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_i64gather_epi64)
1708
1708
#[ inline]
1709
1709
#[ target_feature( enable = "avx2" ) ]
1710
- #[ cfg_attr( test, assert_instr( vpgatherqq, scale = 1 ) ) ]
1711
- #[ rustc_args_required_const ( 4 ) ]
1710
+ #[ cfg_attr( test, assert_instr( vpgatherqq, SCALE = 1 ) ) ]
1711
+ #[ rustc_legacy_const_generics ( 4 ) ]
1712
1712
#[ stable( feature = "simd_x86" , since = "1.27.0" ) ]
1713
- pub unsafe fn _mm256_mask_i64gather_epi64 (
1713
+ pub unsafe fn _mm256_mask_i64gather_epi64 < const SCALE : i32 > (
1714
1714
src : __m256i ,
1715
1715
slice : * const i64 ,
1716
1716
offsets : __m256i ,
1717
1717
mask : __m256i ,
1718
- scale : i32 ,
1719
1718
) -> __m256i {
1719
+ static_assert_imm8_scale ! ( SCALE ) ;
1720
1720
let src = src. as_i64x4 ( ) ;
1721
1721
let mask = mask. as_i64x4 ( ) ;
1722
1722
let offsets = offsets. as_i64x4 ( ) ;
1723
1723
let slice = slice as * const i8 ;
1724
- macro_rules! call {
1725
- ( $imm8: expr) => {
1726
- vpgatherqq( src, slice, offsets, mask, $imm8)
1727
- } ;
1728
- }
1729
- let r = constify_imm8_gather ! ( scale, call) ;
1724
+ let r = vpgatherqq ( src, slice, offsets, mask, SCALE as i8 ) ;
1730
1725
transmute ( r)
1731
1726
}
1732
1727
@@ -5870,12 +5865,11 @@ mod tests {
5870
5865
arr[ i as usize ] = i;
5871
5866
}
5872
5867
// A multiplier of 8 is word-addressing for i64s
5873
- let r = _mm256_mask_i64gather_epi64 (
5868
+ let r = _mm256_mask_i64gather_epi64 :: < 8 > (
5874
5869
_mm256_set1_epi64x ( 256 ) ,
5875
5870
arr. as_ptr ( ) ,
5876
5871
_mm256_setr_epi64x ( 0 , 16 , 64 , 96 ) ,
5877
5872
_mm256_setr_epi64x ( -1 , -1 , -1 , 0 ) ,
5878
- 8 ,
5879
5873
) ;
5880
5874
assert_eq_m256i ( r, _mm256_setr_epi64x ( 0 , 16 , 64 , 256 ) ) ;
5881
5875
}
0 commit comments