1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
//use crate::ast::InterfaceType;

/// Represents all the possible WIT instructions.
#[derive(PartialEq, Debug)]
pub enum Instruction {
    /// The `arg.get` instruction.
    ArgumentGet {
        /// The argument index.
        index: u32,
    },

    /// The `call-core` instruction.
    CallCore {
        /// The function index.
        function_index: usize,
    },

    /// The `memory-to-string` instruction.
    MemoryToString,

    /// The `string-to-memory` instruction.
    StringToMemory {
        /// The allocator function index.
        allocator_index: u32,
    },

    /// The `i32-to-s8,` instruction.
    I32ToS8,

    /// The `i32-to-s8x,` instruction.
    I32ToS8X,

    /// The `i32-to-u8,` instruction.
    I32ToU8,

    /// The `i32-to-s16,` instruction.
    I32ToS16,

    /// The `i32-to-s16x,` instruction.
    I32ToS16X,

    /// The `i32-to-u16,` instruction.
    I32ToU16,

    /// The `i32-to-s32,` instruction.
    I32ToS32,

    /// The `i32-to-u32,` instruction.
    I32ToU32,

    /// The `i32-to-s64,` instruction.
    I32ToS64,

    /// The `i32-to-u64,` instruction.
    I32ToU64,

    /// The `i64-to-s8,` instruction.
    I64ToS8,

    /// The `i64-to-s8x,` instruction.
    I64ToS8X,

    /// The `i64-to-u8,` instruction.
    I64ToU8,

    /// The `i64-to-s16,` instruction.
    I64ToS16,

    /// The `i64-to-s16x,` instruction.
    I64ToS16X,

    /// The `i64-to-u16,` instruction.
    I64ToU16,

    /// The `i64-to-s32,` instruction.
    I64ToS32,

    /// The `i64-to-s32x,` instruction.
    I64ToS32X,

    /// The `i64-to-u32,` instruction.
    I64ToU32,

    /// The `i64-to-s64,` instruction.
    I64ToS64,

    /// The `i64-to-u64,` instruction.
    I64ToU64,

    /// The `s8-to-i32,` instruction.
    S8ToI32,

    /// The `u8-to-i32,` instruction.
    U8ToI32,

    /// The `s16-to-i32,` instruction.
    S16ToI32,

    /// The `u16-to-i32,` instruction.
    U16ToI32,

    /// The `s32-to-i32,` instruction.
    S32ToI32,

    /// The `u32-to-i32,` instruction.
    U32ToI32,

    /// The `s64-to-i32,` instruction.
    S64ToI32,

    /// The `s64-to-i32x,` instruction.
    S64ToI32X,

    /// The `u64-to-i32,` instruction.
    U64ToI32,

    /// The `u64-to-i32x,` instruction.
    U64ToI32X,

    /// The `s8-to-i64,` instruction.
    S8ToI64,

    /// The `u8-to-i64,` instruction.
    U8ToI64,

    /// The `s16-to-i64,` instruction.
    S16ToI64,

    /// The `u16-to-i64,` instruction.
    U16ToI64,

    /// The `s32-to-i64,` instruction.
    S32ToI64,

    /// The `u32-to-i64,` instruction.
    U32ToI64,

    /// The `s64-to-i64,` instruction.
    S64ToI64,

    /// The `u64-to-i64,` instruction.
    U64ToI64,
}