1//! Utility macros.
2
3// Helper macro used to trigger const eval errors when the const generic immediate value `imm` is
4// not a round number.
5#[allow(unused)]
6macro_rules! static_assert_rounding {
7 ($imm:ident) => {
8 static_assert!(
9 $imm == 4 || $imm == 8 || $imm == 9 || $imm == 10 || $imm == 11,
10 "Invalid IMM value"
11 )
12 };
13}
14
15// Helper macro used to trigger const eval errors when the const generic immediate value `imm` is
16// not a sae number.
17#[allow(unused)]
18macro_rules! static_assert_sae {
19 ($imm:ident) => {
20 static_assert!($imm == 4 || $imm == 8, "Invalid IMM value")
21 };
22}
23