Skip to content

Commit e5986e5

Browse files
committed
replaced mm_512 storeus impls with ptr::write_unaligned
1 parent eeeeef9 commit e5986e5

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

crates/core_arch/src/x86/avx512f.rs

+2-10
Original file line numberDiff line numberDiff line change
@@ -1675,11 +1675,7 @@ pub unsafe fn _mm512_loadu_pd(mem_addr: *const f64) -> __m512d {
16751675
#[target_feature(enable = "avx512f")]
16761676
#[cfg_attr(test, assert_instr(vmovupd))]
16771677
pub unsafe fn _mm512_storeu_pd(mem_addr: *mut f64, a: __m512d) {
1678-
ptr::copy_nonoverlapping(
1679-
&a as *const __m512d as *const u8,
1680-
mem_addr as *mut u8,
1681-
mem::size_of::<__m512d>(),
1682-
);
1678+
ptr::write_unaligned(mem_addr as *mut __m512d, a);
16831679
}
16841680

16851681
/// Loads 512-bits (composed of 16 packed single-precision (32-bit)
@@ -1704,11 +1700,7 @@ pub unsafe fn _mm512_loadu_ps(mem_addr: *const f32) -> __m512 {
17041700
#[cfg_attr(test, assert_instr(vmovups))]
17051701
#[stable(feature = "simd_x86", since = "1.27.0")]
17061702
pub unsafe fn _mm512_storeu_ps(mem_addr: *mut f32, a: __m512) {
1707-
ptr::copy_nonoverlapping(
1708-
&a as *const __m512 as *const u8,
1709-
mem_addr as *mut u8,
1710-
mem::size_of::<__m512>(),
1711-
);
1703+
ptr::write_unaligned(mem_addr as *mut __m512, a);
17121704
}
17131705

17141706
/// Equal

0 commit comments

Comments
 (0)