@@ -1797,24 +1797,19 @@ pub unsafe fn _mm256_i64gather_pd<const SCALE: i32>(
1797
1797
/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_i64gather_pd)
1798
1798
#[ inline]
1799
1799
#[ target_feature( enable = "avx2" ) ]
1800
- #[ cfg_attr( test, assert_instr( vgatherqpd, scale = 1 ) ) ]
1801
- #[ rustc_args_required_const ( 4 ) ]
1800
+ #[ cfg_attr( test, assert_instr( vgatherqpd, SCALE = 1 ) ) ]
1801
+ #[ rustc_legacy_const_generics ( 4 ) ]
1802
1802
#[ stable( feature = "simd_x86" , since = "1.27.0" ) ]
1803
- pub unsafe fn _mm256_mask_i64gather_pd (
1803
+ pub unsafe fn _mm256_mask_i64gather_pd < const SCALE : i32 > (
1804
1804
src : __m256d ,
1805
1805
slice : * const f64 ,
1806
1806
offsets : __m256i ,
1807
1807
mask : __m256d ,
1808
- scale : i32 ,
1809
1808
) -> __m256d {
1809
+ static_assert_imm8_scale ! ( SCALE ) ;
1810
1810
let slice = slice as * const i8 ;
1811
1811
let offsets = offsets. as_i64x4 ( ) ;
1812
- macro_rules! call {
1813
- ( $imm8: expr) => {
1814
- vpgatherqpd( src, slice, offsets, mask, $imm8)
1815
- } ;
1816
- }
1817
- constify_imm8_gather ! ( scale, call)
1812
+ vpgatherqpd ( src, slice, offsets, mask, SCALE as i8 )
1818
1813
}
1819
1814
1820
1815
/// Copies `a` to `dst`, then insert 128 bits (of integer data) from `b` at the
@@ -5917,12 +5912,11 @@ mod tests {
5917
5912
j += 1.0 ;
5918
5913
}
5919
5914
// A multiplier of 8 is word-addressing for f64s
5920
- let r = _mm256_mask_i64gather_pd (
5915
+ let r = _mm256_mask_i64gather_pd :: < 8 > (
5921
5916
_mm256_set1_pd ( 256.0 ) ,
5922
5917
arr. as_ptr ( ) ,
5923
5918
_mm256_setr_epi64x ( 0 , 16 , 64 , 96 ) ,
5924
5919
_mm256_setr_pd ( -1.0 , -1.0 , -1.0 , 0.0 ) ,
5925
- 8 ,
5926
5920
) ;
5927
5921
assert_eq_m256d ( r, _mm256_setr_pd ( 0.0 , 16.0 , 64.0 , 256.0 ) ) ;
5928
5922
}
0 commit comments