@@ -1683,20 +1683,19 @@ pub unsafe fn _mm_mask_i64gather_epi64<const SCALE: i32>(
1683
1683
/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm256_i64gather_epi64)
1684
1684
#[ inline]
1685
1685
#[ target_feature( enable = "avx2" ) ]
1686
- #[ cfg_attr( test, assert_instr( vpgatherqq, scale = 1 ) ) ]
1687
- #[ rustc_args_required_const ( 2 ) ]
1686
+ #[ cfg_attr( test, assert_instr( vpgatherqq, SCALE = 1 ) ) ]
1687
+ #[ rustc_legacy_const_generics ( 2 ) ]
1688
1688
#[ stable( feature = "simd_x86" , since = "1.27.0" ) ]
1689
- pub unsafe fn _mm256_i64gather_epi64 ( slice : * const i64 , offsets : __m256i , scale : i32 ) -> __m256i {
1689
+ pub unsafe fn _mm256_i64gather_epi64 < const SCALE : i32 > (
1690
+ slice : * const i64 ,
1691
+ offsets : __m256i ,
1692
+ ) -> __m256i {
1693
+ static_assert_imm8_scale ! ( SCALE ) ;
1690
1694
let zero = _mm256_setzero_si256 ( ) . as_i64x4 ( ) ;
1691
1695
let neg_one = _mm256_set1_epi64x ( -1 ) . as_i64x4 ( ) ;
1692
1696
let slice = slice as * const i8 ;
1693
1697
let offsets = offsets. as_i64x4 ( ) ;
1694
- macro_rules! call {
1695
- ( $imm8: expr) => {
1696
- vpgatherqq( zero, slice, offsets, neg_one, $imm8)
1697
- } ;
1698
- }
1699
- let r = constify_imm8_gather ! ( scale, call) ;
1698
+ let r = vpgatherqq ( zero, slice, offsets, neg_one, SCALE as i8 ) ;
1700
1699
transmute ( r)
1701
1700
}
1702
1701
@@ -5860,7 +5859,7 @@ mod tests {
5860
5859
arr[ i as usize ] = i;
5861
5860
}
5862
5861
// A multiplier of 8 is word-addressing for i64s
5863
- let r = _mm256_i64gather_epi64 ( arr. as_ptr ( ) , _mm256_setr_epi64x ( 0 , 16 , 32 , 48 ) , 8 ) ;
5862
+ let r = _mm256_i64gather_epi64 :: < 8 > ( arr. as_ptr ( ) , _mm256_setr_epi64x ( 0 , 16 , 32 , 48 ) ) ;
5864
5863
assert_eq_m256i ( r, _mm256_setr_epi64x ( 0 , 16 , 32 , 48 ) ) ;
5865
5864
}
5866
5865
0 commit comments