blob: 0638b5468c2d3284b21538d87ed35eb4da13555a [file] [log] [blame]
Kushal Das02d23a22014-04-15 23:50:06 +05301/* Auto-generated by Tools/scripts/generate_opcode_h.py */
Guido van Rossuma3309961993-07-28 09:05:47 +00002#ifndef Py_OPCODE_H
3#define Py_OPCODE_H
4#ifdef __cplusplus
5extern "C" {
6#endif
7
Guido van Rossumf70e43a1991-02-19 12:39:46 +00008
Kushal Das02d23a22014-04-15 23:50:06 +05309 /* Instruction opcodes for compiled code */
10#define POP_TOP 1
11#define ROT_TWO 2
12#define ROT_THREE 3
13#define DUP_TOP 4
14#define DUP_TOP_TWO 5
15#define NOP 9
16#define UNARY_POSITIVE 10
17#define UNARY_NEGATIVE 11
18#define UNARY_NOT 12
19#define UNARY_INVERT 15
20#define BINARY_MATRIX_MULTIPLY 16
21#define INPLACE_MATRIX_MULTIPLY 17
22#define BINARY_POWER 19
23#define BINARY_MULTIPLY 20
24#define BINARY_MODULO 22
25#define BINARY_ADD 23
26#define BINARY_SUBTRACT 24
27#define BINARY_SUBSCR 25
28#define BINARY_FLOOR_DIVIDE 26
29#define BINARY_TRUE_DIVIDE 27
30#define INPLACE_FLOOR_DIVIDE 28
31#define INPLACE_TRUE_DIVIDE 29
32#define STORE_MAP 54
33#define INPLACE_ADD 55
34#define INPLACE_SUBTRACT 56
35#define INPLACE_MULTIPLY 57
36#define INPLACE_MODULO 59
37#define STORE_SUBSCR 60
38#define DELETE_SUBSCR 61
39#define BINARY_LSHIFT 62
40#define BINARY_RSHIFT 63
41#define BINARY_AND 64
42#define BINARY_XOR 65
43#define BINARY_OR 66
44#define INPLACE_POWER 67
45#define GET_ITER 68
46#define PRINT_EXPR 70
47#define LOAD_BUILD_CLASS 71
48#define YIELD_FROM 72
49#define INPLACE_LSHIFT 75
50#define INPLACE_RSHIFT 76
51#define INPLACE_AND 77
52#define INPLACE_XOR 78
53#define INPLACE_OR 79
54#define BREAK_LOOP 80
55#define WITH_CLEANUP 81
56#define RETURN_VALUE 83
57#define IMPORT_STAR 84
58#define YIELD_VALUE 86
59#define POP_BLOCK 87
60#define END_FINALLY 88
61#define POP_EXCEPT 89
62#define HAVE_ARGUMENT 90
63#define STORE_NAME 90
64#define DELETE_NAME 91
65#define UNPACK_SEQUENCE 92
66#define FOR_ITER 93
67#define UNPACK_EX 94
68#define STORE_ATTR 95
69#define DELETE_ATTR 96
70#define STORE_GLOBAL 97
71#define DELETE_GLOBAL 98
72#define LOAD_CONST 100
73#define LOAD_NAME 101
74#define BUILD_TUPLE 102
75#define BUILD_LIST 103
76#define BUILD_SET 104
77#define BUILD_MAP 105
78#define LOAD_ATTR 106
79#define COMPARE_OP 107
80#define IMPORT_NAME 108
81#define IMPORT_FROM 109
82#define JUMP_FORWARD 110
83#define JUMP_IF_FALSE_OR_POP 111
84#define JUMP_IF_TRUE_OR_POP 112
85#define JUMP_ABSOLUTE 113
86#define POP_JUMP_IF_FALSE 114
87#define POP_JUMP_IF_TRUE 115
88#define LOAD_GLOBAL 116
89#define CONTINUE_LOOP 119
90#define SETUP_LOOP 120
91#define SETUP_EXCEPT 121
92#define SETUP_FINALLY 122
93#define LOAD_FAST 124
94#define STORE_FAST 125
95#define DELETE_FAST 126
96#define RAISE_VARARGS 130
97#define CALL_FUNCTION 131
98#define MAKE_FUNCTION 132
99#define BUILD_SLICE 133
100#define MAKE_CLOSURE 134
101#define LOAD_CLOSURE 135
102#define LOAD_DEREF 136
103#define STORE_DEREF 137
104#define DELETE_DEREF 138
105#define CALL_FUNCTION_VAR 140
106#define CALL_FUNCTION_KW 141
107#define CALL_FUNCTION_VAR_KW 142
108#define SETUP_WITH 143
109#define EXTENDED_ARG 144
110#define LIST_APPEND 145
111#define SET_ADD 146
112#define MAP_ADD 147
113#define LOAD_CLASSDEREF 148
Martin v. Löwis7198a522002-01-01 19:59:11 +0000114
Benjamin Petersoneec3d712008-06-11 15:59:43 +0000115/* EXCEPT_HANDLER is a special, implicit block type which is created when
116 entering an except handler. It is not an opcode but we define it here
117 as we want it to be available to both frameobject.c and ceval.c, while
118 remaining private.*/
119#define EXCEPT_HANDLER 257
120
121
Kushal Das02d23a22014-04-15 23:50:06 +0530122enum cmp_op {PyCmp_LT=Py_LT, PyCmp_LE=Py_LE, PyCmp_EQ=Py_EQ, PyCmp_NE=Py_NE,
123 PyCmp_GT=Py_GT, PyCmp_GE=Py_GE, PyCmp_IN, PyCmp_NOT_IN,
124 PyCmp_IS, PyCmp_IS_NOT, PyCmp_EXC_MATCH, PyCmp_BAD};
Guido van Rossum3f5da241990-12-20 15:06:42 +0000125
126#define HAS_ARG(op) ((op) >= HAVE_ARGUMENT)
Guido van Rossuma3309961993-07-28 09:05:47 +0000127
128#ifdef __cplusplus
129}
130#endif
131#endif /* !Py_OPCODE_H */