]> git.lizzy.rs Git - rust.git/blob - library/portable-simd/crates/core_simd/src/vendor.rs
Rollup merge of #91243 - jackh726:issue-91068, r=nikomatsakis
[rust.git] / library / portable-simd / crates / core_simd / src / vendor.rs
1 /// Provides implementations of `From<$a> for $b` and `From<$b> for $a` that transmutes the value.
2 #[allow(unused)]
3 macro_rules! from_transmute {
4     { unsafe $a:ty => $b:ty } => {
5         from_transmute!{ @impl $a => $b }
6         from_transmute!{ @impl $b => $a }
7     };
8     { @impl $from:ty => $to:ty } => {
9         impl core::convert::From<$from> for $to {
10             #[inline]
11             fn from(value: $from) -> $to {
12                 unsafe { core::mem::transmute(value) }
13             }
14         }
15     };
16 }
17
18 /// Conversions to x86's SIMD types.
19 #[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
20 mod x86;
21
22 #[cfg(any(target_arch = "wasm32"))]
23 mod wasm32;
24
25 #[cfg(any(target_arch = "aarch64", target_arch = "arm",))]
26 mod arm;
27
28 #[cfg(any(target_arch = "powerpc", target_arch = "powerpc64"))]
29 mod powerpc;