@@ -1752,24 +1752,19 @@ pub unsafe fn _mm_i64gather_pd<const SCALE: i32>(slice: *const f64, offsets: __m
1752
1752
/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_i64gather_pd)
1753
1753
#[ inline]
1754
1754
#[ target_feature( enable = "avx2" ) ]
1755
- #[ cfg_attr( test, assert_instr( vgatherqpd, scale = 1 ) ) ]
1756
- #[ rustc_args_required_const ( 4 ) ]
1755
+ #[ cfg_attr( test, assert_instr( vgatherqpd, SCALE = 1 ) ) ]
1756
+ #[ rustc_legacy_const_generics ( 4 ) ]
1757
1757
#[ stable( feature = "simd_x86" , since = "1.27.0" ) ]
1758
- pub unsafe fn _mm_mask_i64gather_pd (
1758
+ pub unsafe fn _mm_mask_i64gather_pd < const SCALE : i32 > (
1759
1759
src : __m128d ,
1760
1760
slice : * const f64 ,
1761
1761
offsets : __m128i ,
1762
1762
mask : __m128d ,
1763
- scale : i32 ,
1764
1763
) -> __m128d {
1764
+ static_assert_imm8_scale ! ( SCALE ) ;
1765
1765
let slice = slice as * const i8 ;
1766
1766
let offsets = offsets. as_i64x2 ( ) ;
1767
- macro_rules! call {
1768
- ( $imm8: expr) => {
1769
- pgatherqpd( src, slice, offsets, mask, $imm8)
1770
- } ;
1771
- }
1772
- constify_imm8_gather ! ( scale, call)
1767
+ pgatherqpd ( src, slice, offsets, mask, SCALE as i8 )
1773
1768
}
1774
1769
1775
1770
/// Returns values from `slice` at offsets determined by `offsets * scale`,
@@ -5892,12 +5887,11 @@ mod tests {
5892
5887
j += 1.0 ;
5893
5888
}
5894
5889
// A multiplier of 8 is word-addressing for f64s
5895
- let r = _mm_mask_i64gather_pd (
5890
+ let r = _mm_mask_i64gather_pd :: < 8 > (
5896
5891
_mm_set1_pd ( 256.0 ) ,
5897
5892
arr. as_ptr ( ) ,
5898
5893
_mm_setr_epi64x ( 16 , 16 ) ,
5899
5894
_mm_setr_pd ( -1.0 , 0.0 ) ,
5900
- 8 ,
5901
5895
) ;
5902
5896
assert_eq_m128d ( r, _mm_setr_pd ( 16.0 , 256.0 ) ) ;
5903
5897
}
0 commit comments