]> git.lizzy.rs Git - rust.git/blob - library/portable-simd/crates/core_simd/src/vendor/arm.rs
Auto merge of #89167 - workingjubilee:use-simd, r=MarkSimulacrum
[rust.git] / library / portable-simd / crates / core_simd / src / vendor / arm.rs
1 #![allow(unused)]
2 use crate::simd::*;
3
4 #[cfg(target_arch = "arm")]
5 use core::arch::arm::*;
6
7 #[cfg(target_arch = "aarch64")]
8 use core::arch::aarch64::*;
9
10 #[cfg(any(
11     target_arch = "aarch64",
12     all(target_arch = "arm", target_feature = "v7"),
13 ))]
14 mod neon {
15     use super::*;
16
17     from_transmute! { unsafe f32x2 => float32x2_t }
18     from_transmute! { unsafe f32x4 => float32x4_t }
19
20     from_transmute! { unsafe u8x8 => uint8x8_t }
21     from_transmute! { unsafe u8x16 => uint8x16_t }
22     from_transmute! { unsafe i8x8 => int8x8_t }
23     from_transmute! { unsafe i8x16 => int8x16_t }
24     from_transmute! { unsafe u8x8 => poly8x8_t }
25     from_transmute! { unsafe u8x16 => poly8x16_t }
26
27     from_transmute! { unsafe u16x4 => uint16x4_t }
28     from_transmute! { unsafe u16x8 => uint16x8_t }
29     from_transmute! { unsafe i16x4 => int16x4_t }
30     from_transmute! { unsafe i16x8 => int16x8_t }
31     from_transmute! { unsafe u16x4 => poly16x4_t }
32     from_transmute! { unsafe u16x8 => poly16x8_t }
33
34     from_transmute! { unsafe u32x2 => uint32x2_t }
35     from_transmute! { unsafe u32x4 => uint32x4_t }
36     from_transmute! { unsafe i32x2 => int32x2_t }
37     from_transmute! { unsafe i32x4 => int32x4_t }
38
39     from_transmute! { unsafe Simd<u64, 1> => uint64x1_t }
40     from_transmute! { unsafe u64x2 => uint64x2_t }
41     from_transmute! { unsafe Simd<i64, 1> => int64x1_t }
42     from_transmute! { unsafe i64x2 => int64x2_t }
43     from_transmute! { unsafe Simd<u64, 1> => poly64x1_t }
44     from_transmute! { unsafe u64x2 => poly64x2_t }
45 }
46
47 #[cfg(any(
48     all(target_feature = "v5te", not(target_feature = "mclass")),
49     all(target_feature = "mclass", target_feature = "dsp"),
50 ))]
51 mod dsp {
52     use super::*;
53
54     from_transmute! { unsafe Simd<u16, 2> => uint16x2_t }
55     from_transmute! { unsafe Simd<i16, 2> => int16x2_t }
56 }
57
58 #[cfg(any(
59     all(target_feature = "v6", not(target_feature = "mclass")),
60     all(target_feature = "mclass", target_feature = "dsp"),
61 ))]
62 mod simd32 {
63     use super::*;
64
65     from_transmute! { unsafe Simd<u8, 4> => uint8x4_t }
66     from_transmute! { unsafe Simd<i8, 4> => int8x4_t }
67 }
68
69 #[cfg(target_arch = "aarch64")]
70 mod aarch64 {
71     use super::neon::*;
72     use super::*;
73
74     from_transmute! { unsafe Simd<f64, 1> => float64x1_t }
75     from_transmute! { unsafe f64x2 => float64x2_t }
76 }