-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathpz_instructions.cpp
111 lines (103 loc) · 2.23 KB
/
pz_instructions.cpp
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
/*
* Plasma bytecode instructions
* vim: ts=4 sw=4 et
*
* Copyright (C) Plasma Team
* Distributed under the terms of the MIT license, see ../LICENSE.code
*/
#include "pz_common.h"
#include "pz_instructions.h"
namespace pz {
/*
* Instruction encoding
*
*************************/
InstructionInfo instruction_info[] = {
/* PZI_LOAD_IMMEDIATE_NUM
* XXX: The immediate value is always encoded as a 32 bit number but
* this restriction should be lifted.
*/
{1, IMT_32},
/* PZI_ZE */
{2, IMT_NONE},
/* PZI_SE */
{2, IMT_NONE},
/* PZI_TRUNC */
{2, IMT_NONE},
/* PZI_ADD */
{1, IMT_NONE},
/* PZI_SUB */
{1, IMT_NONE},
/* PZI_MUL */
{1, IMT_NONE},
/* PZI_DIV */
{1, IMT_NONE},
/* PZI_MOD */
{1, IMT_NONE},
/* PZI_LSHIFT */
{1, IMT_NONE},
/* PZI_RSHIFT */
{1, IMT_NONE},
/* PZI_AND */
{1, IMT_NONE},
/* PZI_OR */
{1, IMT_NONE},
/* PZI_XOR */
{1, IMT_NONE},
/* PZI_LT_U, PZT_LT_S, PZT_GT_U and PZT_GT_S */
{1, IMT_NONE},
{1, IMT_NONE},
{1, IMT_NONE},
{1, IMT_NONE},
/* PZI_EQ */
{1, IMT_NONE},
/* PZI_NOT */
{1, IMT_NONE},
/* PZI_DROP */
{0, IMT_NONE},
/* PZI_ROLL */
{0, IMT_8},
/* PZI_PICK */
{0, IMT_8},
/* PZI_CALL */
{0, IMT_CLOSURE_REF},
/* PZI_CALL_IMPORT */
{0, IMT_IMPORT_CLOSURE_REF},
/* PZI_CALL_IND */
{0, IMT_NONE},
/* PZI_CALL_PROC */
{0, IMT_PROC_REF},
/* PZI_TCALL */
{0, IMT_CLOSURE_REF},
/* PZI_TCALL_IMPORT */
{0, IMT_IMPORT_CLOSURE_REF},
/* PZI_TCALL_IND */
{0, IMT_NONE},
/* PZI_TCALL_PROC */
{0, IMT_PROC_REF},
/* PZI_RET */
{0, IMT_NONE},
/* PZI_CJMP */
{1, IMT_LABEL_REF},
/* PZI_JMP */
{0, IMT_LABEL_REF},
/* PZI_ALLOC */
{0, IMT_STRUCT_REF},
/* PZI_MAKE_CLOSURE */
{0, IMT_PROC_REF},
/* PZI_LOAD */
{1, IMT_STRUCT_REF_FIELD},
/* PZI_STORE */
{1, IMT_STRUCT_REF_FIELD},
/* PZI_GET_ENV */
{0, IMT_NONE},
/* Non-encoded instructions */
/* PZI_END */
{0, IMT_NONE},
/* PZI_CCALL */
{0, IMT_PROC_REF},
/* PZI_CCALL_ALLOC */
{0, IMT_PROC_REF},
/* PZI_CCALL_SPECIAL */
{0, IMT_PROC_REF}};
} // namespace pz