3#include <sysio/wasm_backend/opcodes.hpp>
7namespace sysio {
namespace wasm_backend {
9 void print(
const std::string&
s) {
11 std::cout <<
s <<
'\n';
42 print(
"br : "+std::to_string(b.data));
45 print(
"br.if : "+std::to_string(b.data));
51 print(
"call : "+std::to_string(b.index));
54 print(
"call_indirect : "+std::to_string(b.index));
63 print(
"get_local : "+std::to_string(b.index));
66 print(
"set_local : "+std::to_string(b.index));
69 print(
"tee_local : "+std::to_string(b.index));
72 print(
"get_global : "+std::to_string(b.index));
75 print(
"set_global : "+std::to_string(b.index));
81 print(
"i32.load8_s : ");
84 print(
"i32.load16_s : ");
87 print(
"i32.load8_u : ");
90 print(
"i32.load16_u : ");
96 print(
"i64.load8_s : ");
99 print(
"i64.load16_s : ");
102 print(
"i64.load32_s : ");
105 print(
"i64.load8_u : ");
108 print(
"i64.load16_u : ");
111 print(
"i64.load32_u : ");
114 print(
"f32.load : ");
117 print(
"f64.load : ");
120 print(
"i32.store : ");
123 print(
"i32.store8 : ");
126 print(
"i32.store16 : ");
129 print(
"i64.store : ");
132 print(
"i64.store8 : ");
135 print(
"i64.store16 : ");
138 print(
"i64.store32 : ");
141 print(
"f32.store : ");
144 print(
"f64.store : ");
147 print(
"current_memory ");
150 print(
"grow_memory ");
153 print(
"i32.const : "+std::to_string(b.data));
156 print(
"i64.const : "+std::to_string(b.data));
159 print(
"f32.const : "+std::to_string(*((
float*)&b.data)));
162 print(
"f64.const : "+std::to_string(*((
double*)&b.data)));
390 print(
"f32.nearest");
414 print(
"f32.copysign");
432 print(
"f64.nearest");
456 print(
"f64.copysign");
459 print(
"i32.wrap_i64");
462 print(
"i32.trunc_s_f32");
465 print(
"i32.trunc_u_f32");
468 print(
"i32.trunc_s_f64");
471 print(
"i32.trunc_u_f64");
474 print(
"i64.extend_s_i32");
477 print(
"i64.extend_u_i32");
480 print(
"i64.trunc_s_f32");
483 print(
"i64.trunc_u_f32");
486 print(
"i64.trunc_s_f64");
489 print(
"i64.trunc_u_f64");
492 print(
"f32.convert_s_i32");
495 print(
"f32.convert_u_i32");
498 print(
"f32.convert_s_i64");
501 print(
"f32.convert_u_i64");
504 print(
"f32.demote_f64");
507 print(
"f64.convert_s_i32");
510 print(
"f64.convert_u_i32");
513 print(
"f64.convert_s_i64");
516 print(
"f64.convert_u_i64");
519 print(
"f64.promote_f32");
522 print(
"i32.reinterpret_f32");
525 print(
"i64.reinterpret_f64");
528 print(
"f32.reinterpret_i32");
531 print(
"f64.reinterpret_i64");
void operator()(f64_eq_t b)
void operator()(drop_t b)
void operator()(i64_sub_t)
void operator()(i64_const_t b)
void operator()(i32_trunc_s_f32_t)
void operator()(f32_reinterpret_i32_t)
void operator()(i32_xor_t)
void print(const std::string &s)
void operator()(i32_rem_u_t)
void operator()(f32_min_t)
void operator()(f64_promote_f32_t)
void operator()(i64_load16_u_t b)
void operator()(i32_shr_s_t)
void operator()(i32_trunc_u_f32_t)
void operator()(i32_load16_u_t b)
void operator()(i32_load8_s_t b)
void operator()(i64_store16_t b)
void operator()(i64_rem_s_t)
void operator()(f32_ne_t b)
void operator()(f64_const_t b)
void operator()(i64_load_t b)
void operator()(i32_load16_s_t b)
void operator()(f64_sub_t)
void operator()(f64_gt_t b)
void operator()(f32_floor_t)
void operator()(i64_load8_s_t b)
void operator()(f32_demote_f64_t)
void operator()(i64_store8_t b)
void operator()(i64_lt_u_t b)
void operator()(i64_load32_u_t b)
void operator()(f64_floor_t)
void operator()(i64_ne_t b)
void operator()(i32_shr_u_t)
void operator()(i32_ge_u_t b)
void operator()(i64_popcnt_t)
void operator()(i32_ctz_t)
void operator()(i32_load8_u_t b)
void operator()(i64_load8_u_t b)
void operator()(return__t)
void operator()(i32_popcnt_t)
void operator()(i32_clz_t)
void operator()(unreachable_t)
void operator()(i32_rotl_t)
void operator()(get_local_t b)
void operator()(i32_const_t b)
void operator()(i32_div_u_t)
void operator()(i32_le_u_t b)
void operator()(i32_store16_t b)
void operator()(i64_le_s_t b)
void operator()(i64_trunc_s_f64_t)
void operator()(i32_shl_t)
void operator()(f32_le_t b)
void operator()(f64_ge_t b)
void operator()(i64_gt_s_t b)
void operator()(i64_div_s_t)
void operator()(i64_extend_u_i32_t)
void operator()(select_t b)
void operator()(f32_add_t)
void operator()(f64_reinterpret_i64_t)
void operator()(i64_extend_s_i32_t)
void operator()(i64_reinterpret_f64_t)
void operator()(i32_trunc_u_f64_t)
void operator()(get_global_t b)
void operator()(f32_lt_t b)
void operator()(i32_wrap_i64_t)
void operator()(i64_or_t)
void operator()(f64_ne_t b)
void operator()(i64_rotl_t)
void operator()(i32_load_t b)
void operator()(i32_add_t)
void operator()(i32_eqz_t b)
void operator()(i32_lt_s_t b)
void operator()(f64_copysign_t)
void operator()(i32_le_s_t b)
void operator()(i64_mul_t)
void operator()(f64_min_t)
void operator()(i64_ctz_t)
void operator()(i64_clz_t)
void operator()(i32_or_t)
void operator()(i32_rotr_t)
void operator()(f64_convert_u_i64_t)
void operator()(i32_trunc_s_f64_t)
void operator()(i64_load32_s_t b)
void operator()(set_local_t b)
void operator()(f64_max_t)
void operator()(i64_add_t)
void operator()(set_global_t b)
void operator()(i32_reinterpret_f32_t)
void operator()(call_indirect_t b)
void operator()(i64_div_u_t)
void operator()(br_table_t b)
void operator()(f32_convert_u_i32_t)
void operator()(i64_gt_u_t b)
void operator()(i32_lt_u_t b)
void operator()(f64_add_t)
void operator()(i64_shl_t)
void operator()(f64_convert_u_i32_t)
void operator()(f64_abs_t)
void operator()(f32_ge_t b)
void operator()(f32_store_t b)
void operator()(i32_rem_s_t)
void operator()(f32_sqrt_t)
void operator()(i64_le_u_t b)
void operator()(call_t b)
void operator()(i64_rem_u_t)
void operator()(grow_memory_t b)
void operator()(f32_load_t b)
void operator()(f32_mul_t)
void operator()(f32_copysign_t)
void operator()(i64_shr_u_t)
void operator()(f32_const_t b)
void operator()(f32_ceil_t)
void operator()(f64_neg_t)
void operator()(i64_trunc_u_f32_t)
void operator()(i64_ge_s_t b)
void operator()(i32_store_t b)
void operator()(i32_sub_t)
void operator()(i64_trunc_u_f64_t)
void operator()(i64_trunc_s_f32_t)
void operator()(f64_store_t b)
void operator()(f32_nearest_t)
void operator()(f32_trunc_t)
void operator()(i32_mul_t)
void operator()(f64_load_t b)
void operator()(f32_sub_t)
void operator()(i64_xor_t)
void operator()(i64_store_t b)
void operator()(f32_convert_s_i32_t)
void operator()(f32_eq_t b)
void operator()(f32_gt_t b)
void operator()(i32_eq_t b)
void operator()(f64_convert_s_i64_t)
void operator()(i32_and_t)
void operator()(i32_store8_t b)
void operator()(f64_ceil_t)
void operator()(i64_eq_t b)
void operator()(i64_shr_s_t)
void operator()(f64_convert_s_i32_t)
void operator()(i32_ge_s_t b)
void operator()(i64_store32_t b)
void operator()(f64_mul_t)
void operator()(f32_convert_u_i64_t)
void operator()(i64_and_t)
void operator()(i32_gt_s_t b)
void operator()(i64_load16_s_t b)
void operator()(f32_abs_t)
void operator()(tee_local_t b)
void operator()(f32_neg_t)
void operator()(f32_convert_s_i64_t)
void operator()(f32_max_t)
void operator()(i32_div_s_t)
void operator()(i32_ne_t b)
void operator()(current_memory_t b)
void operator()(f64_nearest_t)
void operator()(i32_gt_u_t b)
void operator()(f32_div_t)
void operator()(f64_div_t)
void operator()(f64_le_t b)
void operator()(f64_sqrt_t)
void operator()(br_if_t b)
void operator()(f64_lt_t b)
void operator()(i64_ge_u_t b)
void operator()(f64_trunc_t)
void operator()(i64_lt_s_t b)
void operator()(i64_rotr_t)
void operator()(i64_eqz_t b)