1use bitflags::bitflags;
2
3pub const ALLOC_OVERHEAD: u32 = core::mem::size_of::<usize>() as u32 * 4;
4pub const ALLOC_ALIGNMENT: u32 = 8;
5pub const GROW_THRESHOLD: u32 = 1024 * 1024 * 16;
6pub const MAX_TREE_HEIGHT: u32 = if cfg!(target_pointer_width = "32") {
7 30
8} else {
9 61
10} + 1;
11pub const MAX_OP_COUNT: usize = 6;
12pub const MAX_FUNC_ARGS: u32 = 32;
13pub const MAX_VALUE_PACK: u32 = 4;
14pub const MAX_PHYS_REGS: u32 = 32;
15pub const MAX_ALIGNMENT: u32 = 64;
16pub const MAX_LABEL_NAME_SIZE: u32 = 2048;
17pub const MAX_SECTION_NAME_SIZE: u32 = 35;
18pub const MAX_COMMENT_SIZE: u32 = 1024;
19pub const INVALID_ID: u32 = 0xFFFFFFFFu32;
20pub const NOT_FOUND: u32 = 0xFFFFFFFFu32;
21pub const NO_BASE_ADDRESS: u64 = !0u64;
22pub const NUM_VIRT_GROUPS: usize = 4;
23
24#[derive(Debug, Clone, Copy, PartialEq, Eq)]
25pub enum CondCode {
26 AL = 0x00,
28 NA = 0x01,
30 EQ = 0x02,
32 NE = 0x03,
34 CS = 0x04,
36
37 LO = 0x05,
39
40 MI = 0x06,
42 PL = 0x07,
44 VS = 0x08,
46 VC = 0x09,
48 HI = 0x0A,
50 LS = 0x0B,
52 GE = 0x0C,
54 LT = 0x0D,
56 GT = 0x0E,
58 LE = 0x0F,
60}
61impl CondCode {
62 pub const MAX_VALUE: Self = Self::LE;
63 pub const CC: Self = Self::LO;
64 pub const HS: Self = Self::CS;
65}
66
67bitflags! {
68 pub struct InstOptions: u32 {
69 const NONE = 0;
70 const RESERVED = 0x00000001;
71 const UNFOLLOW = 0x00000002;
72 const OVERWRITE = 0x00000004;
73 const SHORT_FORM = 0x00000010;
74 const LONG_FORM = 0x00000020;
75 const TAKEN = 0x00000040;
76 const NOT_TAKEN = 0x00000080;
77 }
78}