]> git.proxmox.com Git - rustc.git/blame - vendor/packed_simd/src/codegen/reductions/mask.rs
New upstream version 1.52.1+dfsg1
[rustc.git] / vendor / packed_simd / src / codegen / reductions / mask.rs
CommitLineData
f20569fa
XL
1//! Code generation workaround for `all()` mask horizontal reduction.
2//!
3//! Works arround [LLVM bug 36702].
4//!
5//! [LLVM bug 36702]: https://bugs.llvm.org/show_bug.cgi?id=36702
6#![allow(unused_macros)]
7
8use crate::*;
9
10crate trait All: crate::marker::Sized {
11 unsafe fn all(self) -> bool;
12}
13
14crate trait Any: crate::marker::Sized {
15 unsafe fn any(self) -> bool;
16}
17
18#[macro_use]
19mod fallback_impl;
20
21cfg_if! {
22 if #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] {
23 #[macro_use]
24 mod x86;
25 } else if #[cfg(all(target_arch = "arm", target_feature = "v7",
26 target_feature = "neon",
27 any(feature = "core_arch", libcore_neon)))] {
28 #[macro_use]
29 mod arm;
30 } else if #[cfg(all(target_arch = "aarch64", target_feature = "neon"))] {
31 #[macro_use]
32 mod aarch64;
33 } else {
34 #[macro_use]
35 mod fallback;
36 }
37}
38
39impl_mask_reductions!(m8x2);
40impl_mask_reductions!(m8x4);
41impl_mask_reductions!(m8x8);
42impl_mask_reductions!(m8x16);
43impl_mask_reductions!(m8x32);
44impl_mask_reductions!(m8x64);
45
46impl_mask_reductions!(m16x2);
47impl_mask_reductions!(m16x4);
48impl_mask_reductions!(m16x8);
49impl_mask_reductions!(m16x16);
50impl_mask_reductions!(m16x32);
51
52impl_mask_reductions!(m32x2);
53impl_mask_reductions!(m32x4);
54impl_mask_reductions!(m32x8);
55impl_mask_reductions!(m32x16);
56
57// FIXME: 64-bit single element vector
58// impl_mask_reductions!(m64x1);
59impl_mask_reductions!(m64x2);
60impl_mask_reductions!(m64x4);
61impl_mask_reductions!(m64x8);
62
63impl_mask_reductions!(m128x1);
64impl_mask_reductions!(m128x2);
65impl_mask_reductions!(m128x4);
66
67impl_mask_reductions!(msizex2);
68impl_mask_reductions!(msizex4);
69impl_mask_reductions!(msizex8);