use bitflags::bitflags;
pub const ALLOC_OVERHEAD: u32 = core::mem::size_of::<usize>() as u32 * 4;
pub const ALLOC_ALIGNMENT: u32 = 8;
pub const GROW_THRESHOLD: u32 = 1024 * 1024 * 16;
pub const MAX_TREE_HEIGHT: u32 = if cfg!(target_pointer_width = "32") {
30
} else {
61
} + 1;
pub const MAX_OP_COUNT: usize = 6;
pub const MAX_FUNC_ARGS: u32 = 32;
pub const MAX_VALUE_PACK: u32 = 4;
pub const MAX_PHYS_REGS: u32 = 32;
pub const MAX_ALIGNMENT: u32 = 64;
pub const MAX_LABEL_NAME_SIZE: u32 = 2048;
pub const MAX_SECTION_NAME_SIZE: u32 = 35;
pub const MAX_COMMENT_SIZE: u32 = 1024;
pub const INVALID_ID: u32 = 0xFFFFFFFFu32;
pub const NOT_FOUND: u32 = 0xFFFFFFFFu32;
pub const NO_BASE_ADDRESS: u64 = !0u64;
pub const NUM_VIRT_GROUPS: usize = 4;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum CondCode {
AL = 0x00,
NA = 0x01,
EQ = 0x02,
NE = 0x03,
CS = 0x04,
LO = 0x05,
MI = 0x06,
PL = 0x07,
VS = 0x08,
VC = 0x09,
HI = 0x0A,
LS = 0x0B,
GE = 0x0C,
LT = 0x0D,
GT = 0x0E,
LE = 0x0F,
}
impl CondCode {
pub const MAX_VALUE: Self = Self::LE;
pub const CC: Self = Self::LO;
pub const HS: Self = Self::CS;
}
bitflags! {
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
pub struct InstOptions: u32 {
const NONE = 0;
const RESERVED = 0x00000001;
const UNFOLLOW = 0x00000002;
const OVERWRITE = 0x00000004;
const SHORT_FORM = 0x00000010;
const LONG_FORM = 0x00000020;
const TAKEN = 0x00000040;
const NOT_TAKEN = 0x00000080;
const X86_MOD_MR = 0x00000100;
const X86_MOD_RM = 0x00000200;
const X86_VEX3 = 0x00000400;
const X86_VEX = 0x00000800;
const X86_EVEX = 0x00001000;
const X86_LOCK = 0x00002000;
const X86_REP = 0x00004000;
const X86_REPNE = 0x00008000;
const X86_XACQUIRE = 0x00010000;
const X86_XRELEASE = 0x00020000;
const X86_ER = 0x00040000;
const X86_SAE = 0x00080000;
const X86_RN_SAE = 0x00000000;
const X86_RD_SAE = 0x00200000;
const X86_RU_SAE = 0x00400000;
const X86_RZ_SAE = 0x00600000;
const X86_ZMASK = 0x00800000;
const X86_ER_MASK = Self::X86_RZ_SAE.bits();
const X86_AVX512_MASK = 0x00FC0000;
const X86_OP_CODE_B = 0x01000000;
const X86_OP_CODE_X = 0x02000000;
const X86_OP_CODE_R = 0x04000000;
const X86_OP_CODE_W = 0x08000000;
const X86_REX = 0x40000000;
const X86_INVALID_REX = 0x80000000;
}
}