1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#[macro_export]
macro_rules! byte_set {
($($byte:expr,)*) => {
$crate::ByteSet::new() $(.inserting($byte))*
};
($($byte:expr),*) => {
$crate::byte_set!($($byte,)*)
};
}
macro_rules! map_reduce_chunks {
($this:expr, $other:expr, $map:tt, $reduce:tt) => {{
#[cfg(target_pointer_width = "64")]
{
($this.0[0] $map $other.0[0]) $reduce
($this.0[1] $map $other.0[1]) $reduce
($this.0[2] $map $other.0[2]) $reduce
($this.0[3] $map $other.0[3])
}
#[cfg(not(target_pointer_width = "64"))]
{
($this.0[0] $map $other.0[0]) $reduce
($this.0[1] $map $other.0[1]) $reduce
($this.0[2] $map $other.0[2]) $reduce
($this.0[3] $map $other.0[3]) $reduce
($this.0[4] $map $other.0[4]) $reduce
($this.0[5] $map $other.0[5]) $reduce
($this.0[6] $map $other.0[6]) $reduce
($this.0[7] $map $other.0[7])
}
}};
}
macro_rules! map_chunks {
($this:expr, $map:tt) => {{
#[cfg(target_pointer_width = "64")]
{
ByteSet([
$map $this.0[0], $map $this.0[1],
$map $this.0[2], $map $this.0[3],
])
}
#[cfg(not(target_pointer_width = "64"))]
{
ByteSet([
$map $this.0[0], $map $this.0[1],
$map $this.0[2], $map $this.0[3],
$map $this.0[4], $map $this.0[5],
$map $this.0[6], $map $this.0[7],
])
}
}};
($this:expr, $map:tt, $other:expr) => {{
#[cfg(target_pointer_width = "64")]
{
ByteSet([
($this.0[0] $map $other.0[0]), ($this.0[1] $map $other.0[1]),
($this.0[2] $map $other.0[2]), ($this.0[3] $map $other.0[3]),
])
}
#[cfg(not(target_pointer_width = "64"))]
{
ByteSet([
($this.0[0] $map $other.0[0]), ($this.0[1] $map $other.0[1]),
($this.0[2] $map $other.0[2]), ($this.0[3] $map $other.0[3]),
($this.0[4] $map $other.0[4]), ($this.0[5] $map $other.0[5]),
($this.0[6] $map $other.0[6]), ($this.0[7] $map $other.0[7]),
])
}
}};
}