@@ -1732,20 +1732,16 @@ pub unsafe fn _mm256_mask_i64gather_epi64<const SCALE: i32>(
1732
1732
/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_i64gather_pd)
1733
1733
#[ inline]
1734
1734
#[ target_feature( enable = "avx2" ) ]
1735
- #[ cfg_attr( test, assert_instr( vgatherqpd, scale = 1 ) ) ]
1736
- #[ rustc_args_required_const ( 2 ) ]
1735
+ #[ cfg_attr( test, assert_instr( vgatherqpd, SCALE = 1 ) ) ]
1736
+ #[ rustc_legacy_const_generics ( 2 ) ]
1737
1737
#[ stable( feature = "simd_x86" , since = "1.27.0" ) ]
1738
- pub unsafe fn _mm_i64gather_pd ( slice : * const f64 , offsets : __m128i , scale : i32 ) -> __m128d {
1738
+ pub unsafe fn _mm_i64gather_pd < const SCALE : i32 > ( slice : * const f64 , offsets : __m128i ) -> __m128d {
1739
+ static_assert_imm8_scale ! ( SCALE ) ;
1739
1740
let zero = _mm_setzero_pd ( ) ;
1740
1741
let neg_one = _mm_set1_pd ( -1.0 ) ;
1741
1742
let slice = slice as * const i8 ;
1742
1743
let offsets = offsets. as_i64x2 ( ) ;
1743
- macro_rules! call {
1744
- ( $imm8: expr) => {
1745
- pgatherqpd( zero, slice, offsets, neg_one, $imm8)
1746
- } ;
1747
- }
1748
- constify_imm8_gather ! ( scale, call)
1744
+ pgatherqpd ( zero, slice, offsets, neg_one, SCALE as i8 )
1749
1745
}
1750
1746
1751
1747
/// Returns values from `slice` at offsets determined by `offsets * scale`,
@@ -5883,7 +5879,7 @@ mod tests {
5883
5879
j += 1.0 ;
5884
5880
}
5885
5881
// A multiplier of 8 is word-addressing for f64s
5886
- let r = _mm_i64gather_pd ( arr. as_ptr ( ) , _mm_setr_epi64x ( 0 , 16 ) , 8 ) ;
5882
+ let r = _mm_i64gather_pd :: < 8 > ( arr. as_ptr ( ) , _mm_setr_epi64x ( 0 , 16 ) ) ;
5887
5883
assert_eq_m128d ( r, _mm_setr_pd ( 0.0 , 16.0 ) ) ;
5888
5884
}
5889
5885
0 commit comments