Skip to content

Commit cef1ecb

Browse files
committed
Change void* type for 3 intrinsics
- `_mm512_load_si512` - `_mm512_loadu_si512` - `_mm512_stream_si512`
1 parent 2a94051 commit cef1ecb

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

crates/core_arch/src/x86/avx512f.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29696,7 +29696,7 @@ pub unsafe fn _mm512_stream_pd(mem_addr: *mut f64, a: __m512d) {
2969629696
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
2969729697
#[cfg_attr(test, assert_instr(vmovntdq))]
2969829698
#[allow(clippy::cast_ptr_alignment)]
29699-
pub unsafe fn _mm512_stream_si512(mem_addr: *mut i32, a: __m512i) {
29699+
pub unsafe fn _mm512_stream_si512(mem_addr: *mut __m512i, a: __m512i) {
2970029700
crate::arch::asm!(
2970129701
vps!("vmovntdq", ",{a}"),
2970229702
p = in(reg) mem_addr,
@@ -34435,8 +34435,8 @@ pub unsafe fn _mm_storeu_epi64(mem_addr: *mut i64, a: __m128i) {
3443534435
#[target_feature(enable = "avx512f")]
3443634436
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
3443734437
#[cfg_attr(test, assert_instr(vmovups))] //should be vmovdqu32
34438-
pub unsafe fn _mm512_loadu_si512(mem_addr: *const i32) -> __m512i {
34439-
ptr::read_unaligned(mem_addr as *const __m512i)
34438+
pub unsafe fn _mm512_loadu_si512(mem_addr: *const __m512i) -> __m512i {
34439+
ptr::read_unaligned(mem_addr)
3444034440
}
3444134441

3444234442
/// Store 512-bits of integer data from a into memory. mem_addr does not need to be aligned on any particular boundary.
@@ -34509,8 +34509,8 @@ pub unsafe fn _mm512_storeu_ps(mem_addr: *mut f32, a: __m512) {
3450934509
#[target_feature(enable = "avx512f")]
3451034510
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
3451134511
#[cfg_attr(test, assert_instr(vmovaps))] //should be vmovdqa32
34512-
pub unsafe fn _mm512_load_si512(mem_addr: *const i32) -> __m512i {
34513-
ptr::read(mem_addr as *const __m512i)
34512+
pub unsafe fn _mm512_load_si512(mem_addr: *const __m512i) -> __m512i {
34513+
ptr::read(mem_addr)
3451434514
}
3451534515

3451634516
/// Store 512-bits of integer data from a into memory. mem_addr must be aligned on a 64-byte boundary or a general-protection exception may be generated.
@@ -57231,7 +57231,7 @@ mod tests {
5723157231
#[simd_test(enable = "avx512f")]
5723257232
unsafe fn test_mm512_loadu_si512() {
5723357233
let a = &[4, 3, 2, 5, 8, 9, 64, 50, -4, -3, -2, -5, -8, -9, -64, -50];
57234-
let p = a.as_ptr();
57234+
let p = a.as_ptr().cast();
5723557235
let r = _mm512_loadu_si512(black_box(p));
5723657236
let e = _mm512_setr_epi32(4, 3, 2, 5, 8, 9, 64, 50, -4, -3, -2, -5, -8, -9, -64, -50);
5723757237
assert_eq_m512i(r, e);
@@ -57254,7 +57254,7 @@ mod tests {
5725457254
let a = Align {
5725557255
data: [4, 3, 2, 5, 8, 9, 64, 50, -4, -3, -2, -5, -8, -9, -64, -50],
5725657256
};
57257-
let p = (a.data).as_ptr();
57257+
let p = (a.data).as_ptr().cast();
5725857258
let r = _mm512_load_si512(black_box(p));
5725957259
let e = _mm512_setr_epi32(4, 3, 2, 5, 8, 9, 64, 50, -4, -3, -2, -5, -8, -9, -64, -50);
5726057260
assert_eq_m512i(r, e);

crates/core_arch/src/x86/gfni.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,7 @@ mod tests {
867867
#[unstable(feature = "stdarch_x86_avx512", issue = "111137")]
868868
unsafe fn load_m512i_word<T>(data: &[T], word_index: usize) -> __m512i {
869869
let byte_offset = word_index * 64 / size_of::<T>();
870-
let pointer = data.as_ptr().add(byte_offset) as *const i32;
870+
let pointer = data.as_ptr().add(byte_offset) as *const _;
871871
_mm512_loadu_si512(black_box(pointer))
872872
}
873873

0 commit comments

Comments
 (0)