aboutsummaryrefslogtreecommitdiff
path: root/private_include/nw/ops.h
blob: d4134d8aa19971918fa38c434e0ddcebb47aac26 (plain) (blame)
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
/*
 * nanowasm, a tiny WebAssembly/Wasm interpreter
 * Copyright (C) 2023-2025  Xavier Del Campo Romero
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at https://mozilla.org/MPL/2.0/.
 */

#ifndef OPS_H
#define OPS_H

#include <nanowasm/nw.h>
#include <nw/opcodes.h>
#include <nw/types.h>

void nwp_op_unreachable(struct nw_interp *i);
void nwp_op_nop(struct nw_interp *i);
void nwp_op_block(struct nw_interp *i);
void nwp_op_loop(struct nw_interp *i);
void nwp_op_if(struct nw_interp *i);
void nwp_op_else(struct nw_interp *i);
void nwp_op_end(struct nw_interp *i);
void nwp_op_br(struct nw_interp *i);
void nwp_op_br_if(struct nw_interp *i);
void nwp_op_br_table(struct nw_interp *i);
void nwp_op_return(struct nw_interp *i);
void nwp_op_call(struct nw_interp *i);
void nwp_op_call_indirect(struct nw_interp *i);
void nwp_op_drop(struct nw_interp *i);
void nwp_op_get_local(struct nw_interp *i);
void nwp_op_set_local(struct nw_interp *i);
void nwp_op_tee_local(struct nw_interp *i);
void nwp_op_set_global(struct nw_interp *i);
void nwp_op_get_global(struct nw_interp *i);
void nwp_op_set_global(struct nw_interp *i);
void nwp_op_i32_load(struct nw_interp *i);
void nwp_op_i32_load8_u(struct nw_interp *i);
void nwp_op_i32_store(struct nw_interp *i);
void nwp_op_i64_store(struct nw_interp *i);
void nwp_op_i32_store8(struct nw_interp *i);
void nwp_op_current_memory(struct nw_interp *i);
void nwp_op_grow_memory(struct nw_interp *i);
void nwp_op_i32_const(struct nw_interp *i);
void nwp_op_i64_const(struct nw_interp *i);
void nwp_op_f32_const(struct nw_interp *i);
void nwp_op_f64_const(struct nw_interp *i);
void nwp_op_i32_add(struct nw_interp *i);
void nwp_op_i32_sub(struct nw_interp *i);
void nwp_op_i32_mul(struct nw_interp *i);
void nwp_op_i32_and(struct nw_interp *i);
void nwp_op_i32_or(struct nw_interp *i);
void nwp_op_i32_eqz(struct nw_interp *i);
void nwp_op_i32_eq(struct nw_interp *i);
void nwp_op_i32_ne(struct nw_interp *i);
void nwp_op_i32_lt_s(struct nw_interp *i);
void nwp_op_i32_lt_u(struct nw_interp *i);
void nwp_op_i32_gt_s(struct nw_interp *i);
void nwp_op_i32_gt_u(struct nw_interp *i);
void nwp_op_i32_le_s(struct nw_interp *i);
void nwp_op_i32_le_u(struct nw_interp *i);
void nwp_op_i32_ge_s(struct nw_interp *i);
void nwp_op_i32_ge_u(struct nw_interp *i);
void nwp_op_i32_shl(struct nw_interp *i);

void nwp_op_check_no_immediate(struct nw_mod *m);
void nwp_op_check_block(struct nw_mod *m);
void nwp_op_check_loop(struct nw_mod *m);
void nwp_op_check_end(struct nw_mod *m);
void nwp_op_check_relative_depth(struct nw_mod *m);
void nwp_op_check_br_table(struct nw_mod *m);
void nwp_op_check_call(struct nw_mod *m);
void nwp_op_check_call_indirect(struct nw_mod *m);
void nwp_op_check_local_index(struct nw_mod *m);
void nwp_op_check_global_index(struct nw_mod *m);
void nwp_op_check_memory_immediate(struct nw_mod *m);
void nwp_op_check_varuint1(struct nw_mod *m);
void nwp_op_check_varint32(struct nw_mod *m);
void nwp_op_check_varint64(struct nw_mod *m);
void nwp_op_check_uint32(struct nw_mod *m);
void nwp_op_check_uint64(struct nw_mod *m);
void nwp_op_check_misc(struct nw_mod *m);

struct nwp_check_op
{
    enum opcode start, end;
    void (*f)(struct nw_mod *);
};

struct nwp_check_ops
{
    const struct nwp_check_op *ops;
    size_t n;
};

extern const struct nwp_check_ops nwp_check_ops;

#endif