@@ -1634,20 +1634,19 @@ pub unsafe fn _mm256_mask_i64gather_ps<const SCALE: i32>(
1634
1634
/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_i64gather_epi64)
1635
1635
#[ inline]
1636
1636
#[ target_feature( enable = "avx2" ) ]
1637
- #[ cfg_attr( test, assert_instr( vpgatherqq, scale = 1 ) ) ]
1638
- #[ rustc_args_required_const ( 2 ) ]
1637
+ #[ cfg_attr( test, assert_instr( vpgatherqq, SCALE = 1 ) ) ]
1638
+ #[ rustc_legacy_const_generics ( 2 ) ]
1639
1639
#[ stable( feature = "simd_x86" , since = "1.27.0" ) ]
1640
- pub unsafe fn _mm_i64gather_epi64 ( slice : * const i64 , offsets : __m128i , scale : i32 ) -> __m128i {
1640
+ pub unsafe fn _mm_i64gather_epi64 < const SCALE : i32 > (
1641
+ slice : * const i64 ,
1642
+ offsets : __m128i ,
1643
+ ) -> __m128i {
1644
+ static_assert_imm8_scale ! ( SCALE ) ;
1641
1645
let zero = _mm_setzero_si128 ( ) . as_i64x2 ( ) ;
1642
1646
let neg_one = _mm_set1_epi64x ( -1 ) . as_i64x2 ( ) ;
1643
1647
let slice = slice as * const i8 ;
1644
1648
let offsets = offsets. as_i64x2 ( ) ;
1645
- macro_rules! call {
1646
- ( $imm8: expr) => {
1647
- pgatherqq( zero, slice, offsets, neg_one, $imm8)
1648
- } ;
1649
- }
1650
- let r = constify_imm8_gather ! ( scale, call) ;
1649
+ let r = pgatherqq ( zero, slice, offsets, neg_one, SCALE as i8 ) ;
1651
1650
transmute ( r)
1652
1651
}
1653
1652
@@ -5839,7 +5838,7 @@ mod tests {
5839
5838
arr[ i as usize ] = i;
5840
5839
}
5841
5840
// A multiplier of 8 is word-addressing for i64s
5842
- let r = _mm_i64gather_epi64 ( arr. as_ptr ( ) , _mm_setr_epi64x ( 0 , 16 ) , 8 ) ;
5841
+ let r = _mm_i64gather_epi64 :: < 8 > ( arr. as_ptr ( ) , _mm_setr_epi64x ( 0 , 16 ) ) ;
5843
5842
assert_eq_m128i ( r, _mm_setr_epi64x ( 0 , 16 ) ) ;
5844
5843
}
5845
5844
0 commit comments