We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ddb16e2 commit cdb9de7Copy full SHA for cdb9de7
tests/codegen/target-feature-inline-closure.rs
@@ -0,0 +1,33 @@
1
+// only-x86_64
2
+// compile-flags: -Copt-level=3
3
+
4
+#![crate_type = "lib"]
5
+#![feature(target_feature_11)]
6
7
+#[cfg(target_arch = "x86_64")]
8
+use std::arch::x86_64::*;
9
10
+// CHECK-LABEL: @with_avx
11
+#[no_mangle]
12
13
+#[target_feature(enable = "avx")]
14
+fn with_avx(x: __m256) -> __m256 {
15
+ // CHECK: fadd
16
+ let add = {
17
+ #[inline(always)]
18
+ |x, y| unsafe { _mm256_add_ps(x, y) }
19
+ };
20
+ add(x, x)
21
+}
22
23
+// CHECK-LABEL: @without_avx
24
25
26
+unsafe fn without_avx(x: __m256) -> __m256 {
27
+ // CHECK-NOT: fadd
28
29
30
31
32
33
0 commit comments