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
//! Operation codes for QVM instructions.
//! TODO: Does this have to be in its own mod?

// These should match the names in ioquake3
#[allow(non_camel_case_types)]
#[allow(missing_docs)]
/// Operation code for a QVM instruction.
///
/// See ioquake3's `opcode_t` in [qcommon/vm_local.h](https://github.com/ioquake/ioq3/blob/master/code/qcommon/vm_local.h).
/// See `bytecode::Instruction` for the related, higher-level types.
#[derive(Debug, Clone, Copy)]
pub enum Opcode {
    UNDEF,

    IGNORE,

    BREAK,

    ENTER,
    LEAVE,
    CALL,
    PUSH,
    POP,

    CONST,
    LOCAL,

    JUMP,

    EQ,
    NE,

    LTI,
    LEI,
    GTI,
    GEI,

    LTU,
    LEU,
    GTU,
    GEU,

    EQF,
    NEF,

    LTF,
    LEF,
    GTF,
    GEF,

    LOAD1,
    LOAD2,
    LOAD4,
    STORE1,
    STORE2,
    STORE4,
    ARG,

    BLOCK_COPY,

    SEX8,
    SEX16,

    NEGI,
    ADD,
    SUB,
    DIVI,
    DIVU,
    MODI,
    MODU,
    MULI,
    MULU,

    BAND,
    BOR,
    BXOR,
    BCOM,

    LSH,
    RSHI,
    RSHU,

    NEGF,
    ADDF,
    SUBF,
    DIVF,
    MULF,

    CVIF,
    CVFI,
}