We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3ef8e64 commit 6326300Copy full SHA for 6326300
tests/assembly/libs/issue-140207-slice-min-simd.rs
@@ -0,0 +1,13 @@
1
+//@ assembly-output: emit-asm
2
+// # avx has a dedicated instruction for this
3
+//@ compile-flags: --crate-type=lib -Ctarget-cpu=znver2 -Copt-level=3
4
+//@ only-x86_64
5
+//@ ignore-sgx
6
+// https://github.com/rust-lang/rust/issues/140207
7
+
8
+#[unsafe(no_mangle)]
9
+pub fn array_min(a: &[u16; 8]) -> u16 {
10
+ // CHECK: vphminposuw
11
+ // CHECK: ret
12
+ a.iter().copied().min().unwrap()
13
+}
0 commit comments