blob: 0a048acac3be239c63c0e37f1e9bad47fc4a29e2 [file] [log] [blame] [raw]
// Compile with -C opt-level=3 -C target-cpu=native to see autovectorization
#[repr(align(64))]
pub struct Aligned<T: ?Sized>(T);
pub fn max_array(x: &mut Aligned<[f64; 65536]>, y: &Aligned<[f64; 65536]>) {
for (x, y) in x.0.iter_mut().zip(y.0.iter_mut()) {
*x = if *y > *x { *y } else { *x };
}
}