]> git.proxmox.com Git - rustc.git/blame - library/stdarch/crates/core_arch/src/x86_64/macros.rs
New upstream version 1.70.0+dfsg1
[rustc.git] / library / stdarch / crates / core_arch / src / x86_64 / macros.rs
CommitLineData
cdc7bbd5
XL
1//! Utility macros.
2
353b0b11 3// Helper macro used to trigger const eval errors when the const generic immediate value `imm` is
17df50a5 4// not a round number.
cdc7bbd5 5#[allow(unused)]
17df50a5
XL
6macro_rules! static_assert_rounding {
7 ($imm:ident) => {
353b0b11
FG
8 static_assert!(
9 $imm == 4 || $imm == 8 || $imm == 9 || $imm == 10 || $imm == 11,
10 "Invalid IMM value"
11 )
17df50a5
XL
12 };
13}
14
353b0b11 15// Helper macro used to trigger const eval errors when the const generic immediate value `imm` is
17df50a5 16// not a sae number.
cdc7bbd5 17#[allow(unused)]
17df50a5
XL
18macro_rules! static_assert_sae {
19 ($imm:ident) => {
353b0b11 20 static_assert!($imm == 4 || $imm == 8, "Invalid IMM value")
cdc7bbd5
XL
21 };
22}