Skip to content

Commit cf3e316

Browse files
author
Daniel Smith
committed
Fix interface to be consistent
1 parent 3f88738 commit cf3e316

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

crates/core_arch/src/x86/avx512f.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,10 @@ pub unsafe fn _mm512_setr_epi32(
9393
#[inline]
9494
#[target_feature(enable = "avx512f")]
9595
#[cfg_attr(test, assert_instr(vpgatherdq))]
96-
pub unsafe fn _mm512_i32gather_epi64(offsets: __m256i, slice: *const i8, scale: i32) -> __m512i {
96+
pub unsafe fn _mm512_i32gather_epi64(offsets: __m256i, slice: *const u8, scale: i32) -> __m512i {
9797
let zero = _mm512_setzero_si512().as_i64x8();
9898
let neg_one = -1;
99+
let slice = slice as *const i8;
99100
let offsets = offsets.as_i32x8();
100101
macro_rules! call {
101102
($imm8:expr) => {

crates/core_arch/src/x86_64/avx512f.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,15 +237,15 @@ mod tests {
237237

238238
// _mm512_i32gather_epi64(offsets: __m256i, slice: *const i64, scale: i32)
239239
#[simd_test(enable = "avx512f")]
240-
unsafe fn test_mm512_mask_i32gather_epi64() {
240+
unsafe fn test_mm512_i32gather_epi64() {
241241
let mut arr = [0i64; 128];
242242
for i in 0..128i64 {
243243
arr[i as usize] = i;
244244
}
245245
// A multiplier of 8 is word-addressing
246246
#[rustfmt::skip]
247247
let index = _mm256_setr_epi32(0, 16, 32, 48, 64, 80, 96, 112);
248-
let r = _mm512_i32gather_epi64(index, arr.as_ptr(), 8);
248+
let r = _mm512_i32gather_epi64(index, arr.as_ptr() as *const u8, 8);
249249
assert_eq_m512i(r, _mm512_setr_epi64(0, 16, 32, 48, 64, 80, 96, 112));
250250
}
251251
}

0 commit comments

Comments
 (0)