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
#[allow(unused)]
macro_rules! constify_imm4_round {
($imm8:expr, $expand:ident) => {
#[allow(overflowing_literals)]
match ($imm8) & 0b1111 {
4 => $expand!(4),
8 => $expand!(8),
9 => $expand!(9),
10 => $expand!(10),
11 => $expand!(11),
_ => panic!("Invalid round value"),
}
};
}
#[allow(unused)]
macro_rules! constify_imm4_sae {
($imm8:expr, $expand:ident) => {
#[allow(overflowing_literals)]
match ($imm8) & 0b1111 {
4 => $expand!(4),
8 => $expand!(8),
_ => panic!("Invalid sae value"),
}
};
}