convert _mm_mask_i64gather_pd to const generics
This commit is contained in:
parent
5a6192ae64
commit
6e89c87395
1 changed files with 6 additions and 12 deletions
|
|
@ -1752,24 +1752,19 @@ pub unsafe fn _mm_i64gather_pd<const SCALE: i32>(slice: *const f64, offsets: __m
|
|||
/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_mask_i64gather_pd)
|
||||
#[inline]
|
||||
#[target_feature(enable = "avx2")]
|
||||
#[cfg_attr(test, assert_instr(vgatherqpd, scale = 1))]
|
||||
#[rustc_args_required_const(4)]
|
||||
#[cfg_attr(test, assert_instr(vgatherqpd, SCALE = 1))]
|
||||
#[rustc_legacy_const_generics(4)]
|
||||
#[stable(feature = "simd_x86", since = "1.27.0")]
|
||||
pub unsafe fn _mm_mask_i64gather_pd(
|
||||
pub unsafe fn _mm_mask_i64gather_pd<const SCALE: i32>(
|
||||
src: __m128d,
|
||||
slice: *const f64,
|
||||
offsets: __m128i,
|
||||
mask: __m128d,
|
||||
scale: i32,
|
||||
) -> __m128d {
|
||||
static_assert_imm8_scale!(SCALE);
|
||||
let slice = slice as *const i8;
|
||||
let offsets = offsets.as_i64x2();
|
||||
macro_rules! call {
|
||||
($imm8:expr) => {
|
||||
pgatherqpd(src, slice, offsets, mask, $imm8)
|
||||
};
|
||||
}
|
||||
constify_imm8_gather!(scale, call)
|
||||
pgatherqpd(src, slice, offsets, mask, SCALE as i8)
|
||||
}
|
||||
|
||||
/// Returns values from `slice` at offsets determined by `offsets * scale`,
|
||||
|
|
@ -5892,12 +5887,11 @@ mod tests {
|
|||
j += 1.0;
|
||||
}
|
||||
// A multiplier of 8 is word-addressing for f64s
|
||||
let r = _mm_mask_i64gather_pd(
|
||||
let r = _mm_mask_i64gather_pd::<8>(
|
||||
_mm_set1_pd(256.0),
|
||||
arr.as_ptr(),
|
||||
_mm_setr_epi64x(16, 16),
|
||||
_mm_setr_pd(-1.0, 0.0),
|
||||
8,
|
||||
);
|
||||
assert_eq_m128d(r, _mm_setr_pd(16.0, 256.0));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue