2022-03-22 21:24:59 +00:00
|
|
|
// only-aarch64
|
|
|
|
// run-pass
|
2022-03-23 01:11:21 +00:00
|
|
|
#![allow(dead_code)]
|
|
|
|
use std::arch::*;
|
2022-03-22 21:24:59 +00:00
|
|
|
use std::arch::aarch64::*;
|
|
|
|
|
|
|
|
// Smoke test to verify aarch64 code that enables NEON compiles.
|
|
|
|
fn main() {
|
2022-03-23 01:11:21 +00:00
|
|
|
let _zero = if is_aarch64_feature_detected!("neon") {
|
2022-03-22 21:24:59 +00:00
|
|
|
unsafe {
|
|
|
|
let zeros = zero_vector();
|
2022-03-23 01:11:21 +00:00
|
|
|
vgetq_lane_u8::<1>(zeros)
|
2022-03-22 21:24:59 +00:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
0
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#[target_feature(enable = "neon")]
|
|
|
|
unsafe fn zero_vector() -> uint8x16_t {
|
|
|
|
vmovq_n_u8(0)
|
|
|
|
}
|