quake3_qvm/
opcodes.rs

1//! Operation codes for QVM instructions.
2//! TODO: Does this have to be in its own mod?
3
4// These should match the names in ioquake3
5#[allow(non_camel_case_types)]
6#[allow(missing_docs)]
7/// Operation code for a QVM instruction.
8///
9/// See ioquake3's `opcode_t` in [qcommon/vm_local.h](https://github.com/ioquake/ioq3/blob/master/code/qcommon/vm_local.h).
10/// See `bytecode::Instruction` for the related, higher-level types.
11#[derive(Debug, Clone, Copy)]
12pub enum Opcode {
13    UNDEF,
14
15    IGNORE,
16
17    BREAK,
18
19    ENTER,
20    LEAVE,
21    CALL,
22    PUSH,
23    POP,
24
25    CONST,
26    LOCAL,
27
28    JUMP,
29
30    EQ,
31    NE,
32
33    LTI,
34    LEI,
35    GTI,
36    GEI,
37
38    LTU,
39    LEU,
40    GTU,
41    GEU,
42
43    EQF,
44    NEF,
45
46    LTF,
47    LEF,
48    GTF,
49    GEF,
50
51    LOAD1,
52    LOAD2,
53    LOAD4,
54    STORE1,
55    STORE2,
56    STORE4,
57    ARG,
58
59    BLOCK_COPY,
60
61    SEX8,
62    SEX16,
63
64    NEGI,
65    ADD,
66    SUB,
67    DIVI,
68    DIVU,
69    MODI,
70    MODU,
71    MULI,
72    MULU,
73
74    BAND,
75    BOR,
76    BXOR,
77    BCOM,
78
79    LSH,
80    RSHI,
81    RSHU,
82
83    NEGF,
84    ADDF,
85    SUBF,
86    DIVF,
87    MULF,
88
89    CVIF,
90    CVFI,
91}