codegen: add a 'size' argument to ALU_WRITES_FLAGS
[ajla.git] / code-op.h
blob9518bd28dd3f3a6afd15255031bc9ab688f34b24
1 /*
2 * Copyright (C) 2024 Mikulas Patocka
4 * This file is part of Ajla.
6 * Ajla is free software: you can redistribute it and/or modify it under the
7 * terms of the GNU General Public License as published by the Free Software
8 * Foundation, either version 3 of the License, or (at your option) any later
9 * version.
11 * Ajla is distributed in the hope that it will be useful, but WITHOUT ANY
12 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
13 * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along with
16 * Ajla. If not, see <https://www.gnu.org/licenses/>.
19 #ifndef AJLA_OPCODE_H
20 #define AJLA_OPCODE_H
22 typedef uint16_t code_t;
24 #define OPCODE_MASK 0xffff
26 #define OPCODE_OP_FLAG_STRICT 0x0001
27 #define OPCODE_FLAG_FREE_ARGUMENT 0x0002
28 #define OPCODE_FLAG_FREE_ARGUMENT_2 0x0004
29 #define OPCODE_CALL_MAY_LEND 0x0004 /* OPCODE_FLAG_FREE_ARGUMENT must not be set */
30 #define OPCODE_CALL_MAY_GIVE 0x0008 /* OPCODE_FLAG_FREE_ARGUMENT must be set */
31 #define OPCODE_FLAG_FUSED 0x0008
32 #define OPCODE_ARRAY_FILL_FLAG_SPARSE 0x0004
33 #define OPCODE_ARRAY_INDEX_IN_RANGE 0x0004
34 #define OPCODE_STRUCT_MAY_BORROW 0x0008
35 #define FLAG_NEED_BOTH_EXCEPTIONS_TO_FAIL 0x0100 /* not used in code, used internally in ipret.c */
36 #define FLAG_FIRST_EXCEPTION 0x0200 /* not used in code, used internally in ipret.c */
37 #define FLAG_TESTING_FOR_EXCEPTION 0x0400 /* not used in code, used internally in ipret.c */
38 #define OPCODE_MAY_RETURN_FLAT 0x0001
40 #define OPCODE_FIXED_OP_MULT 1
41 #define OPCODE_FIXED_OP_add 0
42 #define OPCODE_FIXED_OP_subtract 1
43 #define OPCODE_FIXED_OP_multiply 2
44 #define OPCODE_FIXED_OP_divide 3
45 #define OPCODE_FIXED_OP_divide_alt1 4
46 #define OPCODE_FIXED_OP_udivide 5
47 #define OPCODE_FIXED_OP_udivide_alt1 6
48 #define OPCODE_FIXED_OP_modulo 7
49 #define OPCODE_FIXED_OP_modulo_alt1 8
50 #define OPCODE_FIXED_OP_umodulo 9
51 #define OPCODE_FIXED_OP_umodulo_alt1 10
52 #define OPCODE_FIXED_OP_power 11
53 #define OPCODE_FIXED_OP_and 12
54 #define OPCODE_FIXED_OP_or 13
55 #define OPCODE_FIXED_OP_xor 14
56 #define OPCODE_FIXED_OP_shl 15
57 #define OPCODE_FIXED_OP_shr 16
58 #define OPCODE_FIXED_OP_ushr 17
59 #define OPCODE_FIXED_OP_rol 18
60 #define OPCODE_FIXED_OP_ror 19
61 #define OPCODE_FIXED_OP_bts 20
62 #define OPCODE_FIXED_OP_btr 21
63 #define OPCODE_FIXED_OP_btc 22
64 #define OPCODE_FIXED_OP_equal 23
65 #define OPCODE_FIXED_OP_not_equal 24
66 #define OPCODE_FIXED_OP_less 25
67 #define OPCODE_FIXED_OP_less_equal 26
68 #define OPCODE_FIXED_OP_greater 27
69 #define OPCODE_FIXED_OP_greater_equal 28
70 #define OPCODE_FIXED_OP_uless 29
71 #define OPCODE_FIXED_OP_uless_equal 30
72 #define OPCODE_FIXED_OP_ugreater 31
73 #define OPCODE_FIXED_OP_ugreater_equal 32
74 #define OPCODE_FIXED_OP_bt 33
75 #define OPCODE_FIXED_OP_C 34
76 #define OPCODE_FIXED_OP_C_add 34
77 #define OPCODE_FIXED_OP_C_subtract 35
78 #define OPCODE_FIXED_OP_C_multiply 36
79 #define OPCODE_FIXED_OP_C_divide 37
80 #define OPCODE_FIXED_OP_C_divide_alt1 38
81 #define OPCODE_FIXED_OP_C_udivide 39
82 #define OPCODE_FIXED_OP_C_udivide_alt1 40
83 #define OPCODE_FIXED_OP_C_modulo 41
84 #define OPCODE_FIXED_OP_C_modulo_alt1 42
85 #define OPCODE_FIXED_OP_C_umodulo 43
86 #define OPCODE_FIXED_OP_C_umodulo_alt1 44
87 #define OPCODE_FIXED_OP_C_power 45
88 #define OPCODE_FIXED_OP_C_and 46
89 #define OPCODE_FIXED_OP_C_or 47
90 #define OPCODE_FIXED_OP_C_xor 48
91 #define OPCODE_FIXED_OP_C_shl 49
92 #define OPCODE_FIXED_OP_C_shr 50
93 #define OPCODE_FIXED_OP_C_ushr 51
94 #define OPCODE_FIXED_OP_C_rol 52
95 #define OPCODE_FIXED_OP_C_ror 53
96 #define OPCODE_FIXED_OP_C_bts 54
97 #define OPCODE_FIXED_OP_C_btr 55
98 #define OPCODE_FIXED_OP_C_btc 56
99 #define OPCODE_FIXED_OP_C_equal 57
100 #define OPCODE_FIXED_OP_C_not_equal 58
101 #define OPCODE_FIXED_OP_C_less 59
102 #define OPCODE_FIXED_OP_C_less_equal 60
103 #define OPCODE_FIXED_OP_C_greater 61
104 #define OPCODE_FIXED_OP_C_greater_equal 62
105 #define OPCODE_FIXED_OP_C_uless 63
106 #define OPCODE_FIXED_OP_C_uless_equal 64
107 #define OPCODE_FIXED_OP_C_ugreater 65
108 #define OPCODE_FIXED_OP_C_ugreater_equal 66
109 #define OPCODE_FIXED_OP_C_bt 67
110 #define OPCODE_FIXED_OP_UNARY 68
111 #define OPCODE_FIXED_OP_not 68
112 #define OPCODE_FIXED_OP_neg 69
113 #define OPCODE_FIXED_OP_bswap 70
114 #define OPCODE_FIXED_OP_bswap_alt1 71
115 #define OPCODE_FIXED_OP_brev 72
116 #define OPCODE_FIXED_OP_brev_alt1 73
117 #define OPCODE_FIXED_OP_bsf 74
118 #define OPCODE_FIXED_OP_bsf_alt1 75
119 #define OPCODE_FIXED_OP_bsr 76
120 #define OPCODE_FIXED_OP_bsr_alt1 77
121 #define OPCODE_FIXED_OP_popcnt 78
122 #define OPCODE_FIXED_OP_popcnt_alt1 79
123 #define OPCODE_FIXED_OP_to_int 80
124 #define OPCODE_FIXED_OP_uto_int 81
125 #define OPCODE_FIXED_OP_from_int 82
126 #define OPCODE_FIXED_OP_ufrom_int 83
127 #define OPCODE_FIXED_OP_N 84
128 #define OPCODE_FIXED_OP_move 84
129 #define OPCODE_FIXED_OP_copy 85
130 #define OPCODE_FIXED_OP_ldc 86
131 #define OPCODE_FIXED_OP_ldc16 87
133 #define OPCODE_FIXED_TYPE_MULT 88
134 #define OPCODE_FIXED_TYPE_int8_t 0
135 #define OPCODE_FIXED_TYPE_int16_t 1
136 #define OPCODE_FIXED_TYPE_int32_t 2
137 #define OPCODE_FIXED_TYPE_int64_t 3
138 #define OPCODE_FIXED_TYPE_int128_t 4
140 #define OPCODE_INT_OP_MULT 1
141 #define OPCODE_INT_OP_add 0
142 #define OPCODE_INT_OP_subtract 1
143 #define OPCODE_INT_OP_multiply 2
144 #define OPCODE_INT_OP_divide 3
145 #define OPCODE_INT_OP_divide_alt1 4
146 #define OPCODE_INT_OP_modulo 5
147 #define OPCODE_INT_OP_modulo_alt1 6
148 #define OPCODE_INT_OP_power 7
149 #define OPCODE_INT_OP_and 8
150 #define OPCODE_INT_OP_or 9
151 #define OPCODE_INT_OP_xor 10
152 #define OPCODE_INT_OP_shl 11
153 #define OPCODE_INT_OP_shr 12
154 #define OPCODE_INT_OP_bts 13
155 #define OPCODE_INT_OP_btr 14
156 #define OPCODE_INT_OP_btc 15
157 #define OPCODE_INT_OP_equal 16
158 #define OPCODE_INT_OP_not_equal 17
159 #define OPCODE_INT_OP_less 18
160 #define OPCODE_INT_OP_less_equal 19
161 #define OPCODE_INT_OP_greater 20
162 #define OPCODE_INT_OP_greater_equal 21
163 #define OPCODE_INT_OP_bt 22
164 #define OPCODE_INT_OP_C 23
165 #define OPCODE_INT_OP_C_add 23
166 #define OPCODE_INT_OP_C_subtract 24
167 #define OPCODE_INT_OP_C_multiply 25
168 #define OPCODE_INT_OP_C_divide 26
169 #define OPCODE_INT_OP_C_divide_alt1 27
170 #define OPCODE_INT_OP_C_modulo 28
171 #define OPCODE_INT_OP_C_modulo_alt1 29
172 #define OPCODE_INT_OP_C_power 30
173 #define OPCODE_INT_OP_C_and 31
174 #define OPCODE_INT_OP_C_or 32
175 #define OPCODE_INT_OP_C_xor 33
176 #define OPCODE_INT_OP_C_shl 34
177 #define OPCODE_INT_OP_C_shr 35
178 #define OPCODE_INT_OP_C_bts 36
179 #define OPCODE_INT_OP_C_btr 37
180 #define OPCODE_INT_OP_C_btc 38
181 #define OPCODE_INT_OP_C_equal 39
182 #define OPCODE_INT_OP_C_not_equal 40
183 #define OPCODE_INT_OP_C_less 41
184 #define OPCODE_INT_OP_C_less_equal 42
185 #define OPCODE_INT_OP_C_greater 43
186 #define OPCODE_INT_OP_C_greater_equal 44
187 #define OPCODE_INT_OP_C_bt 45
188 #define OPCODE_INT_OP_UNARY 46
189 #define OPCODE_INT_OP_not 46
190 #define OPCODE_INT_OP_neg 47
191 #define OPCODE_INT_OP_bsf 48
192 #define OPCODE_INT_OP_bsr 49
193 #define OPCODE_INT_OP_popcnt 50
194 #define OPCODE_INT_OP_popcnt_alt1 51
195 #define OPCODE_INT_OP_to_int 52
196 #define OPCODE_INT_OP_from_int 53
197 #define OPCODE_INT_OP_N 54
198 #define OPCODE_INT_OP_move 54
199 #define OPCODE_INT_OP_copy 55
200 #define OPCODE_INT_OP_ldc 56
201 #define OPCODE_INT_OP_ldc16 57
203 #define OPCODE_INT_TYPE_MULT 58
204 #define OPCODE_INT_TYPE_int8_t 0
205 #define OPCODE_INT_TYPE_int16_t 1
206 #define OPCODE_INT_TYPE_int32_t 2
207 #define OPCODE_INT_TYPE_int64_t 3
208 #define OPCODE_INT_TYPE_int128_t 4
210 #define OPCODE_REAL_OP_MULT 1
211 #define OPCODE_REAL_OP_add 0
212 #define OPCODE_REAL_OP_add_alt1 1
213 #define OPCODE_REAL_OP_add_alt2 2
214 #define OPCODE_REAL_OP_subtract 3
215 #define OPCODE_REAL_OP_subtract_alt1 4
216 #define OPCODE_REAL_OP_subtract_alt2 5
217 #define OPCODE_REAL_OP_multiply 6
218 #define OPCODE_REAL_OP_multiply_alt1 7
219 #define OPCODE_REAL_OP_multiply_alt2 8
220 #define OPCODE_REAL_OP_divide 9
221 #define OPCODE_REAL_OP_divide_alt1 10
222 #define OPCODE_REAL_OP_divide_alt2 11
223 #define OPCODE_REAL_OP_modulo 12
224 #define OPCODE_REAL_OP_power 13
225 #define OPCODE_REAL_OP_ldexp 14
226 #define OPCODE_REAL_OP_atan2 15
227 #define OPCODE_REAL_OP_equal 16
228 #define OPCODE_REAL_OP_equal_alt1 17
229 #define OPCODE_REAL_OP_equal_alt2 18
230 #define OPCODE_REAL_OP_not_equal 19
231 #define OPCODE_REAL_OP_not_equal_alt1 20
232 #define OPCODE_REAL_OP_not_equal_alt2 21
233 #define OPCODE_REAL_OP_less 22
234 #define OPCODE_REAL_OP_less_alt1 23
235 #define OPCODE_REAL_OP_less_alt2 24
236 #define OPCODE_REAL_OP_less_equal 25
237 #define OPCODE_REAL_OP_less_equal_alt1 26
238 #define OPCODE_REAL_OP_less_equal_alt2 27
239 #define OPCODE_REAL_OP_greater 28
240 #define OPCODE_REAL_OP_greater_alt1 29
241 #define OPCODE_REAL_OP_greater_alt2 30
242 #define OPCODE_REAL_OP_greater_equal 31
243 #define OPCODE_REAL_OP_greater_equal_alt1 32
244 #define OPCODE_REAL_OP_greater_equal_alt2 33
245 #define OPCODE_REAL_OP_UNARY 34
246 #define OPCODE_REAL_OP_neg 34
247 #define OPCODE_REAL_OP_neg_alt1 35
248 #define OPCODE_REAL_OP_neg_alt2 36
249 #define OPCODE_REAL_OP_sqrt 37
250 #define OPCODE_REAL_OP_sqrt_alt1 38
251 #define OPCODE_REAL_OP_sqrt_alt2 39
252 #define OPCODE_REAL_OP_cbrt 41
253 #define OPCODE_REAL_OP_sin 42
254 #define OPCODE_REAL_OP_cos 43
255 #define OPCODE_REAL_OP_tan 44
256 #define OPCODE_REAL_OP_asin 45
257 #define OPCODE_REAL_OP_acos 46
258 #define OPCODE_REAL_OP_atan 47
259 #define OPCODE_REAL_OP_sinh 48
260 #define OPCODE_REAL_OP_cosh 49
261 #define OPCODE_REAL_OP_tanh 50
262 #define OPCODE_REAL_OP_asinh 51
263 #define OPCODE_REAL_OP_acosh 52
264 #define OPCODE_REAL_OP_atanh 53
265 #define OPCODE_REAL_OP_exp2 54
266 #define OPCODE_REAL_OP_exp 55
267 #define OPCODE_REAL_OP_exp10 56
268 #define OPCODE_REAL_OP_log2 57
269 #define OPCODE_REAL_OP_log 58
270 #define OPCODE_REAL_OP_log10 59
271 #define OPCODE_REAL_OP_round 60
272 #define OPCODE_REAL_OP_floor 61
273 #define OPCODE_REAL_OP_ceil 62
274 #define OPCODE_REAL_OP_trunc 63
275 #define OPCODE_REAL_OP_fract 64
276 #define OPCODE_REAL_OP_mantissa 65
277 #define OPCODE_REAL_OP_exponent 66
278 #define OPCODE_REAL_OP_next_number 67
279 #define OPCODE_REAL_OP_prev_number 68
280 #define OPCODE_REAL_OP_to_int 69
281 #define OPCODE_REAL_OP_to_int_alt1 70
282 #define OPCODE_REAL_OP_to_int_alt2 71
283 #define OPCODE_REAL_OP_from_int 72
284 #define OPCODE_REAL_OP_from_int_alt1 73
285 #define OPCODE_REAL_OP_from_int_alt2 74
286 #define OPCODE_REAL_OP_is_exception 75
287 #define OPCODE_REAL_OP_is_exception_alt1 76
288 #define OPCODE_REAL_OP_is_exception_alt2 77
289 #define OPCODE_REAL_OP_N 78
290 #define OPCODE_REAL_OP_move 78
291 #define OPCODE_REAL_OP_copy 79
292 #define OPCODE_REAL_OP_ldc 80
294 #define OPCODE_REAL_TYPE_MULT 81
295 #define OPCODE_REAL_TYPE_real16_t 0
296 #define OPCODE_REAL_TYPE_real32_t 1
297 #define OPCODE_REAL_TYPE_real64_t 2
298 #define OPCODE_REAL_TYPE_real80_t 3
299 #define OPCODE_REAL_TYPE_real128_t 4
301 #define OPCODE_BOOL_OP_MULT 1
302 #define OPCODE_BOOL_OP_and 0
303 #define OPCODE_BOOL_OP_or 1
304 #define OPCODE_BOOL_OP_equal 2
305 #define OPCODE_BOOL_OP_not_equal 3
306 #define OPCODE_BOOL_OP_less 4
307 #define OPCODE_BOOL_OP_less_equal 5
308 #define OPCODE_BOOL_OP_greater 6
309 #define OPCODE_BOOL_OP_greater_equal 7
310 #define OPCODE_BOOL_OP_UNARY 8
311 #define OPCODE_BOOL_OP_not 8
312 #define OPCODE_BOOL_OP_N 9
313 #define OPCODE_BOOL_OP_move 9
314 #define OPCODE_BOOL_OP_copy 10
316 #define OPCODE_BOOL_TYPE_MULT 11
318 #define OPCODE_FIXED_OP 0
319 #define OPCODE_INT_OP (OPCODE_FIXED_OP + OPCODE_FIXED_TYPE_MULT * TYPE_FIXED_N)
320 #define OPCODE_REAL_OP (OPCODE_INT_OP + OPCODE_INT_TYPE_MULT * TYPE_INT_N)
321 #define OPCODE_BOOL_OP (OPCODE_REAL_OP + OPCODE_REAL_TYPE_MULT * TYPE_REAL_N)
322 #define OPCODE_EXTRA (OPCODE_BOOL_OP + OPCODE_BOOL_TYPE_MULT)
324 enum {
325 OPCODE_INT_LDC_LONG = OPCODE_EXTRA,
326 OPCODE_IS_EXCEPTION, /* src, dest, strict flag */
327 OPCODE_EXCEPTION_CLASS, /* src, dest, strict flag */
328 OPCODE_EXCEPTION_TYPE, /* src, dest, strict flag */
329 OPCODE_EXCEPTION_AUX, /* src, dest, strict flag */
330 OPCODE_SYSTEM_PROPERTY, /* src, dest, strict flag */
331 OPCODE_FLAT_MOVE,
332 OPCODE_FLAT_COPY,
333 OPCODE_REF_MOVE,
334 OPCODE_REF_MOVE_CLEAR,
335 OPCODE_REF_COPY,
336 OPCODE_BOX_MOVE_CLEAR,
337 OPCODE_BOX_COPY,
338 OPCODE_TAKE_BORROWED,
339 OPCODE_DEREFERENCE,
340 OPCODE_DEREFERENCE_CLEAR,
341 OPCODE_EVAL,
342 OPCODE_ESCAPE_NONFLAT,
343 OPCODE_CHECKPOINT,
344 OPCODE_JMP,
345 OPCODE_JMP_BACK_16,
346 OPCODE_JMP_FALSE, /* var, false_offset*2, exception_offset*2 */
347 OPCODE_LABEL,
348 OPCODE_LOAD_FN, /* n_arg, result, fn_idx, [arg_var, arg_deref] */
349 OPCODE_CURRY, /* n_arg, result, fn_thunk, fn_deref, [arg_var, arg_deref] */
350 OPCODE_CALL, /* n_arg, n_ret, fn_idx, [arg_var, arg_deref], [ret_var(32), ret_flag(16)] */
351 OPCODE_CALL_STRICT, /* n_arg, n_ret, fn_idx, [arg_var, arg_deref], [ret_var(32), ret_flag(16)] */
352 OPCODE_CALL_SPARK, /* n_arg, n_ret, fn_idx, [arg_var, arg_deref], [ret_var(32), ret_flag(16)] */
353 OPCODE_CALL_LAZY, /* n_arg, n_ret, fn_idx, [arg_var, arg_deref], [ret_var(32), ret_flag(16)] */
354 OPCODE_CALL_CACHE, /* n_arg, n_ret, fn_idx, [arg_var, arg_deref], [ret_var(32), ret_flag(16)] */
355 OPCODE_CALL_SAVE, /* n_arg, n_ret, fn_idx, [arg_var, arg_deref], [ret_var(32), ret_flag(16)] */
356 OPCODE_CALL_INDIRECT, /* n_arg, n_ret, fn_thunk, fn_deref, [arg_var, arg_deref], [ret_var(32), ret_flag(16)] */
357 OPCODE_CALL_INDIRECT_STRICT, /* n_arg, n_ret, fn_thunk, fn_deref, [arg_var, arg_deref], [ret_var(32), ret_flag(16)] */
358 OPCODE_CALL_INDIRECT_SPARK, /* n_arg, n_ret, fn_thunk, fn_deref, [arg_var, arg_deref], [ret_var(32), ret_flag(16)] */
359 OPCODE_CALL_INDIRECT_LAZY, /* n_arg, n_ret, fn_thunk, fn_deref, [arg_var, arg_deref], [ret_var(32), ret_flag(16)] */
360 OPCODE_CALL_INDIRECT_CACHE, /* n_arg, n_ret, fn_thunk, fn_deref, [arg_var, arg_deref], [ret_var(32), ret_flag(16)] */
361 OPCODE_CALL_INDIRECT_SAVE, /* n_arg, n_ret, fn_thunk, fn_deref, [arg_var, arg_deref], [ret_var(32), ret_flag(16)] */
362 OPCODE_RETURN, /* val, arg_deref ... */
363 OPCODE_STRUCTURED, /* struct, element ... */
364 #define OPCODE_STRUCTURED_RECORD 0x01 /* + element_slot, record_type */
365 #define OPCODE_STRUCTURED_OPTION 0x02 /* + option, nothing */
366 #define OPCODE_STRUCTURED_ARRAY 0x03 /* + index_slot, nothing */
367 #define OPCODE_STRUCTURED_MASK 0x0f
368 #define OPCODE_STRUCTURED_FREE_VARIABLE 0x10
369 #define OPCODE_STRUCTURED_FLAG_END 0x20
370 OPCODE_RECORD_CREATE, /* result, n_entries, [entry_var, arg_deref] */
371 OPCODE_RECORD_LOAD, /* record, slot, result, (strict_flag | borrow_flag) */
372 OPCODE_OPTION_CREATE_EMPTY_FLAT,/* result, option */
373 OPCODE_OPTION_CREATE_EMPTY, /* result, option */
374 OPCODE_OPTION_CREATE, /* result, option, arg_var, arg_deref */
375 OPCODE_OPTION_LOAD, /* option, idx, result, (strict_flag | borrow_flag) */
376 OPCODE_OPTION_TEST_FLAT, /* var, option, result */
377 OPCODE_OPTION_TEST, /* var, option, result */
378 OPCODE_OPTION_ORD_FLAT, /* var, result */
379 OPCODE_OPTION_ORD, /* var, result */
380 OPCODE_ARRAY_CREATE, /* result, n_entries, [entry_var, arg_deref] */
381 OPCODE_ARRAY_CREATE_EMPTY_FLAT, /* result, local_type */
382 OPCODE_ARRAY_CREATE_EMPTY, /* result */
383 OPCODE_ARRAY_FILL, /* content_var, content_deref | flag_sparse, length_var, result */
384 OPCODE_ARRAY_STRING, /* result, length, [chars] */
385 OPCODE_ARRAY_UNICODE, /* result, length, [chars] */
386 OPCODE_ARRAY_LOAD, /* array, idx slot, result, (strict_flag | borrow_flag) */
387 OPCODE_ARRAY_LEN, /* array, result, strict_flag */
388 OPCODE_ARRAY_LEN_GREATER_THAN, /* array, size, result, strict_flag */
389 OPCODE_ARRAY_SUB, /* array, start, end, result, strict_flags | deref */
390 OPCODE_ARRAY_SKIP, /* array, start, result, strict_flags | deref */
391 OPCODE_ARRAY_APPEND, /* result, arg_deref1 | arg_deref2, arg1, arg2 */
392 OPCODE_ARRAY_APPEND_ONE_FLAT, /* result, arg_deref1 | arg_deref2, arg1, arg2 */
393 OPCODE_ARRAY_APPEND_ONE, /* result, arg_deref1 | arg_deref2, arg1, arg2 */
394 OPCODE_ARRAY_FLATTEN, /* result, arg_deref1, arg1 */
395 OPCODE_IO, /* (code, n_outputs, n_inputs, n_params), 32-bit: outputs, inputs, params */
396 OPCODE_INTERNAL_FUNCTION,
397 OPCODE_EXIT_THREAD,
398 OPCODE_UNREACHABLE,
399 OPCODE_N,
402 enum {
403 OPCODE_MODE_MULT_0 = (OPCODE_N - 1),
404 OPCODE_MODE_MULT_1 = (OPCODE_MODE_MULT_0 | (OPCODE_MODE_MULT_0 >> 1)),
405 OPCODE_MODE_MULT_2 = (OPCODE_MODE_MULT_1 | (OPCODE_MODE_MULT_1 >> 2)),
406 OPCODE_MODE_MULT_4 = (OPCODE_MODE_MULT_2 | (OPCODE_MODE_MULT_2 >> 4)),
407 OPCODE_MODE_MULT_8 = (OPCODE_MODE_MULT_4 | (OPCODE_MODE_MULT_4 >> 8)),
408 OPCODE_MODE_MULT = OPCODE_MODE_MULT_8 + 1,
411 #endif