You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
neon vst1_* intrinsics copy many more bytes than they should. #1220
pub unsafe fn vst1q_f64(ptr: *mut f64, a: float64x2_t) {
copy_nonoverlapping(
&a as *const float64x2_t as *const f64,
ptr as *mut f64,
size_of::<float64x2_t>(),
)
}
The docs for copy_nonoverlapping says "Copies count * size_of::() bytes from src to dst"
The example above will get called with type T = f64 (with size 8 bytes), and count = size_of::<float64x2_t> = 16. So it will end up copying 8*16=128 bytes. That's quite a bit more than the 16 bytes it should have been.
The result is that it writes garbage to memory locations it should not touch.
Activity
hkratz commentedon Sep 21, 2021
There is no instance of
copy_nonoverlapping()remaining in the armv7/aarch64 intrinsics, so that all should be fixed in master, see e.g.stdarch/crates/core_arch/src/aarch64/neon/mod.rs
Lines 937 to 939 in 5fdbc47
But the stdarch submodule should be updated in the main Rust repo asap.
HEnquist commentedon Sep 21, 2021
Ah thanks, the submodule thing threw me off. Let's keep this open then until the changes have made it into the main Rust repo.
Update stdarch submodule
Auto merge of rust-lang#89145 - rusticstuff:bump_stdarch, r=kennytm
pthariensflame commentedon Sep 27, 2021
Seems like rust-lang/rust#89145 is now merged!
HEnquist commentedon Sep 28, 2021
This works fine now in the latest nightly. Closing!