Sign in

    Milky2018/machv/abi does not have a README file

    AbiReturnArea

    pub(all) struct AbiReturnArea {
    size : Int
    align : Int
    } derive(Eq,
    Debug
    )

    AbiValueLocation

    pub(all) enum AbiValueLocation {
    Reg(PReg)
    Stack(offset~ : Int, size~ : Int, align~ : Int)
    ReturnArea(offset~ : Int, size~ : Int, align~ : Int)
    } derive(Eq,
    Debug
    )

    CallConventionLayout

    pub(all) struct CallConventionLayout {
    context_arg : PReg
    user_arg_gprs : Array[PReg]
    arg_fprs : Array[PReg]
    ret_gprs : Array[PReg]
    ret_fprs : Array[PReg]
    }

    Machine-level calling-convention layout chosen by an embedding or frontend.

    MachV treats this as data: target packages expose machine facts, while an embedding chooses which registers implement its internal ABI.

    CallConventionLayout::float_result_register_count

    fn CallConventionLayout::float_result_register_count(self : CallConventionLayout) -> Int

    CallConventionLayout::int_result_register_count

    fn CallConventionLayout::int_result_register_count(self : CallConventionLayout) -> Int

    CallConventionLayout::layout_overflow_stack

    fn CallConventionLayout::layout_overflow_stack(self : CallConventionLayout, int_overflow_count : Int, float_overflow_classes : Array[RegClass]) -> (Array[Int], Array[Int], Int)

    Compute overflow argument stack layout for this convention.

    Layout: [int_overflow...][float_overflow...] with V128 aligned to 16. Returned offsets are relative to the start of the overflow area.

    CallConventionLayout::requires_extra_results_ptr_for_result_counts

    fn CallConventionLayout::requires_extra_results_ptr_for_result_counts(self : CallConventionLayout, int_count : Int, float_count : Int) -> Bool

    CallConventionLayout::stack_slot_align

    fn CallConventionLayout::stack_slot_align(self : CallConventionLayout, class : RegClass) -> Int

    Stack slot alignment (bytes) for overflow arguments in this convention.

    CallConventionLayout::stack_slot_size

    fn CallConventionLayout::stack_slot_size(self : CallConventionLayout, class : RegClass) -> Int

    Stack slot size (bytes) for overflow arguments in this convention.

    ContextSlot

    pub(all) struct ContextSlot {
    id : Int
    offset : Int
    mutability : ContextSlotMutability
    cache_role : ContextSlotCacheRole
    } derive(Eq,
    Debug
    )

    Opaque embedding-context slot metadata.

    The id is owned by the embedding adapter. Reusable infrastructure may use offset, mutability, and cache_role facts without interpreting what the slot represents.

    ContextSlotCacheRole

    pub(all) enum ContextSlotCacheRole {
    NoContextCache
    ContextCache0Descriptor
    ContextCache0Source
    ContextCache1
    } derive(Eq,
    Debug
    )

    Optional physical-register cache role for a context-derived pointer.

    ContextSlotMutability

    pub(all) enum ContextSlotMutability {
    Immutable
    Mutable
    } derive(Eq,
    Debug
    )

    Whether a context slot can change while generated code for one function runs.

    EmbeddingABI

    pub(all) struct EmbeddingABI {
    call_conv : CallConventionLayout
    reg_roles : EmbeddingRegRoles
    context_layout : EmbeddingContextLayout?
    reserve_context_role : Bool
    }

    Complete ABI contract supplied by an embedding runtime.

    MachV treats this as data: the embedding owns the concrete runtime layout and calling convention policy, while reusable lowering, allocation, and emission consume this contract without interpreting product-specific names.

    EmbeddingABI::EmbeddingABI

    fn EmbeddingABI::EmbeddingABI(call_conv : CallConventionLayout, reg_roles? : EmbeddingRegRoles, context_layout? : EmbeddingContextLayout?, reserve_context_role? : Bool) -> EmbeddingABI

    EmbeddingABI::reserved_int_indices

    fn EmbeddingABI::reserved_int_indices(self : EmbeddingABI, reserve_context_cache_0? : Bool, reserve_context_cache_1? : Bool, reserve_extra_results_ptr? : Bool) -> Array[Int]

    EmbeddingContextLayout

    pub(all) struct EmbeddingContextLayout {
    slots : Array[ContextSlot]
    active_function_index_slot : Int?
    allocation_cursor_slot : Int?
    allocation_limit_slot : Int?
    }

    Machine-level offsets for an embedding-provided runtime context.

    MachV treats these as opaque offsets from the context base register. The embedding owns the concrete runtime structure and translates its layout into this shape before invoking lowering or emission.

    EmbeddingContextLayout::require_active_function_index_offset

    fn EmbeddingContextLayout::require_active_function_index_offset(self : EmbeddingContextLayout) -> Int

    EmbeddingContextLayout::require_allocation_cursor_offset

    fn EmbeddingContextLayout::require_allocation_cursor_offset(self : EmbeddingContextLayout) -> Int

    EmbeddingContextLayout::require_allocation_limit_offset

    fn EmbeddingContextLayout::require_allocation_limit_offset(self : EmbeddingContextLayout) -> Int

    EmbeddingContextLayout::require_cache_role_offset

    fn EmbeddingContextLayout::require_cache_role_offset(self : EmbeddingContextLayout, role : ContextSlotCacheRole) -> Int

    EmbeddingContextLayout::require_slot_offset

    fn EmbeddingContextLayout::require_slot_offset(self : EmbeddingContextLayout, id : Int) -> Int

    EmbeddingContextLayout::slot

    EmbeddingContextLayout::slot_offset

    fn EmbeddingContextLayout::slot_offset(self : EmbeddingContextLayout, id : Int) -> Int?

    EmbeddingContextLayout::slot_offset_for_cache_role

    fn EmbeddingContextLayout::slot_offset_for_cache_role(self : EmbeddingContextLayout, role : ContextSlotCacheRole) -> Int?

    EmbeddingRegRoles

    pub(all) struct EmbeddingRegRoles {
    context : PReg?
    context_cache_0 : PReg?
    context_cache_1 : PReg?
    extra_results_ptr : PReg?
    }

    Optional physical-register roles supplied by an embedding ABI.

    MachV does not assign semantic meaning to these registers. Embeddings use them to describe pinned context pointers, cached context-derived pointers, and an out-of-line result area pointer when their ABI requires such roles.

    EmbeddingRegRoles::none

    EmbeddingRegRoles::reserved_int_indices

    fn EmbeddingRegRoles::reserved_int_indices(self : EmbeddingRegRoles, reserve_context? : Bool, reserve_context_cache_0? : Bool, reserve_context_cache_1? : Bool, reserve_extra_results_ptr? : Bool) -> Array[Int]

    OperandConstraint

    pub(all) enum OperandConstraint {
    Any
    FixedReg(PReg)
    } derive(Eq,
    Debug
    )

    Operand constraint for register allocation Fixed register constraint handling

    PReg

    pub(all) struct PReg {
    index : Int
    class : RegClass
    } derive(Eq,
    Debug
    )

    Physical register - a real machine register
    impl Show for PReg

    Reg

    pub(all) enum Reg {
    Virtual(VReg)
    Physical(PReg)
    } derive(Eq,
    Debug
    )

    A register reference - either virtual or physical
    impl Show for Reg

    RegClass

    pub(all) enum RegClass {
    Int
    Float32
    Float64
    Vector
    } derive(Eq,
    Debug
    )

    Register class - categorizes registers by their purpose
    impl Show for RegClass

    VReg

    pub(all) struct VReg {
    id : Int
    class : RegClass
    } derive(Eq,
    Debug
    )

    Virtual register - an abstract register before register allocation
    impl Show for VReg

    Writable

    pub(all) struct Writable {
    reg : Reg
    } derive(Eq,
    Debug
    )

    A writable register reference (for instruction destinations)
    impl Show for Writable

    abi_location_stack_align

    fn abi_location_stack_align(location : AbiValueLocation) -> Int

    abi_location_stack_size

    fn abi_location_stack_size(location : AbiValueLocation) -> Int

    align_up

    fn align_up(value : Int, align : Int) -> Int

    Align value up to the next multiple of align (which must be a power of two).

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io