mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-30 22:12:15 +00:00
Add another autovectorization codegen test using array zip-map
This commit is contained in:
parent
5bc328fdef
commit
bb77860d9c
@ -1,6 +1,7 @@
|
||||
// compile-flags: -C opt-level=3
|
||||
// compile-flags: -C opt-level=3 -Z merge-functions=disabled
|
||||
// only-x86_64
|
||||
#![crate_type = "lib"]
|
||||
#![feature(array_zip)]
|
||||
|
||||
// CHECK-LABEL: @auto_vectorize_direct
|
||||
#[no_mangle]
|
||||
@ -30,3 +31,13 @@ pub fn auto_vectorize_loop(a: [f32; 4], b: [f32; 4]) -> [f32; 4] {
|
||||
}
|
||||
c
|
||||
}
|
||||
|
||||
// CHECK-LABEL: @auto_vectorize_array_zip_map
|
||||
#[no_mangle]
|
||||
pub fn auto_vectorize_array_zip_map(a: [f32; 4], b: [f32; 4]) -> [f32; 4] {
|
||||
// CHECK: load <4 x float>
|
||||
// CHECK: load <4 x float>
|
||||
// CHECK: fadd <4 x float>
|
||||
// CHECK: store <4 x float>
|
||||
a.zip(b).map(|(a, b)| a + b)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user