]>
Commit | Line | Data |
---|---|---|
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 | ||
8 | use crate::*; | |
9 | ||
10 | crate trait All: crate::marker::Sized { | |
11 | unsafe fn all(self) -> bool; | |
12 | } | |
13 | ||
14 | crate trait Any: crate::marker::Sized { | |
15 | unsafe fn any(self) -> bool; | |
16 | } | |
17 | ||
18 | #[macro_use] | |
19 | mod fallback_impl; | |
20 | ||
21 | cfg_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 | ||
39 | impl_mask_reductions!(m8x2); | |
40 | impl_mask_reductions!(m8x4); | |
41 | impl_mask_reductions!(m8x8); | |
42 | impl_mask_reductions!(m8x16); | |
43 | impl_mask_reductions!(m8x32); | |
44 | impl_mask_reductions!(m8x64); | |
45 | ||
46 | impl_mask_reductions!(m16x2); | |
47 | impl_mask_reductions!(m16x4); | |
48 | impl_mask_reductions!(m16x8); | |
49 | impl_mask_reductions!(m16x16); | |
50 | impl_mask_reductions!(m16x32); | |
51 | ||
52 | impl_mask_reductions!(m32x2); | |
53 | impl_mask_reductions!(m32x4); | |
54 | impl_mask_reductions!(m32x8); | |
55 | impl_mask_reductions!(m32x16); | |
56 | ||
57 | // FIXME: 64-bit single element vector | |
58 | // impl_mask_reductions!(m64x1); | |
59 | impl_mask_reductions!(m64x2); | |
60 | impl_mask_reductions!(m64x4); | |
61 | impl_mask_reductions!(m64x8); | |
62 | ||
63 | impl_mask_reductions!(m128x1); | |
64 | impl_mask_reductions!(m128x2); | |
65 | impl_mask_reductions!(m128x4); | |
66 | ||
67 | impl_mask_reductions!(msizex2); | |
68 | impl_mask_reductions!(msizex4); | |
69 | impl_mask_reductions!(msizex8); |