prevent vectorizing copy_work_buffer

This commit is contained in:
Simon Renblad 2025-01-06 17:57:39 +08:00
parent 56cf0b9d33
commit b357121749

View File

@ -1,4 +1,5 @@
use core::slice; use core::slice;
use core::arch::asm;
use core_io::{Error as IoError, ErrorKind as IoErrorKind}; use core_io::{Error as IoError, ErrorKind as IoErrorKind};
use crc; use crc;
@ -39,6 +40,7 @@ pub fn copy_work_buffer(src: *mut u32, dst: *mut u32, len: isize) {
// fix for artiq-zynq#344 // fix for artiq-zynq#344
unsafe { unsafe {
for i in 0..(len / 4) { for i in 0..(len / 4) {
asm!("", options(preserves_flags, nostack, readonly));
*dst.offset(i) = *src.offset(i); *dst.offset(i) = *src.offset(i);
} }
} }