@@ -1774,20 +1774,19 @@ pub unsafe fn _mm_mask_i64gather_pd<const SCALE: i32>(
1774
1774
/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_i64gather_pd)
1775
1775
#[ inline]
1776
1776
#[ target_feature( enable = "avx2" ) ]
1777
- #[ cfg_attr( test, assert_instr( vgatherqpd, scale = 1 ) ) ]
1778
- #[ rustc_args_required_const ( 2 ) ]
1777
+ #[ cfg_attr( test, assert_instr( vgatherqpd, SCALE = 1 ) ) ]
1778
+ #[ rustc_legacy_const_generics ( 2 ) ]
1779
1779
#[ stable( feature = "simd_x86" , since = "1.27.0" ) ]
1780
- pub unsafe fn _mm256_i64gather_pd ( slice : * const f64 , offsets : __m256i , scale : i32 ) -> __m256d {
1780
+ pub unsafe fn _mm256_i64gather_pd < const SCALE : i32 > (
1781
+ slice : * const f64 ,
1782
+ offsets : __m256i ,
1783
+ ) -> __m256d {
1784
+ static_assert_imm8_scale ! ( SCALE ) ;
1781
1785
let zero = _mm256_setzero_pd ( ) ;
1782
1786
let neg_one = _mm256_set1_pd ( -1.0 ) ;
1783
1787
let slice = slice as * const i8 ;
1784
1788
let offsets = offsets. as_i64x4 ( ) ;
1785
- macro_rules! call {
1786
- ( $imm8: expr) => {
1787
- vpgatherqpd( zero, slice, offsets, neg_one, $imm8)
1788
- } ;
1789
- }
1790
- constify_imm8_gather ! ( scale, call)
1789
+ vpgatherqpd ( zero, slice, offsets, neg_one, SCALE as i8 )
1791
1790
}
1792
1791
1793
1792
/// Returns values from `slice` at offsets determined by `offsets * scale`,
@@ -5905,7 +5904,7 @@ mod tests {
5905
5904
j += 1.0 ;
5906
5905
}
5907
5906
// A multiplier of 8 is word-addressing for f64s
5908
- let r = _mm256_i64gather_pd ( arr. as_ptr ( ) , _mm256_setr_epi64x ( 0 , 16 , 32 , 48 ) , 8 ) ;
5907
+ let r = _mm256_i64gather_pd :: < 8 > ( arr. as_ptr ( ) , _mm256_setr_epi64x ( 0 , 16 , 32 , 48 ) ) ;
5909
5908
assert_eq_m256d ( r, _mm256_setr_pd ( 0.0 , 16.0 , 32.0 , 48.0 ) ) ;
5910
5909
}
5911
5910
0 commit comments