about summary refs log tree commit diff
path: root/tests/codegen
diff options
context:
space:
mode:
authorScott McMurray <scottmcm@users.noreply.github.com>2023-02-04 16:33:37 -0800
committerScott McMurray <scottmcm@users.noreply.github.com>2023-02-04 16:44:53 -0800
commitbb77860d9ccdc6a920edeedce313446545294c04 (patch)
treecc0a8bac823135036ee8529ff0931edf32cf212b /tests/codegen
parent5bc328fdeff50b742a8136d0633924514d4d76b8 (diff)
downloadrust-bb77860d9ccdc6a920edeedce313446545294c04.tar.gz
rust-bb77860d9ccdc6a920edeedce313446545294c04.zip
Add another autovectorization codegen test using array zip-map
Diffstat (limited to 'tests/codegen')
-rw-r--r--tests/codegen/autovectorize-f32x4.rs13
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/codegen/autovectorize-f32x4.rs b/tests/codegen/autovectorize-f32x4.rs
index 6b09c8fc998..9ecea53f1c0 100644
--- a/tests/codegen/autovectorize-f32x4.rs
+++ b/tests/codegen/autovectorize-f32x4.rs
@@ -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)
+}