Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
bytecodealliance
GitHub Repository: bytecodealliance/wasmtime
Path: blob/main/cranelift/codegen/shared/src/constants.rs
1692 views
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
// 0x100-0x17f: Dynamic Vector types
12
//
13
// Vector types are encoded with the lane type in the low 4 bits and log2(lanes)
14
// in the next highest 4 bits, giving a range of 2-256 lanes.
15
16
// Dynamic vector types are encoded similarly.
17
18
/// Start of the lane types.
19
pub const LANE_BASE: u16 = 0x70;
20
21
/// Base for reference types.
22
pub const REFERENCE_BASE: u16 = 0x7E;
23
24
/// Start of the 2-lane vector types.
25
pub const VECTOR_BASE: u16 = 0x80;
26
27
/// Start of the dynamic vector types.
28
pub const DYNAMIC_VECTOR_BASE: u16 = 0x100;
29
30