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
|
#ifndef INSTR_H
#define INSTR_H
#include <functional>
#include <iostream>
#include <unordered_map>
enum Mnemonic {
ADD,
SUB,
MUL,
QUOT,
REM,
SFTR,
SFTL,
AND,
OR,
NOT,
XOR,
ADDV,
SUBV,
MULV,
DIVV,
CMP,
CEV,
LOAD,
LOADV,
ADDI,
SUBI,
SFTRI,
SFTLI,
ANDI,
ORI,
XORI,
STORE,
STOREV,
JMP,
JRL,
JAL,
BEQ,
BGT,
BUF,
BOF,
PUSH,
POP,
NOP,
};
enum Type {
R,
I,
J,
INV
};
namespace instr
{
// clang-format off
extern const std::unordered_map<unsigned int, Mnemonic> mnemonic_map;
// clang-format on
} // namespace instr
#endif /* INSTR_H_INCLUDED */
|