We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 990c297 commit 7d6415cCopy full SHA for 7d6415c
src/test/ui/target-feature/aarch64-neon-works.rs
@@ -0,0 +1,24 @@
1
+// only-aarch64
2
+// run-pass
3
+use std::arch::aarch64::*;
4
+
5
+// Smoke test to verify aarch64 code that enables NEON compiles.
6
+fn main() {
7
+ let zero = if is_aarch64_feature_detected!("neon") {
8
+ unsafe {
9
+ let zeros = zero_vector();
10
+ vget_lane_u8::<1>(1)
11
+ }
12
+ } else {
13
+ 0
14
+ };
15
+ if cfg!(target feature = "neon") {
16
+ assert_eq!(zero, 0)
17
18
+}
19
20
21
+#[target_feature(enable = "neon")]
22
+unsafe fn zero_vector() -> uint8x16_t {
23
+ vmovq_n_u8(0)
24
0 commit comments