1 //! This module contains constants that are shared between the codegen and the meta crate, so they
2 //! are kept in sync.
3 
4 // Numbering scheme for value types:
5 //
6 // 0: Void
7 // 0x01-0x6f: Special types
8 // 0x70-0x7d: Lane types
9 // 0x7e-0x7f: Reference types
10 // 0x80-0xff: Vector types
11 //
12 // Vector types are encoded with the lane type in the low 4 bits and log2(lanes)
13 // in the high 4 bits, giving a range of 2-256 lanes.
14 
15 /// Start of the lane types.
16 pub const LANE_BASE: u8 = 0x70;
17 
18 /// Base for reference types.
19 pub const REFERENCE_BASE: u8 = 0x7E;
20 
21 /// Start of the 2-lane vector types.
22 pub const VECTOR_BASE: u8 = 0x80;
23 
24 // Some constants about register classes and types.
25 
26 /// Guaranteed maximum number of top-level register classes with pressure tracking in any ISA.
27 pub const MAX_TRACKED_TOP_RCS: usize = 4;
28 
29 /// Guaranteed maximum number of register classes in any ISA.
30 pub const MAX_NUM_REG_CLASSES: usize = 32;
31