Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
opcodes_def.hpp File Reference
#include <cstdint>
Include dependency graph for opcodes_def.hpp:

Go to the source code of this file.

Macros

#define SYS_VM_CONTROL_FLOW_OPS(opcode_macro)
 
#define SYS_VM_BR_TABLE_OP(opcode_macro)
 
#define SYS_VM_RETURN_OP(opcode_macro)
 
#define SYS_VM_CALL_OPS(opcode_macro)
 
#define SYS_VM_CALL_IMM_OPS(opcode_macro)
 
#define SYS_VM_PARAMETRIC_OPS(opcode_macro)
 
#define SYS_VM_VARIABLE_ACCESS_OPS(opcode_macro)
 
#define SYS_VM_MEMORY_OPS(opcode_macro)
 
#define SYS_VM_I32_CONSTANT_OPS(opcode_macro)
 
#define SYS_VM_I64_CONSTANT_OPS(opcode_macro)
 
#define SYS_VM_F32_CONSTANT_OPS(opcode_macro)
 
#define SYS_VM_F64_CONSTANT_OPS(opcode_macro)
 
#define SYS_VM_COMPARISON_OPS(opcode_macro)
 
#define SYS_VM_NUMERIC_OPS(opcode_macro)
 
#define SYS_VM_CONVERSION_OPS(opcode_macro)
 
#define SYS_VM_EXIT_OP(opcode_macro)
 
#define SYS_VM_EMPTY_OPS(opcode_macro)
 
#define SYS_VM_ERROR_OPS(opcode_macro)
 
#define SYS_VM_CREATE_ENUM(name, code)
 
#define SYS_VM_CREATE_STRINGS(name, code)
 
#define SYS_VM_CREATE_MAP(name, code)
 
#define SYS_VM_OPCODE_NAME_if_
 
#define SYS_VM_OPCODE_NAME_else_
 
#define SYS_VM_OPCODE_NAME_return_
 
#define SYS_VM_OPCODE_NAME_TEST()
 
#define SYS_VM_OPCODE_NAME_TEST_SYS_VM_OPCODE_NAME_TEST   0,
 
#define SYS_VM_OPCODE_NAME_TEST_1   1, ignore
 
#define SYS_VM_EXPAND(x)
 
#define SYS_VM_CAT2(x, y)
 
#define SYS_VM_CAT(x, y)
 
#define SYS_VM_APPLY(f, args)
 
#define SYS_VM_FIX_OPCODE_NAME_0(name)
 
#define SYS_VM_FIX_OPCODE_NAME_1(name)
 
#define SYS_VM_FIX_OPCODE_NAME(iskeyword, garbage)
 
#define SYS_VM_OPCODE_T(name)
 
#define SYS_VM_CREATE_EXIT_TYPE(name, code)
 
#define SYS_VM_CREATE_CONTROL_FLOW_TYPES(name, code)
 
#define SYS_VM_CREATE_BR_TABLE_TYPE(name, code)
 
#define SYS_VM_CREATE_TYPES(name, code)
 
#define SYS_VM_CREATE_CALL_TYPES(name, code)
 
#define SYS_VM_CREATE_CALL_IMM_TYPES(name, code)
 
#define SYS_VM_CREATE_VARIABLE_ACCESS_TYPES(name, code)
 
#define SYS_VM_CREATE_MEMORY_TYPES(name, code)
 
#define SYS_VM_CREATE_I32_CONSTANT_TYPE(name, code)
 
#define SYS_VM_CREATE_I64_CONSTANT_TYPE(name, code)
 
#define SYS_VM_CREATE_F32_CONSTANT_TYPE(name, code)
 
#define SYS_VM_CREATE_F64_CONSTANT_TYPE(name, code)
 
#define SYS_VM_IDENTITY(name, code)
 
#define SYS_VM_IDENTITY_END(name, code)
 

Macro Definition Documentation

◆ SYS_VM_APPLY

#define SYS_VM_APPLY ( f,
args )
Value:
f args

Definition at line 299 of file opcodes_def.hpp.

◆ SYS_VM_BR_TABLE_OP

#define SYS_VM_BR_TABLE_OP ( opcode_macro)
Value:
opcode_macro(br_table, 0x0E)

Definition at line 21 of file opcodes_def.hpp.

21#define SYS_VM_BR_TABLE_OP(opcode_macro) \
22 opcode_macro(br_table, 0x0E)

◆ SYS_VM_CALL_IMM_OPS

#define SYS_VM_CALL_IMM_OPS ( opcode_macro)
Value:
opcode_macro(call_imm, 0x13) \
opcode_macro(call_indirect_imm, 0x14) \
opcode_macro(padding_call_1, 0x15) \
opcode_macro(padding_call_2, 0x16) \
opcode_macro(padding_call_3, 0x17) \
opcode_macro(padding_call_4, 0x18) \
opcode_macro(padding_call_5, 0x19)

Definition at line 29 of file opcodes_def.hpp.

29#define SYS_VM_CALL_IMM_OPS(opcode_macro) \
30 opcode_macro(call_imm, 0x13) \
31 opcode_macro(call_indirect_imm, 0x14) \
32 opcode_macro(padding_call_1, 0x15) \
33 opcode_macro(padding_call_2, 0x16) \
34 opcode_macro(padding_call_3, 0x17) \
35 opcode_macro(padding_call_4, 0x18) \
36 opcode_macro(padding_call_5, 0x19)

◆ SYS_VM_CALL_OPS

#define SYS_VM_CALL_OPS ( opcode_macro)
Value:
opcode_macro(call, 0x10) \
opcode_macro(call_indirect, 0x11) \
opcode_macro(br_table_data, 0x12)
fc::variant call(const std::string &url, const std::string &path, const T &v)
Definition main.cpp:258

Definition at line 25 of file opcodes_def.hpp.

25#define SYS_VM_CALL_OPS(opcode_macro) \
26 opcode_macro(call, 0x10) \
27 opcode_macro(call_indirect, 0x11) \
28 opcode_macro(br_table_data, 0x12)

◆ SYS_VM_CAT

#define SYS_VM_CAT ( x,
y )
Value:
#define SYS_VM_CAT2(x, y)

Definition at line 298 of file opcodes_def.hpp.

◆ SYS_VM_CAT2

#define SYS_VM_CAT2 ( x,
y )
Value:
x ## y

Definition at line 297 of file opcodes_def.hpp.

◆ SYS_VM_COMPARISON_OPS

#define SYS_VM_COMPARISON_OPS ( opcode_macro)

Definition at line 87 of file opcodes_def.hpp.

87#define SYS_VM_COMPARISON_OPS(opcode_macro) \
88 opcode_macro(i32_eqz, 0x45) \
89 opcode_macro(i32_eq, 0x46) \
90 opcode_macro(i32_ne, 0x47) \
91 opcode_macro(i32_lt_s, 0x48) \
92 opcode_macro(i32_lt_u, 0x49) \
93 opcode_macro(i32_gt_s, 0x4A) \
94 opcode_macro(i32_gt_u, 0x4B) \
95 opcode_macro(i32_le_s, 0x4C) \
96 opcode_macro(i32_le_u, 0x4D) \
97 opcode_macro(i32_ge_s, 0x4E) \
98 opcode_macro(i32_ge_u, 0x4F) \
99 opcode_macro(i64_eqz, 0x50) \
100 opcode_macro(i64_eq, 0x51) \
101 opcode_macro(i64_ne, 0x52) \
102 opcode_macro(i64_lt_s, 0x53) \
103 opcode_macro(i64_lt_u, 0x54) \
104 opcode_macro(i64_gt_s, 0x55) \
105 opcode_macro(i64_gt_u, 0x56) \
106 opcode_macro(i64_le_s, 0x57) \
107 opcode_macro(i64_le_u, 0x58) \
108 opcode_macro(i64_ge_s, 0x59) \
109 opcode_macro(i64_ge_u, 0x5A) \
110 opcode_macro(f32_eq, 0x5B) \
111 opcode_macro(f32_ne, 0x5C) \
112 opcode_macro(f32_lt, 0x5D) \
113 opcode_macro(f32_gt, 0x5E) \
114 opcode_macro(f32_le, 0x5F) \
115 opcode_macro(f32_ge, 0x60) \
116 opcode_macro(f64_eq, 0x61) \
117 opcode_macro(f64_ne, 0x62) \
118 opcode_macro(f64_lt, 0x63) \
119 opcode_macro(f64_gt, 0x64) \
120 opcode_macro(f64_le, 0x65) \
121 opcode_macro(f64_ge, 0x66)

◆ SYS_VM_CONTROL_FLOW_OPS

#define SYS_VM_CONTROL_FLOW_OPS ( opcode_macro)
Value:
opcode_macro(unreachable, 0x00) \
opcode_macro(nop, 0x01) \
opcode_macro(block, 0x02) \
opcode_macro(loop, 0x03) \
opcode_macro(if_, 0x04) \
opcode_macro(else_, 0x05) \
opcode_macro(padding_cf_0, 0x06) \
opcode_macro(padding_cf_1, 0x07) \
opcode_macro(padding_cf_2, 0x08) \
opcode_macro(padding_cf_3, 0x09) \
opcode_macro(padding_cf_4, 0x0A) \
opcode_macro(end, 0x0B) \
opcode_macro(br, 0x0C) \
opcode_macro(br_if, 0x0D)

Definition at line 6 of file opcodes_def.hpp.

6#define SYS_VM_CONTROL_FLOW_OPS(opcode_macro) \
7 opcode_macro(unreachable, 0x00) \
8 opcode_macro(nop, 0x01) \
9 opcode_macro(block, 0x02) \
10 opcode_macro(loop, 0x03) \
11 opcode_macro(if_, 0x04) \
12 opcode_macro(else_, 0x05) \
13 opcode_macro(padding_cf_0, 0x06) \
14 opcode_macro(padding_cf_1, 0x07) \
15 opcode_macro(padding_cf_2, 0x08) \
16 opcode_macro(padding_cf_3, 0x09) \
17 opcode_macro(padding_cf_4, 0x0A) \
18 opcode_macro(end, 0x0B) \
19 opcode_macro(br, 0x0C) \
20 opcode_macro(br_if, 0x0D)

◆ SYS_VM_CONVERSION_OPS

#define SYS_VM_CONVERSION_OPS ( opcode_macro)
Value:
opcode_macro(i32_wrap_i64, 0xA7) \
opcode_macro(i32_trunc_s_f32, 0xA8) \
opcode_macro(i32_trunc_u_f32, 0xA9) \
opcode_macro(i32_trunc_s_f64, 0xAA) \
opcode_macro(i32_trunc_u_f64, 0xAB) \
opcode_macro(i64_extend_s_i32, 0xAC) \
opcode_macro(i64_extend_u_i32, 0xAD) \
opcode_macro(i64_trunc_s_f32, 0xAE) \
opcode_macro(i64_trunc_u_f32, 0xAF) \
opcode_macro(i64_trunc_s_f64, 0xB0) \
opcode_macro(i64_trunc_u_f64, 0xB1) \
opcode_macro(f32_convert_s_i32, 0xB2) \
opcode_macro(f32_convert_u_i32, 0xB3) \
opcode_macro(f32_convert_s_i64, 0xB4) \
opcode_macro(f32_convert_u_i64, 0xB5) \
opcode_macro(f32_demote_f64, 0xB6) \
opcode_macro(f64_convert_s_i32, 0xB7) \
opcode_macro(f64_convert_u_i32, 0xB8) \
opcode_macro(f64_convert_s_i64, 0xB9) \
opcode_macro(f64_convert_u_i64, 0xBA) \
opcode_macro(f64_promote_f32, 0xBB) \
opcode_macro(i32_reinterpret_f32, 0xBC) \
opcode_macro(i64_reinterpret_f64, 0xBD) \
opcode_macro(f32_reinterpret_i32, 0xBE) \
opcode_macro(f64_reinterpret_i64, 0xBF)

Definition at line 187 of file opcodes_def.hpp.

187#define SYS_VM_CONVERSION_OPS(opcode_macro) \
188 opcode_macro(i32_wrap_i64, 0xA7) \
189 opcode_macro(i32_trunc_s_f32, 0xA8) \
190 opcode_macro(i32_trunc_u_f32, 0xA9) \
191 opcode_macro(i32_trunc_s_f64, 0xAA) \
192 opcode_macro(i32_trunc_u_f64, 0xAB) \
193 opcode_macro(i64_extend_s_i32, 0xAC) \
194 opcode_macro(i64_extend_u_i32, 0xAD) \
195 opcode_macro(i64_trunc_s_f32, 0xAE) \
196 opcode_macro(i64_trunc_u_f32, 0xAF) \
197 opcode_macro(i64_trunc_s_f64, 0xB0) \
198 opcode_macro(i64_trunc_u_f64, 0xB1) \
199 opcode_macro(f32_convert_s_i32, 0xB2) \
200 opcode_macro(f32_convert_u_i32, 0xB3) \
201 opcode_macro(f32_convert_s_i64, 0xB4) \
202 opcode_macro(f32_convert_u_i64, 0xB5) \
203 opcode_macro(f32_demote_f64, 0xB6) \
204 opcode_macro(f64_convert_s_i32, 0xB7) \
205 opcode_macro(f64_convert_u_i32, 0xB8) \
206 opcode_macro(f64_convert_s_i64, 0xB9) \
207 opcode_macro(f64_convert_u_i64, 0xBA) \
208 opcode_macro(f64_promote_f32, 0xBB) \
209 opcode_macro(i32_reinterpret_f32, 0xBC) \
210 opcode_macro(i64_reinterpret_f64, 0xBD) \
211 opcode_macro(f32_reinterpret_i32, 0xBE) \
212 opcode_macro(f64_reinterpret_i64, 0xBF)

◆ SYS_VM_CREATE_BR_TABLE_TYPE

#define SYS_VM_CREATE_BR_TABLE_TYPE ( name,
code )
Value:
struct SYS_VM_OPCODE_T(name) { \
SYS_VM_OPCODE_T(name)() = default; \
struct elem_t { uint32_t pc; uint32_t stack_pop; }; \
elem_t* table; \
uint32_t size; \
uint32_t offset; \
static constexpr uint8_t opcode = code; \
};
std::string name
unsigned int uint32_t
Definition stdint.h:126
unsigned char uint8_t
Definition stdint.h:124

Definition at line 329 of file opcodes_def.hpp.

329#define SYS_VM_CREATE_BR_TABLE_TYPE(name, code) \
330 struct SYS_VM_OPCODE_T(name) { \
331 SYS_VM_OPCODE_T(name)() = default; \
332 struct elem_t { uint32_t pc; uint32_t stack_pop; }; \
333 elem_t* table; \
334 uint32_t size; \
335 uint32_t offset; \
336 static constexpr uint8_t opcode = code; \
337 };

◆ SYS_VM_CREATE_CALL_IMM_TYPES

#define SYS_VM_CREATE_CALL_IMM_TYPES ( name,
code )
Value:
struct SYS_VM_OPCODE_T(name) { \
SYS_VM_OPCODE_T(name)() = default; \
uint32_t index; \
uint16_t locals; \
uint16_t return_type; \
static constexpr uint8_t opcode = code; \
};
unsigned short uint16_t
Definition stdint.h:125

Definition at line 352 of file opcodes_def.hpp.

352#define SYS_VM_CREATE_CALL_IMM_TYPES(name, code) \
353 struct SYS_VM_OPCODE_T(name) { \
354 SYS_VM_OPCODE_T(name)() = default; \
355 uint32_t index; \
356 uint16_t locals; \
357 uint16_t return_type; \
358 static constexpr uint8_t opcode = code; \
359 };

◆ SYS_VM_CREATE_CALL_TYPES

#define SYS_VM_CREATE_CALL_TYPES ( name,
code )
Value:
struct SYS_VM_OPCODE_T(name) { \
SYS_VM_OPCODE_T(name)() = default; \
uint32_t index; \
static constexpr uint8_t opcode = code; \
};

Definition at line 345 of file opcodes_def.hpp.

345#define SYS_VM_CREATE_CALL_TYPES(name, code) \
346 struct SYS_VM_OPCODE_T(name) { \
347 SYS_VM_OPCODE_T(name)() = default; \
348 uint32_t index; \
349 static constexpr uint8_t opcode = code; \
350 };

◆ SYS_VM_CREATE_CONTROL_FLOW_TYPES

#define SYS_VM_CREATE_CONTROL_FLOW_TYPES ( name,
code )
Value:
struct SYS_VM_OPCODE_T(name) { \
SYS_VM_OPCODE_T(name)() {} \
SYS_VM_OPCODE_T(name)(uint32_t data) : data(data) {} \
SYS_VM_OPCODE_T(name)(uint32_t d, uint32_t pc, uint16_t i, uint16_t oi) \
: data(d), pc(pc), index(i), op_index(oi) {} \
uint32_t data = 0; \
uint32_t pc = 0; \
uint16_t index = 0; \
uint16_t op_index = 0; \
static constexpr uint8_t opcode = code; \
};
variant< > opcode
Definition opcodes.hpp:79
CK_ULONG d

Definition at line 316 of file opcodes_def.hpp.

316#define SYS_VM_CREATE_CONTROL_FLOW_TYPES(name, code) \
317 struct SYS_VM_OPCODE_T(name) { \
318 SYS_VM_OPCODE_T(name)() {} \
319 SYS_VM_OPCODE_T(name)(uint32_t data) : data(data) {} \
320 SYS_VM_OPCODE_T(name)(uint32_t d, uint32_t pc, uint16_t i, uint16_t oi) \
321 : data(d), pc(pc), index(i), op_index(oi) {} \
322 uint32_t data = 0; \
323 uint32_t pc = 0; \
324 uint16_t index = 0; \
325 uint16_t op_index = 0; \
326 static constexpr uint8_t opcode = code; \
327 };

◆ SYS_VM_CREATE_ENUM

#define SYS_VM_CREATE_ENUM ( name,
code )
Value:
name = code,

Definition at line 283 of file opcodes_def.hpp.

◆ SYS_VM_CREATE_EXIT_TYPE

#define SYS_VM_CREATE_EXIT_TYPE ( name,
code )
Value:
struct SYS_VM_OPCODE_T(name) { \
SYS_VM_OPCODE_T(name)() = default; \
uint32_t pc; \
static constexpr uint8_t opcode = code; \
};

Definition at line 309 of file opcodes_def.hpp.

309#define SYS_VM_CREATE_EXIT_TYPE(name, code) \
310 struct SYS_VM_OPCODE_T(name) { \
311 SYS_VM_OPCODE_T(name)() = default; \
312 uint32_t pc; \
313 static constexpr uint8_t opcode = code; \
314 };

◆ SYS_VM_CREATE_F32_CONSTANT_TYPE

#define SYS_VM_CREATE_F32_CONSTANT_TYPE ( name,
code )
Value:
struct SYS_VM_OPCODE_T(name) { \
SYS_VM_OPCODE_T(name)() = default; \
explicit SYS_VM_OPCODE_T(name)(uint32_t n) { data.ui = n; } \
explicit SYS_VM_OPCODE_T(name)(float n) { data.f = n; } \
union { \
uint32_t ui; \
float f; \
} data; \
static constexpr uint8_t opcode = code; \
};
#define SYS_VM_OPCODE_T(name)

Definition at line 400 of file opcodes_def.hpp.

400#define SYS_VM_CREATE_F32_CONSTANT_TYPE(name, code) \
401 struct SYS_VM_OPCODE_T(name) { \
402 SYS_VM_OPCODE_T(name)() = default; \
403 explicit SYS_VM_OPCODE_T(name)(uint32_t n) { data.ui = n; } \
404 explicit SYS_VM_OPCODE_T(name)(float n) { data.f = n; } \
405 union { \
406 uint32_t ui; \
407 float f; \
408 } data; \
409 static constexpr uint8_t opcode = code; \
410 };

◆ SYS_VM_CREATE_F64_CONSTANT_TYPE

#define SYS_VM_CREATE_F64_CONSTANT_TYPE ( name,
code )
Value:
struct SYS_VM_OPCODE_T(name) { \
SYS_VM_OPCODE_T(name)() = default; \
explicit SYS_VM_OPCODE_T(name)(uint64_t n) { data.ui = n; } \
explicit SYS_VM_OPCODE_T(name)(double n) { data.f = n; } \
union { \
uint64_t ui; \
double f; \
} data; \
static constexpr uint8_t opcode = code; \
};
unsigned __int64 uint64_t
Definition stdint.h:136

Definition at line 412 of file opcodes_def.hpp.

412#define SYS_VM_CREATE_F64_CONSTANT_TYPE(name, code) \
413 struct SYS_VM_OPCODE_T(name) { \
414 SYS_VM_OPCODE_T(name)() = default; \
415 explicit SYS_VM_OPCODE_T(name)(uint64_t n) { data.ui = n; } \
416 explicit SYS_VM_OPCODE_T(name)(double n) { data.f = n; } \
417 union { \
418 uint64_t ui; \
419 double f; \
420 } data; \
421 static constexpr uint8_t opcode = code; \
422 };

◆ SYS_VM_CREATE_I32_CONSTANT_TYPE

#define SYS_VM_CREATE_I32_CONSTANT_TYPE ( name,
code )
Value:
struct SYS_VM_OPCODE_T(name) { \
SYS_VM_OPCODE_T(name)() = default; \
explicit SYS_VM_OPCODE_T(name)(uint32_t n) { data.ui = n; } \
explicit SYS_VM_OPCODE_T(name)(int32_t n) { data.i = n; } \
union { \
uint32_t ui; \
int32_t i; \
} data; \
static constexpr uint8_t opcode = code; \
};
signed int int32_t
Definition stdint.h:123

Definition at line 376 of file opcodes_def.hpp.

376#define SYS_VM_CREATE_I32_CONSTANT_TYPE(name, code) \
377 struct SYS_VM_OPCODE_T(name) { \
378 SYS_VM_OPCODE_T(name)() = default; \
379 explicit SYS_VM_OPCODE_T(name)(uint32_t n) { data.ui = n; } \
380 explicit SYS_VM_OPCODE_T(name)(int32_t n) { data.i = n; } \
381 union { \
382 uint32_t ui; \
383 int32_t i; \
384 } data; \
385 static constexpr uint8_t opcode = code; \
386 };

◆ SYS_VM_CREATE_I64_CONSTANT_TYPE

#define SYS_VM_CREATE_I64_CONSTANT_TYPE ( name,
code )
Value:
struct SYS_VM_OPCODE_T(name) { \
SYS_VM_OPCODE_T(name)() = default; \
explicit SYS_VM_OPCODE_T(name)(uint64_t n) { data.ui = n; } \
explicit SYS_VM_OPCODE_T(name)(int64_t n) { data.i = n; } \
union { \
uint64_t ui; \
int64_t i; \
} data; \
static constexpr uint8_t opcode = code; \
};
signed __int64 int64_t
Definition stdint.h:135

Definition at line 388 of file opcodes_def.hpp.

388#define SYS_VM_CREATE_I64_CONSTANT_TYPE(name, code) \
389 struct SYS_VM_OPCODE_T(name) { \
390 SYS_VM_OPCODE_T(name)() = default; \
391 explicit SYS_VM_OPCODE_T(name)(uint64_t n) { data.ui = n; } \
392 explicit SYS_VM_OPCODE_T(name)(int64_t n) { data.i = n; } \
393 union { \
394 uint64_t ui; \
395 int64_t i; \
396 } data; \
397 static constexpr uint8_t opcode = code; \
398 };

◆ SYS_VM_CREATE_MAP

#define SYS_VM_CREATE_MAP ( name,
code )
Value:
{ code, #name },

Definition at line 287 of file opcodes_def.hpp.

◆ SYS_VM_CREATE_MEMORY_TYPES

#define SYS_VM_CREATE_MEMORY_TYPES ( name,
code )
Value:
struct SYS_VM_OPCODE_T(name) { \
SYS_VM_OPCODE_T(name)() = default; \
uint32_t flags_align; \
uint32_t offset; \
static constexpr uint8_t opcode = code; \
};

Definition at line 368 of file opcodes_def.hpp.

368#define SYS_VM_CREATE_MEMORY_TYPES(name, code) \
369 struct SYS_VM_OPCODE_T(name) { \
370 SYS_VM_OPCODE_T(name)() = default; \
371 uint32_t flags_align; \
372 uint32_t offset; \
373 static constexpr uint8_t opcode = code; \
374 };

◆ SYS_VM_CREATE_STRINGS

#define SYS_VM_CREATE_STRINGS ( name,
code )
Value:
#name,

Definition at line 285 of file opcodes_def.hpp.

◆ SYS_VM_CREATE_TYPES

#define SYS_VM_CREATE_TYPES ( name,
code )
Value:
struct SYS_VM_OPCODE_T(name) { \
SYS_VM_OPCODE_T(name)() = default; \
static constexpr uint8_t opcode = code; \
};

Definition at line 339 of file opcodes_def.hpp.

339#define SYS_VM_CREATE_TYPES(name, code) \
340 struct SYS_VM_OPCODE_T(name) { \
341 SYS_VM_OPCODE_T(name)() = default; \
342 static constexpr uint8_t opcode = code; \
343 };

◆ SYS_VM_CREATE_VARIABLE_ACCESS_TYPES

#define SYS_VM_CREATE_VARIABLE_ACCESS_TYPES ( name,
code )
Value:
struct SYS_VM_OPCODE_T(name) { \
SYS_VM_OPCODE_T(name)() = default; \
uint32_t index; \
static constexpr uint8_t opcode = code; \
};

Definition at line 361 of file opcodes_def.hpp.

361#define SYS_VM_CREATE_VARIABLE_ACCESS_TYPES(name, code) \
362 struct SYS_VM_OPCODE_T(name) { \
363 SYS_VM_OPCODE_T(name)() = default; \
364 uint32_t index; \
365 static constexpr uint8_t opcode = code; \
366 };

◆ SYS_VM_EMPTY_OPS

#define SYS_VM_EMPTY_OPS ( opcode_macro)

Definition at line 215 of file opcodes_def.hpp.

215#define SYS_VM_EMPTY_OPS(opcode_macro) \
216 opcode_macro(empty0xC1, 0xC1) \
217 opcode_macro(empty0xC2, 0xC2) \
218 opcode_macro(empty0xC3, 0xC3) \
219 opcode_macro(empty0xC4, 0xC4) \
220 opcode_macro(empty0xC5, 0xC5) \
221 opcode_macro(empty0xC6, 0xC6) \
222 opcode_macro(empty0xC7, 0xC7) \
223 opcode_macro(empty0xC8, 0xC8) \
224 opcode_macro(empty0xC9, 0xC9) \
225 opcode_macro(empty0xCA, 0xCA) \
226 opcode_macro(empty0xCB, 0xCB) \
227 opcode_macro(empty0xCC, 0xCC) \
228 opcode_macro(empty0xCD, 0xCD) \
229 opcode_macro(empty0xCE, 0xCE) \
230 opcode_macro(empty0xCF, 0xCF) \
231 opcode_macro(empty0xD0, 0xD0) \
232 opcode_macro(empty0xD1, 0xD1) \
233 opcode_macro(empty0xD2, 0xD2) \
234 opcode_macro(empty0xD3, 0xD3) \
235 opcode_macro(empty0xD4, 0xD4) \
236 opcode_macro(empty0xD5, 0xD5) \
237 opcode_macro(empty0xD6, 0xD6) \
238 opcode_macro(empty0xD7, 0xD7) \
239 opcode_macro(empty0xD8, 0xD8) \
240 opcode_macro(empty0xD9, 0xD9) \
241 opcode_macro(empty0xDA, 0xDA) \
242 opcode_macro(empty0xDB, 0xDB) \
243 opcode_macro(empty0xDC, 0xDC) \
244 opcode_macro(empty0xDD, 0xDD) \
245 opcode_macro(empty0xDE, 0xDE) \
246 opcode_macro(empty0xDF, 0xDF) \
247 opcode_macro(empty0xE0, 0xE0) \
248 opcode_macro(empty0xE1, 0xE1) \
249 opcode_macro(empty0xE2, 0xE2) \
250 opcode_macro(empty0xE3, 0xE3) \
251 opcode_macro(empty0xE4, 0xE4) \
252 opcode_macro(empty0xE5, 0xE5) \
253 opcode_macro(empty0xE6, 0xE6) \
254 opcode_macro(empty0xE7, 0xE7) \
255 opcode_macro(empty0xE8, 0xE8) \
256 opcode_macro(empty0xE9, 0xE9) \
257 opcode_macro(empty0xEA, 0xEA) \
258 opcode_macro(empty0xEB, 0xEB) \
259 opcode_macro(empty0xEC, 0xEC) \
260 opcode_macro(empty0xED, 0xED) \
261 opcode_macro(empty0xEE, 0xEE) \
262 opcode_macro(empty0xEF, 0xEF) \
263 opcode_macro(empty0xF0, 0xF0) \
264 opcode_macro(empty0xF1, 0xF1) \
265 opcode_macro(empty0xF2, 0xF2) \
266 opcode_macro(empty0xF3, 0xF3) \
267 opcode_macro(empty0xF4, 0xF4) \
268 opcode_macro(empty0xF5, 0xF5) \
269 opcode_macro(empty0xF6, 0xF6) \
270 opcode_macro(empty0xF7, 0xF7) \
271 opcode_macro(empty0xF8, 0xF8) \
272 opcode_macro(empty0xF9, 0xF9) \
273 opcode_macro(empty0xFA, 0xFA) \
274 opcode_macro(empty0xFB, 0xFB) \
275 opcode_macro(empty0xFC, 0xFC) \
276 opcode_macro(empty0xFD, 0xFD) \
277 opcode_macro(empty0xFE, 0xFE)

◆ SYS_VM_ERROR_OPS

#define SYS_VM_ERROR_OPS ( opcode_macro)
Value:
opcode_macro(error, 0xFF)

Definition at line 278 of file opcodes_def.hpp.

278#define SYS_VM_ERROR_OPS(opcode_macro) \
279 opcode_macro(error, 0xFF)

◆ SYS_VM_EXIT_OP

#define SYS_VM_EXIT_OP ( opcode_macro)
Value:
opcode_macro(exit, 0xC0)

Definition at line 213 of file opcodes_def.hpp.

213#define SYS_VM_EXIT_OP(opcode_macro) \
214 opcode_macro(exit, 0xC0)

◆ SYS_VM_EXPAND

#define SYS_VM_EXPAND ( x)
Value:
x

Definition at line 296 of file opcodes_def.hpp.

◆ SYS_VM_F32_CONSTANT_OPS

#define SYS_VM_F32_CONSTANT_OPS ( opcode_macro)
Value:
opcode_macro(f32_const, 0x43)

Definition at line 83 of file opcodes_def.hpp.

83#define SYS_VM_F32_CONSTANT_OPS(opcode_macro) \
84 opcode_macro(f32_const, 0x43)

◆ SYS_VM_F64_CONSTANT_OPS

#define SYS_VM_F64_CONSTANT_OPS ( opcode_macro)
Value:
opcode_macro(f64_const, 0x44)

Definition at line 85 of file opcodes_def.hpp.

85#define SYS_VM_F64_CONSTANT_OPS(opcode_macro) \
86 opcode_macro(f64_const, 0x44)

◆ SYS_VM_FIX_OPCODE_NAME

#define SYS_VM_FIX_OPCODE_NAME ( iskeyword,
garbage )
Value:
SYS_VM_FIX_OPCODE_NAME_ ## iskeyword

Definition at line 302 of file opcodes_def.hpp.

◆ SYS_VM_FIX_OPCODE_NAME_0

#define SYS_VM_FIX_OPCODE_NAME_0 ( name)
Value:
name ## _t

Definition at line 300 of file opcodes_def.hpp.

◆ SYS_VM_FIX_OPCODE_NAME_1

#define SYS_VM_FIX_OPCODE_NAME_1 ( name)
Value:
name ## t

Definition at line 301 of file opcodes_def.hpp.

◆ SYS_VM_I32_CONSTANT_OPS

#define SYS_VM_I32_CONSTANT_OPS ( opcode_macro)
Value:
opcode_macro(i32_const, 0x41)

Definition at line 79 of file opcodes_def.hpp.

79#define SYS_VM_I32_CONSTANT_OPS(opcode_macro) \
80 opcode_macro(i32_const, 0x41)

◆ SYS_VM_I64_CONSTANT_OPS

#define SYS_VM_I64_CONSTANT_OPS ( opcode_macro)
Value:
opcode_macro(i64_const, 0x42)

Definition at line 81 of file opcodes_def.hpp.

81#define SYS_VM_I64_CONSTANT_OPS(opcode_macro) \
82 opcode_macro(i64_const, 0x42)

◆ SYS_VM_IDENTITY

#define SYS_VM_IDENTITY ( name,
code )
Value:
sysio::vm::SYS_VM_OPCODE_T(name),

Definition at line 424 of file opcodes_def.hpp.

◆ SYS_VM_IDENTITY_END

#define SYS_VM_IDENTITY_END ( name,
code )
Value:
sysio::vm::SYS_VM_OPCODE_T(name)

Definition at line 425 of file opcodes_def.hpp.

◆ SYS_VM_MEMORY_OPS

#define SYS_VM_MEMORY_OPS ( opcode_macro)
Value:
opcode_macro(i32_load, 0x28) \
opcode_macro(i64_load, 0x29) \
opcode_macro(f32_load, 0x2A) \
opcode_macro(f64_load, 0x2B) \
opcode_macro(i32_load8_s, 0x2C) \
opcode_macro(i32_load8_u, 0x2D) \
opcode_macro(i32_load16_s, 0x2E) \
opcode_macro(i32_load16_u, 0x2F) \
opcode_macro(i64_load8_s, 0x30) \
opcode_macro(i64_load8_u, 0x31) \
opcode_macro(i64_load16_s, 0x32) \
opcode_macro(i64_load16_u, 0x33) \
opcode_macro(i64_load32_s, 0x34) \
opcode_macro(i64_load32_u, 0x35) \
opcode_macro(i32_store, 0x36) \
opcode_macro(i64_store, 0x37) \
opcode_macro(f32_store, 0x38) \
opcode_macro(f64_store, 0x39) \
opcode_macro(i32_store8, 0x3A) \
opcode_macro(i32_store16, 0x3B) \
opcode_macro(i64_store8, 0x3C) \
opcode_macro(i64_store16, 0x3D) \
opcode_macro(i64_store32, 0x3E) \
opcode_macro(current_memory, 0x3F) \
opcode_macro(grow_memory, 0x40)

Definition at line 53 of file opcodes_def.hpp.

53#define SYS_VM_MEMORY_OPS(opcode_macro) \
54 opcode_macro(i32_load, 0x28) \
55 opcode_macro(i64_load, 0x29) \
56 opcode_macro(f32_load, 0x2A) \
57 opcode_macro(f64_load, 0x2B) \
58 opcode_macro(i32_load8_s, 0x2C) \
59 opcode_macro(i32_load8_u, 0x2D) \
60 opcode_macro(i32_load16_s, 0x2E) \
61 opcode_macro(i32_load16_u, 0x2F) \
62 opcode_macro(i64_load8_s, 0x30) \
63 opcode_macro(i64_load8_u, 0x31) \
64 opcode_macro(i64_load16_s, 0x32) \
65 opcode_macro(i64_load16_u, 0x33) \
66 opcode_macro(i64_load32_s, 0x34) \
67 opcode_macro(i64_load32_u, 0x35) \
68 opcode_macro(i32_store, 0x36) \
69 opcode_macro(i64_store, 0x37) \
70 opcode_macro(f32_store, 0x38) \
71 opcode_macro(f64_store, 0x39) \
72 opcode_macro(i32_store8, 0x3A) \
73 opcode_macro(i32_store16, 0x3B) \
74 opcode_macro(i64_store8, 0x3C) \
75 opcode_macro(i64_store16, 0x3D) \
76 opcode_macro(i64_store32, 0x3E) \
77 opcode_macro(current_memory, 0x3F) \
78 opcode_macro(grow_memory, 0x40)

◆ SYS_VM_NUMERIC_OPS

#define SYS_VM_NUMERIC_OPS ( opcode_macro)

Definition at line 122 of file opcodes_def.hpp.

122#define SYS_VM_NUMERIC_OPS(opcode_macro) \
123 opcode_macro(i32_clz, 0x67) \
124 opcode_macro(i32_ctz, 0x68) \
125 opcode_macro(i32_popcnt, 0x69) \
126 opcode_macro(i32_add, 0x6A) \
127 opcode_macro(i32_sub, 0x6B) \
128 opcode_macro(i32_mul, 0x6C) \
129 opcode_macro(i32_div_s, 0x6D) \
130 opcode_macro(i32_div_u, 0x6E) \
131 opcode_macro(i32_rem_s, 0x6F) \
132 opcode_macro(i32_rem_u, 0x70) \
133 opcode_macro(i32_and, 0x71) \
134 opcode_macro(i32_or, 0x72) \
135 opcode_macro(i32_xor, 0x73) \
136 opcode_macro(i32_shl, 0x74) \
137 opcode_macro(i32_shr_s, 0x75) \
138 opcode_macro(i32_shr_u, 0x76) \
139 opcode_macro(i32_rotl, 0x77) \
140 opcode_macro(i32_rotr, 0x78) \
141 opcode_macro(i64_clz, 0x79) \
142 opcode_macro(i64_ctz, 0x7A) \
143 opcode_macro(i64_popcnt, 0x7B) \
144 opcode_macro(i64_add, 0x7C) \
145 opcode_macro(i64_sub, 0x7D) \
146 opcode_macro(i64_mul, 0x7E) \
147 opcode_macro(i64_div_s, 0x7F) \
148 opcode_macro(i64_div_u, 0x80) \
149 opcode_macro(i64_rem_s, 0x81) \
150 opcode_macro(i64_rem_u, 0x82) \
151 opcode_macro(i64_and, 0x83) \
152 opcode_macro(i64_or, 0x84) \
153 opcode_macro(i64_xor, 0x85) \
154 opcode_macro(i64_shl, 0x86) \
155 opcode_macro(i64_shr_s, 0x87) \
156 opcode_macro(i64_shr_u, 0x88) \
157 opcode_macro(i64_rotl, 0x89) \
158 opcode_macro(i64_rotr, 0x8A) \
159 opcode_macro(f32_abs, 0x8B) \
160 opcode_macro(f32_neg, 0x8C) \
161 opcode_macro(f32_ceil, 0x8D) \
162 opcode_macro(f32_floor, 0x8E) \
163 opcode_macro(f32_trunc, 0x8F) \
164 opcode_macro(f32_nearest, 0x90) \
165 opcode_macro(f32_sqrt, 0x91) \
166 opcode_macro(f32_add, 0x92) \
167 opcode_macro(f32_sub, 0x93) \
168 opcode_macro(f32_mul, 0x94) \
169 opcode_macro(f32_div, 0x95) \
170 opcode_macro(f32_min, 0x96) \
171 opcode_macro(f32_max, 0x97) \
172 opcode_macro(f32_copysign, 0x98) \
173 opcode_macro(f64_abs, 0x99) \
174 opcode_macro(f64_neg, 0x9A) \
175 opcode_macro(f64_ceil, 0x9B) \
176 opcode_macro(f64_floor, 0x9C) \
177 opcode_macro(f64_trunc, 0x9D) \
178 opcode_macro(f64_nearest, 0x9E) \
179 opcode_macro(f64_sqrt, 0x9F) \
180 opcode_macro(f64_add, 0xA0) \
181 opcode_macro(f64_sub, 0xA1) \
182 opcode_macro(f64_mul, 0xA2) \
183 opcode_macro(f64_div, 0xA3) \
184 opcode_macro(f64_min, 0xA4) \
185 opcode_macro(f64_max, 0xA5) \
186 opcode_macro(f64_copysign, 0xA6)

◆ SYS_VM_OPCODE_NAME_else_

#define SYS_VM_OPCODE_NAME_else_

Definition at line 290 of file opcodes_def.hpp.

◆ SYS_VM_OPCODE_NAME_if_

#define SYS_VM_OPCODE_NAME_if_

Definition at line 289 of file opcodes_def.hpp.

◆ SYS_VM_OPCODE_NAME_return_

#define SYS_VM_OPCODE_NAME_return_

Definition at line 291 of file opcodes_def.hpp.

◆ SYS_VM_OPCODE_NAME_TEST

#define SYS_VM_OPCODE_NAME_TEST ( )
Value:
1

Definition at line 293 of file opcodes_def.hpp.

◆ SYS_VM_OPCODE_NAME_TEST_1

#define SYS_VM_OPCODE_NAME_TEST_1   1, ignore

Definition at line 295 of file opcodes_def.hpp.

◆ SYS_VM_OPCODE_NAME_TEST_SYS_VM_OPCODE_NAME_TEST

#define SYS_VM_OPCODE_NAME_TEST_SYS_VM_OPCODE_NAME_TEST   0,

Definition at line 294 of file opcodes_def.hpp.

◆ SYS_VM_OPCODE_T

#define SYS_VM_OPCODE_T ( name)
Value:
(SYS_VM_CAT(SYS_VM_OPCODE_NAME_TEST_, \
SYS_VM_EXPAND(SYS_VM_OPCODE_NAME_TEST SYS_VM_OPCODE_NAME_ ## name ()))))(name)
#define SYS_VM_CAT(x, y)
#define SYS_VM_APPLY(f, args)
#define SYS_VM_EXPAND(x)
#define SYS_VM_FIX_OPCODE_NAME(iskeyword, garbage)
#define SYS_VM_OPCODE_NAME_TEST()

Definition at line 304 of file opcodes_def.hpp.

304#define SYS_VM_OPCODE_T(name) \
305 SYS_VM_APPLY(SYS_VM_FIX_OPCODE_NAME, \
306 (SYS_VM_CAT(SYS_VM_OPCODE_NAME_TEST_, \
307 SYS_VM_EXPAND(SYS_VM_OPCODE_NAME_TEST SYS_VM_OPCODE_NAME_ ## name ()))))(name)

◆ SYS_VM_PARAMETRIC_OPS

#define SYS_VM_PARAMETRIC_OPS ( opcode_macro)
Value:
opcode_macro(drop, 0x1A) \
opcode_macro(select, 0x1B) \
opcode_macro(padding_param_0, 0x1C) \
opcode_macro(padding_param_1, 0x1D) \
opcode_macro(padding_param_2, 0x1E) \
opcode_macro(padding_param_3, 0x1F)

Definition at line 37 of file opcodes_def.hpp.

37#define SYS_VM_PARAMETRIC_OPS(opcode_macro) \
38 opcode_macro(drop, 0x1A) \
39 opcode_macro(select, 0x1B) \
40 opcode_macro(padding_param_0, 0x1C) \
41 opcode_macro(padding_param_1, 0x1D) \
42 opcode_macro(padding_param_2, 0x1E) \
43 opcode_macro(padding_param_3, 0x1F)

◆ SYS_VM_RETURN_OP

#define SYS_VM_RETURN_OP ( opcode_macro)
Value:
opcode_macro(return_, 0x0F)

Definition at line 23 of file opcodes_def.hpp.

23#define SYS_VM_RETURN_OP(opcode_macro) \
24 opcode_macro(return_, 0x0F)

◆ SYS_VM_VARIABLE_ACCESS_OPS

#define SYS_VM_VARIABLE_ACCESS_OPS ( opcode_macro)
Value:
opcode_macro(get_local, 0x20) \
opcode_macro(set_local, 0x21) \
opcode_macro(tee_local, 0x22) \
opcode_macro(get_global, 0x23) \
opcode_macro(set_global, 0x24) \
opcode_macro(padding_va_0, 0x25) \
opcode_macro(padding_va_1, 0x26) \
opcode_macro(padding_va_2, 0x27)

Definition at line 44 of file opcodes_def.hpp.

44#define SYS_VM_VARIABLE_ACCESS_OPS(opcode_macro)\
45 opcode_macro(get_local, 0x20) \
46 opcode_macro(set_local, 0x21) \
47 opcode_macro(tee_local, 0x22) \
48 opcode_macro(get_global, 0x23) \
49 opcode_macro(set_global, 0x24) \
50 opcode_macro(padding_va_0, 0x25) \
51 opcode_macro(padding_va_1, 0x26) \
52 opcode_macro(padding_va_2, 0x27)