swift_check/arch/
cfg_macros.rs1
2macro_rules! cfg_neon {
3 ($($item:item)*) => {
4 $(
5 #[cfg(all(feature = "simd", target_arch = "aarch64", target_feature = "neon"))]
6 $item
7 )*
8 };
9}
10
11macro_rules! cfg_sse {
12 ($($item:item)*) => {
13 $(
14 #[cfg(all(feature = "simd", target_arch = "x86_64", target_feature = "sse2"))]
15 $item
16 )*
17 };
18}
19
20macro_rules! cfg_simd128 {
21 ($($item:item)*) => {
22 $(
23 #[cfg(all(feature = "simd", target_family = "wasm", target_feature = "simd128"))]
24 $item
25 )*
26 };
27}
28
29macro_rules! cfg_fallback {
30 ($($item:item)*) => {
31 $(
32 #[cfg(any(not(feature = "simd"), not(any(
33 all(target_arch = "x86_64", target_feature = "sse2"),
34 all(target_arch = "aarch64", target_feature = "neon"),
35 all(target_family = "wasm", target_feature = "simd128")
36 ))))]
37 $item
38 )*
39 };
40}
41
42macro_rules! cfg_i8 {
43 ($($item:item)*) => {
44 $(
45 #[cfg(all(feature = "simd", any(
46 all(target_arch = "x86_64", target_feature = "sse2"),
47 all(target_family = "wasm", target_feature = "simd128")
48 )))]
49 $item
50 )*
51 };
52}
53
54macro_rules! cfg_u8 {
55 ($($item:item)*) => {
56 $(
57 #[cfg(not(all(feature = "simd", any(
58 all(target_arch = "x86_64", target_feature = "sse2"),
59 all(target_family = "wasm", target_feature = "simd128")
60 ))))]
61 $item
62 )*
63 };
64}
65
66macro_rules! cfg_simd {
67 ($($item:item)*) => {
68 $(
69 #[cfg(not(any(not(feature = "simd"), not(any(
70 all(target_arch = "x86_64", target_feature = "sse2"),
71 all(target_arch = "aarch64", target_feature = "neon"),
72 all(target_family = "wasm", target_feature = "simd128")
73 )))))]
74 $item
75 )*
76 };
77}
78
79macro_rules! cfg_verify {
80 ($($item:item)*) => {
81 $(
82 #[cfg(feature = "verify")]
83 $item
84 )*
85 };
86}
87
88macro_rules! cfg_runtime {
89 ($($item:item)*) => {
90 $(
91 #[cfg(not(feature = "verify"))]
92 $item
93 )*
94 };
95}