@@ -1612,24 +1612,19 @@ pub unsafe fn _mm256_i64gather_ps<const SCALE: i32>(slice: *const f32, offsets:
1612
1612
/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_mask_i64gather_ps)
1613
1613
#[ inline]
1614
1614
#[ target_feature( enable = "avx2" ) ]
1615
- #[ cfg_attr( test, assert_instr( vgatherqps, scale = 1 ) ) ]
1616
- #[ rustc_args_required_const ( 4 ) ]
1615
+ #[ cfg_attr( test, assert_instr( vgatherqps, SCALE = 1 ) ) ]
1616
+ #[ rustc_legacy_const_generics ( 4 ) ]
1617
1617
#[ stable( feature = "simd_x86" , since = "1.27.0" ) ]
1618
- pub unsafe fn _mm256_mask_i64gather_ps (
1618
+ pub unsafe fn _mm256_mask_i64gather_ps < const SCALE : i32 > (
1619
1619
src : __m128 ,
1620
1620
slice : * const f32 ,
1621
1621
offsets : __m256i ,
1622
1622
mask : __m128 ,
1623
- scale : i32 ,
1624
1623
) -> __m128 {
1624
+ static_assert_imm8_scale ! ( SCALE ) ;
1625
1625
let offsets = offsets. as_i64x4 ( ) ;
1626
1626
let slice = slice as * const i8 ;
1627
- macro_rules! call {
1628
- ( $imm8: expr) => {
1629
- vpgatherqps( src, slice, offsets, mask, $imm8)
1630
- } ;
1631
- }
1632
- constify_imm8_gather ! ( scale, call)
1627
+ vpgatherqps ( src, slice, offsets, mask, SCALE as i8 )
1633
1628
}
1634
1629
1635
1630
/// Returns values from `slice` at offsets determined by `offsets * scale`,
@@ -5828,12 +5823,11 @@ mod tests {
5828
5823
j += 1.0 ;
5829
5824
}
5830
5825
// A multiplier of 4 is word-addressing for f32s
5831
- let r = _mm256_mask_i64gather_ps (
5826
+ let r = _mm256_mask_i64gather_ps :: < 4 > (
5832
5827
_mm_set1_ps ( 256.0 ) ,
5833
5828
arr. as_ptr ( ) ,
5834
5829
_mm256_setr_epi64x ( 0 , 16 , 64 , 96 ) ,
5835
5830
_mm_setr_ps ( -1.0 , -1.0 , -1.0 , 0.0 ) ,
5836
- 4 ,
5837
5831
) ;
5838
5832
assert_eq_m128 ( r, _mm_setr_ps ( 0.0 , 16.0 , 64.0 , 256.0 ) ) ;
5839
5833
}
0 commit comments