@grain/binaryen.ml 0.9.0 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- binaryen-archive/.gitignore +1 -0
- binaryen-archive/CHANGELOG.md +73 -0
- binaryen-archive/README.md +27 -3
- binaryen-archive/binaryen.opam +8 -8
- binaryen-archive/esy.lock/index.json +537 -460
- binaryen-archive/esy.lock/opam/{base.v0.14.1 → base.v0.14.2}/opam +4 -4
- binaryen-archive/esy.lock/opam/biniou.1.2.1/opam +1 -1
- binaryen-archive/esy.lock/opam/{cppo.1.6.7 → cppo.1.6.8}/opam +4 -6
- binaryen-archive/esy.lock/opam/{csexp.1.4.0 → csexp.1.5.1}/opam +11 -9
- binaryen-archive/esy.lock/opam/{dune-build-info.2.8.2 → dune-build-info.2.9.1}/opam +5 -5
- binaryen-archive/esy.lock/opam/{dune-configurator.2.8.2 → dune-configurator.2.9.1}/opam +5 -5
- binaryen-archive/esy.lock/opam/{dune.2.8.2 → dune.2.9.1}/opam +4 -4
- binaryen-archive/esy.lock/opam/easy-format.1.3.2/opam +1 -1
- binaryen-archive/esy.lock/opam/{fix.20201120 → fix.20211231}/opam +7 -5
- binaryen-archive/esy.lock/opam/js_of_ocaml-compiler.3.11.0/opam +54 -0
- binaryen-archive/esy.lock/opam/js_of_ocaml-ppx.3.11.0/opam +44 -0
- binaryen-archive/esy.lock/opam/js_of_ocaml.3.11.0/opam +45 -0
- binaryen-archive/esy.lock/opam/{menhir.20201216 → menhir.20211128}/opam +8 -6
- binaryen-archive/esy.lock/opam/{menhirLib.20201216 → menhirLib.20211128}/opam +8 -6
- binaryen-archive/esy.lock/opam/{menhirSdk.20201216 → menhirSdk.20211128}/opam +8 -6
- binaryen-archive/esy.lock/opam/ocaml-compiler-libs.v0.12.4/opam +39 -0
- binaryen-archive/esy.lock/opam/{ocaml-lsp-server.1.4.0 → ocaml-lsp-server.1.9.0}/opam +15 -12
- binaryen-archive/esy.lock/opam/{ocaml-migrate-parsetree.2.1.0 → ocaml-migrate-parsetree.2.3.0}/opam +13 -10
- binaryen-archive/esy.lock/opam/ocaml-version.3.4.0/opam +49 -0
- binaryen-archive/esy.lock/opam/ocamlbuild.0.14.0/opam +1 -1
- binaryen-archive/esy.lock/opam/{ocamlfind.1.8.1 → ocamlfind.1.9.1}/opam +19 -39
- binaryen-archive/esy.lock/opam/ocamlformat-rpc-lib.0.19.0/opam +40 -0
- binaryen-archive/esy.lock/opam/ocamlformat.0.18.0/opam +56 -0
- binaryen-archive/esy.lock/opam/{odoc.1.5.2 → odoc.1.5.3}/opam +12 -12
- binaryen-archive/esy.lock/opam/pp.1.1.2/opam +58 -0
- binaryen-archive/esy.lock/opam/ppx_derivers.1.2.1/opam +1 -1
- binaryen-archive/esy.lock/opam/ppx_yojson_conv_lib.v0.14.0/opam +2 -2
- binaryen-archive/esy.lock/opam/{ppxlib.0.21.0 → ppxlib.0.22.2}/opam +40 -32
- binaryen-archive/esy.lock/opam/{re.1.9.0 → re.1.10.3}/opam +8 -4
- binaryen-archive/esy.lock/opam/result.1.5/opam +2 -2
- binaryen-archive/esy.lock/opam/sexplib0.v0.14.0/opam +2 -2
- binaryen-archive/esy.lock/opam/spawn.v0.15.0/opam +56 -0
- binaryen-archive/esy.lock/opam/stdio.v0.14.0/opam +2 -2
- binaryen-archive/esy.lock/opam/{topkg.1.0.3 → topkg.1.0.4}/opam +18 -22
- binaryen-archive/esy.lock/opam/tyxml.4.5.0/opam +42 -0
- binaryen-archive/esy.lock/opam/uucp.14.0.0/opam +41 -0
- binaryen-archive/esy.lock/opam/{uuseg.13.0.0 → uuseg.14.0.0}/opam +22 -28
- binaryen-archive/esy.lock/opam/yojson.1.7.0/opam +1 -1
- binaryen-archive/esy.lock/overrides/{opam__s__ocamlfind_opam__c__1.8.1_opam_override/files/findlib-1.8.1.patch → opam__s__ocamlfind_opam__c__1.9.1_opam_override/files/findlib-1.9.1.patch} +0 -0
- binaryen-archive/esy.lock/overrides/{opam__s__ocamlfind_opam__c__1.8.1_opam_override → opam__s__ocamlfind_opam__c__1.9.1_opam_override}/package.json +1 -1
- binaryen-archive/js/binaryen.es5.js +5 -0
- binaryen-archive/js/dune +1 -6
- binaryen-archive/js/element_segment.ml +33 -0
- binaryen-archive/js/export.ml +37 -0
- binaryen-archive/js/expression.ml +935 -177
- binaryen-archive/js/function.ml +31 -0
- binaryen-archive/js/global.ml +29 -0
- binaryen-archive/js/import.ml +24 -0
- binaryen-archive/js/literal.ml +8 -4
- binaryen-archive/js/module.ml +42 -46
- binaryen-archive/js/op.ml +9 -78
- binaryen-archive/js/settings.ml +60 -0
- binaryen-archive/js/table.ml +20 -3
- binaryen-archive/js/type.ml +3 -0
- binaryen-archive/package.json +14 -20
- binaryen-archive/src/binaryen_stubs_exports.c +78 -0
- binaryen-archive/src/binaryen_stubs_expressions.c +1300 -0
- binaryen-archive/src/binaryen_stubs_features.c +7 -0
- binaryen-archive/src/binaryen_stubs_functions.c +78 -0
- binaryen-archive/src/binaryen_stubs_globals.c +63 -0
- binaryen-archive/src/binaryen_stubs_imports.c +29 -0
- binaryen-archive/src/binaryen_stubs_memory.c +1 -1
- binaryen-archive/src/binaryen_stubs_modules.c +0 -122
- binaryen-archive/src/binaryen_stubs_ops.c +19 -173
- binaryen-archive/src/binaryen_stubs_settings.c +145 -0
- binaryen-archive/src/binaryen_stubs_tables.c +121 -7
- binaryen-archive/src/binaryen_stubs_types.c +18 -0
- binaryen-archive/src/dune +5 -44
- binaryen-archive/src/element_segment.ml +13 -0
- binaryen-archive/src/export.ml +33 -0
- binaryen-archive/src/expression.ml +805 -76
- binaryen-archive/src/function.ml +18 -0
- binaryen-archive/src/global.ml +14 -0
- binaryen-archive/src/import.ml +12 -0
- binaryen-archive/src/literal.ml +2 -2
- binaryen-archive/src/module.ml +64 -38
- binaryen-archive/src/ocaml_helpers.c +0 -8
- binaryen-archive/src/ocaml_helpers.h +2 -3
- binaryen-archive/src/op.ml +18 -131
- binaryen-archive/src/settings.ml +45 -0
- binaryen-archive/src/table.ml +26 -4
- binaryen-archive/src/type.ml +2 -0
- binaryen-archive/test/config/dune +8 -0
- binaryen-archive/test/config/ocamlopt_flags.ml +16 -0
- binaryen-archive/test/dune +4 -0
- binaryen-archive/test/test.expected +38 -3
- binaryen-archive/test/test.ml +90 -18
- binaryen-archive/virtual/dune +2 -2
- binaryen-archive/virtual/element_segment.mli +11 -0
- binaryen-archive/virtual/export.mli +22 -0
- binaryen-archive/virtual/expression.mli +389 -34
- binaryen-archive/virtual/function.mli +16 -0
- binaryen-archive/virtual/global.mli +12 -0
- binaryen-archive/virtual/import.mli +8 -0
- binaryen-archive/virtual/literal.mli +2 -2
- binaryen-archive/virtual/module.mli +25 -27
- binaryen-archive/virtual/op.mli +9 -53
- binaryen-archive/virtual/settings.mli +35 -0
- binaryen-archive/virtual/table.mli +19 -2
- binaryen-archive/virtual/type.mli +2 -0
- binaryen-archive/esy.lock/opam/conf-m4.1/opam +0 -22
- binaryen-archive/esy.lock/opam/dot-merlin-reader.4.1/opam +0 -30
- binaryen-archive/esy.lock/opam/js_of_ocaml-compiler.3.9.1/opam +0 -40
- binaryen-archive/esy.lock/opam/js_of_ocaml-ppx.3.9.0/opam +0 -30
- binaryen-archive/esy.lock/opam/js_of_ocaml.3.9.0/opam +0 -31
- binaryen-archive/esy.lock/opam/ocaml-compiler-libs.v0.12.3/opam +0 -29
- binaryen-archive/esy.lock/opam/ocamlfind.1.8.1/files/ocaml-stub +0 -4
- binaryen-archive/esy.lock/opam/ocamlfind.1.8.1/files/ocamlfind.install +0 -6
- binaryen-archive/esy.lock/opam/ocamlformat.0.15.1/opam +0 -41
- binaryen-archive/esy.lock/opam/tyxml.4.4.0/opam +0 -47
- binaryen-archive/esy.lock/opam/uucp.13.0.0/opam +0 -44
- binaryen-archive/esy.lock/overrides/opam__s__conf_m4_opam__c__1_opam_override/package.json +0 -6
- binaryen-archive/js/features.ml +0 -27
- binaryen-archive/js/function_table.ml +0 -13
- binaryen-archive/src/binaryen_stubs_function_tables.c +0 -25
- binaryen-archive/src/config/dune +0 -8
- binaryen-archive/src/config/library_flags.ml +0 -16
- binaryen-archive/src/features.ml +0 -49
- binaryen-archive/src/function_table.ml +0 -6
- binaryen-archive/vendor/binaryen-c.h +0 -2647
- binaryen-archive/vendor/js/index.es5.js +0 -5
- binaryen-archive/vendor/linux/libbinaryen.a +0 -0
- binaryen-archive/vendor/linux/libbinaryen.so +0 -0
- binaryen-archive/vendor/macosx/libbinaryen.a +0 -0
- binaryen-archive/vendor/macosx/libbinaryen.dylib +0 -0
- binaryen-archive/vendor/mingw64/libbinaryen.a +0 -0
- binaryen-archive/vendor/mingw64/libbinaryen.dll +0 -0
- binaryen-archive/vendor/wasm-delegations.h +0 -85
- binaryen-archive/virtual/features.mli +0 -23
- binaryen-archive/virtual/function_table.mli +0 -4
binaryen-archive/src/function.ml
CHANGED
|
@@ -12,7 +12,25 @@ external set_debug_location : t -> Expression.t -> int -> int -> int -> unit
|
|
|
12
12
|
|
|
13
13
|
external get_function : Module.t -> string -> t = "caml_binaryen_get_function"
|
|
14
14
|
|
|
15
|
+
external get_function_by_index : Module.t -> int -> t
|
|
16
|
+
= "caml_binaryen_get_function_by_index"
|
|
17
|
+
|
|
15
18
|
external remove_function : Module.t -> string -> unit
|
|
16
19
|
= "caml_binaryen_remove_function"
|
|
17
20
|
|
|
18
21
|
external get_num_functions : Module.t -> int = "caml_binaryen_get_num_functions"
|
|
22
|
+
|
|
23
|
+
external get_name : t -> string = "caml_binaryen_function_get_name"
|
|
24
|
+
|
|
25
|
+
external get_params : t -> Type.t = "caml_binaryen_function_get_params"
|
|
26
|
+
|
|
27
|
+
external get_results : t -> Type.t = "caml_binaryen_function_get_results"
|
|
28
|
+
|
|
29
|
+
external get_num_vars : t -> int = "caml_binaryen_function_get_num_vars"
|
|
30
|
+
|
|
31
|
+
external get_var : t -> int -> Type.t = "caml_binaryen_function_get_var"
|
|
32
|
+
|
|
33
|
+
external get_body : t -> Expression.t = "caml_binaryen_function_get_body"
|
|
34
|
+
|
|
35
|
+
external set_body : t -> Expression.t -> unit
|
|
36
|
+
= "caml_binaryen_function_set_body"
|
binaryen-archive/src/global.ml
CHANGED
|
@@ -8,3 +8,17 @@ external get_global : Module.t -> string -> t = "caml_binaryen_get_global"
|
|
|
8
8
|
|
|
9
9
|
external remove_global : Module.t -> string -> unit
|
|
10
10
|
= "caml_binaryen_remove_global"
|
|
11
|
+
|
|
12
|
+
external get_num_globals : Module.t -> int = "caml_binaryen_get_num_globals"
|
|
13
|
+
|
|
14
|
+
external get_global_by_index : Module.t -> int -> t
|
|
15
|
+
= "caml_binaryen_get_global_by_index"
|
|
16
|
+
|
|
17
|
+
external get_name : t -> string = "caml_binaryen_global_get_name"
|
|
18
|
+
|
|
19
|
+
external get_type : t -> Type.t = "caml_binaryen_global_get_type"
|
|
20
|
+
|
|
21
|
+
external is_mutable : t -> bool = "caml_binaryen_global_is_mutable"
|
|
22
|
+
|
|
23
|
+
external get_init_expr : t -> Expression.t
|
|
24
|
+
= "caml_binaryen_global_get_init_expr"
|
binaryen-archive/src/import.ml
CHANGED
|
@@ -16,3 +16,15 @@ external add_global_import :
|
|
|
16
16
|
Module.t -> string -> string -> string -> Type.t -> bool -> unit
|
|
17
17
|
= "caml_binaryen_add_global_import__bytecode" "caml_binaryen_add_global_import"
|
|
18
18
|
(** Module, internal name, external module name, external base name, type, mutable. *)
|
|
19
|
+
|
|
20
|
+
external function_import_get_module : Function.t -> string
|
|
21
|
+
= "caml_binaryen_function_import_get_module"
|
|
22
|
+
|
|
23
|
+
external global_import_get_module : Global.t -> string
|
|
24
|
+
= "caml_binaryen_global_import_get_module"
|
|
25
|
+
|
|
26
|
+
external function_import_get_base : Function.t -> string
|
|
27
|
+
= "caml_binaryen_function_import_get_base"
|
|
28
|
+
|
|
29
|
+
external global_import_get_base : Global.t -> string
|
|
30
|
+
= "caml_binaryen_global_import_get_base"
|
binaryen-archive/src/literal.ml
CHANGED
|
@@ -15,9 +15,9 @@ external float64 : float -> t = "caml_binaryen_literal_float64"
|
|
|
15
15
|
(* Hacks for Binaryen.js stack allocations, Don't use in binaryen.native *)
|
|
16
16
|
type jsoo =
|
|
17
17
|
| Int32 of int32
|
|
18
|
-
| Int64 of
|
|
18
|
+
| Int64 of int32 * int32
|
|
19
19
|
| Float32Bits of int32
|
|
20
|
-
| Float64Bits of
|
|
20
|
+
| Float64Bits of int32 * int32
|
|
21
21
|
| Float32 of float
|
|
22
22
|
| Float64 of float
|
|
23
23
|
|
binaryen-archive/src/module.ml
CHANGED
|
@@ -4,69 +4,95 @@ let _ = Callback.register "array_length" Array.length
|
|
|
4
4
|
|
|
5
5
|
type t
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
module Feature = struct
|
|
8
|
+
type t = int
|
|
8
9
|
|
|
9
|
-
external
|
|
10
|
+
external mvp : unit -> t = "caml_binaryen_feature_mvp"
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
= "caml_binaryen_add_custom_section"
|
|
12
|
+
let mvp = mvp ()
|
|
13
13
|
|
|
14
|
-
external
|
|
14
|
+
external atomics : unit -> t = "caml_binaryen_feature_atomics"
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
let atomics = atomics ()
|
|
17
17
|
|
|
18
|
-
external
|
|
18
|
+
external bulk_memory : unit -> t = "caml_binaryen_feature_bulk_memory"
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
let bulk_memory = bulk_memory ()
|
|
21
21
|
|
|
22
|
-
external
|
|
22
|
+
external mutable_globals : unit -> t = "caml_binaryen_feature_mutable_globals"
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
let mutable_globals = mutable_globals ()
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
external nontrapping_fp_to_int : unit -> t
|
|
27
|
+
= "caml_binaryen_feature_nontrapping_fp_to_int"
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
let nontrapping_fp_to_int = nontrapping_fp_to_int ()
|
|
30
30
|
|
|
31
|
-
external
|
|
31
|
+
external sign_ext : unit -> t = "caml_binaryen_feature_sign_ext"
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
let sign_ext = sign_ext ()
|
|
34
34
|
|
|
35
|
-
external
|
|
35
|
+
external simd128 : unit -> t = "caml_binaryen_feature_simd128"
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
let simd128 = simd128 ()
|
|
38
38
|
|
|
39
|
-
external
|
|
39
|
+
external exception_handling : unit -> t
|
|
40
|
+
= "caml_binaryen_feature_exception_handling"
|
|
40
41
|
|
|
41
|
-
|
|
42
|
-
= "caml_binaryen_get_low_memory_unused"
|
|
42
|
+
let exception_handling = exception_handling ()
|
|
43
43
|
|
|
44
|
-
external
|
|
45
|
-
= "caml_binaryen_set_low_memory_unused"
|
|
44
|
+
external tail_call : unit -> t = "caml_binaryen_feature_tail_call"
|
|
46
45
|
|
|
47
|
-
|
|
48
|
-
= "caml_binaryen_get_pass_argument"
|
|
46
|
+
let tail_call = tail_call ()
|
|
49
47
|
|
|
50
|
-
external
|
|
51
|
-
= "caml_binaryen_set_pass_argument"
|
|
48
|
+
external reference_types : unit -> t = "caml_binaryen_feature_reference_types"
|
|
52
49
|
|
|
53
|
-
|
|
54
|
-
= "caml_binaryen_get_always_inline_max_size"
|
|
50
|
+
let reference_types = reference_types ()
|
|
55
51
|
|
|
56
|
-
external
|
|
57
|
-
= "caml_binaryen_set_always_inline_max_size"
|
|
52
|
+
external multivalue : unit -> t = "caml_binaryen_feature_multivalue"
|
|
58
53
|
|
|
59
|
-
|
|
60
|
-
= "caml_binaryen_get_flexible_inline_max_size"
|
|
54
|
+
let multivalue = multivalue ()
|
|
61
55
|
|
|
62
|
-
external
|
|
63
|
-
= "caml_binaryen_set_flexible_inline_max_size"
|
|
56
|
+
external all : unit -> t = "caml_binaryen_feature_all"
|
|
64
57
|
|
|
65
|
-
|
|
66
|
-
|
|
58
|
+
let all = all ()
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
external create : unit -> t = "caml_binaryen_module_create"
|
|
67
62
|
|
|
68
|
-
external
|
|
69
|
-
|
|
63
|
+
external dispose : t -> unit = "caml_binaryen_module_dispose"
|
|
64
|
+
|
|
65
|
+
external add_custom_section : t -> string -> string -> unit
|
|
66
|
+
= "caml_binaryen_add_custom_section"
|
|
67
|
+
|
|
68
|
+
external parse : string -> t = "caml_binaryen_module_parse"
|
|
69
|
+
|
|
70
|
+
external print : t -> unit = "caml_binaryen_module_print"
|
|
71
|
+
|
|
72
|
+
external print_asmjs : t -> unit = "caml_binaryen_module_print_asmjs"
|
|
73
|
+
|
|
74
|
+
external validate : t -> int = "caml_binaryen_module_validate"
|
|
75
|
+
|
|
76
|
+
external optimize : t -> unit = "caml_binaryen_module_optimize"
|
|
77
|
+
|
|
78
|
+
external get_features : t -> int = "caml_binaryen_module_get_features"
|
|
79
|
+
|
|
80
|
+
let get_features wasm_mod =
|
|
81
|
+
let features_int = get_features wasm_mod in
|
|
82
|
+
let rec split_features = function
|
|
83
|
+
| 0 -> []
|
|
84
|
+
| feature when features_int land feature > 0 ->
|
|
85
|
+
feature :: split_features (feature lsr 1)
|
|
86
|
+
| feature -> split_features (feature lsr 1)
|
|
87
|
+
in
|
|
88
|
+
(* Support 32-bit OCaml where integers are 31 bits *)
|
|
89
|
+
(* This supports up to 31 Binaryen features *)
|
|
90
|
+
split_features 0x40000000
|
|
91
|
+
|
|
92
|
+
external set_features : t -> int -> unit = "caml_binaryen_module_set_features"
|
|
93
|
+
|
|
94
|
+
let set_features wasm_mod features =
|
|
95
|
+
set_features wasm_mod (List.fold_left ( lor ) 0 features)
|
|
70
96
|
|
|
71
97
|
external run_passes : t -> string list -> unit
|
|
72
98
|
= "caml_binaryen_module_run_passes"
|
|
@@ -7,14 +7,6 @@
|
|
|
7
7
|
#include "ocaml_helpers.h"
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
CAMLprim value
|
|
11
|
-
caml_alloc_some(value v) {
|
|
12
|
-
CAMLparam1(v);
|
|
13
|
-
value some = caml_alloc_small(1, 0);
|
|
14
|
-
Store_field(some, 0, v);
|
|
15
|
-
CAMLreturn(some);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
10
|
CAMLprim value
|
|
19
11
|
array_of_list(value list) {
|
|
20
12
|
CAMLparam1(list);
|
|
@@ -29,6 +29,8 @@ static struct custom_operations binaryen_ops = {
|
|
|
29
29
|
#define BinaryenFunctionRef_val(v) (*((BinaryenFunctionRef*) Data_custom_val(v)))
|
|
30
30
|
#define BinaryenGlobalRef_val(v) (*((BinaryenGlobalRef*) Data_custom_val(v)))
|
|
31
31
|
#define BinaryenExportRef_val(v) (*((BinaryenExportRef*) Data_custom_val(v)))
|
|
32
|
+
#define BinaryenTableRef_val(v) (*((BinaryenTableRef*) Data_custom_val(v)))
|
|
33
|
+
#define BinaryenElementSegmentRef_val(v) (*((BinaryenElementSegmentRef*) Data_custom_val(v)))
|
|
32
34
|
|
|
33
35
|
#define Val_none Val_int(0)
|
|
34
36
|
#define Some_val(v) Field(v, 0)
|
|
@@ -38,9 +40,6 @@ static struct custom_operations binaryen_ops = {
|
|
|
38
40
|
|
|
39
41
|
#define Safe_String_val(v) ((char *)memcpy(malloc(caml_string_length(v) + 1), String_val(v), caml_string_length(v) + 1))
|
|
40
42
|
|
|
41
|
-
CAMLprim value
|
|
42
|
-
caml_alloc_some(value v);
|
|
43
|
-
|
|
44
43
|
CAMLprim value
|
|
45
44
|
array_of_list(value list);
|
|
46
45
|
|
binaryen-archive/src/op.ml
CHANGED
|
@@ -896,11 +896,6 @@ external neg_vec_i8x16 : unit -> t = "caml_binaryen_binaryen_neg_vec_i8x16"
|
|
|
896
896
|
|
|
897
897
|
let neg_vec_i8x16 = neg_vec_i8x16 ()
|
|
898
898
|
|
|
899
|
-
external any_true_vec_i8x16 : unit -> t
|
|
900
|
-
= "caml_binaryen_binaryen_any_true_vec_i8x16"
|
|
901
|
-
|
|
902
|
-
let any_true_vec_i8x16 = any_true_vec_i8x16 ()
|
|
903
|
-
|
|
904
899
|
external all_true_vec_i8x16 : unit -> t
|
|
905
900
|
= "caml_binaryen_binaryen_all_true_vec_i8x16"
|
|
906
901
|
|
|
@@ -951,10 +946,6 @@ external sub_sat_u_vec_i8x16 : unit -> t
|
|
|
951
946
|
|
|
952
947
|
let sub_sat_u_vec_i8x16 = sub_sat_u_vec_i8x16 ()
|
|
953
948
|
|
|
954
|
-
external mul_vec_i8x16 : unit -> t = "caml_binaryen_binaryen_mul_vec_i8x16"
|
|
955
|
-
|
|
956
|
-
let mul_vec_i8x16 = mul_vec_i8x16 ()
|
|
957
|
-
|
|
958
949
|
external min_s_vec_i8x16 : unit -> t = "caml_binaryen_binaryen_min_s_vec_i8x16"
|
|
959
950
|
|
|
960
951
|
let min_s_vec_i8x16 = min_s_vec_i8x16 ()
|
|
@@ -984,11 +975,6 @@ external neg_vec_i16x8 : unit -> t = "caml_binaryen_binaryen_neg_vec_i16x8"
|
|
|
984
975
|
|
|
985
976
|
let neg_vec_i16x8 = neg_vec_i16x8 ()
|
|
986
977
|
|
|
987
|
-
external any_true_vec_i16x8 : unit -> t
|
|
988
|
-
= "caml_binaryen_binaryen_any_true_vec_i16x8"
|
|
989
|
-
|
|
990
|
-
let any_true_vec_i16x8 = any_true_vec_i16x8 ()
|
|
991
|
-
|
|
992
978
|
external all_true_vec_i16x8 : unit -> t
|
|
993
979
|
= "caml_binaryen_binaryen_all_true_vec_i16x8"
|
|
994
980
|
|
|
@@ -1072,11 +1058,6 @@ external neg_vec_i32x4 : unit -> t = "caml_binaryen_binaryen_neg_vec_i32x4"
|
|
|
1072
1058
|
|
|
1073
1059
|
let neg_vec_i32x4 = neg_vec_i32x4 ()
|
|
1074
1060
|
|
|
1075
|
-
external any_true_vec_i32x4 : unit -> t
|
|
1076
|
-
= "caml_binaryen_binaryen_any_true_vec_i32x4"
|
|
1077
|
-
|
|
1078
|
-
let any_true_vec_i32x4 = any_true_vec_i32x4 ()
|
|
1079
|
-
|
|
1080
1061
|
external all_true_vec_i32x4 : unit -> t
|
|
1081
1062
|
= "caml_binaryen_binaryen_all_true_vec_i32x4"
|
|
1082
1063
|
|
|
@@ -1172,14 +1153,6 @@ external sqrt_vec_f32x4 : unit -> t = "caml_binaryen_binaryen_sqrt_vec_f32x4"
|
|
|
1172
1153
|
|
|
1173
1154
|
let sqrt_vec_f32x4 = sqrt_vec_f32x4 ()
|
|
1174
1155
|
|
|
1175
|
-
external qfma_vec_f32x4 : unit -> t = "caml_binaryen_binaryen_qfma_vec_f32x4"
|
|
1176
|
-
|
|
1177
|
-
let qfma_vec_f32x4 = qfma_vec_f32x4 ()
|
|
1178
|
-
|
|
1179
|
-
external qfms_vec_f32x4 : unit -> t = "caml_binaryen_binaryen_qfms_vec_f32x4"
|
|
1180
|
-
|
|
1181
|
-
let qfms_vec_f32x4 = qfms_vec_f32x4 ()
|
|
1182
|
-
|
|
1183
1156
|
external add_vec_f32x4 : unit -> t = "caml_binaryen_binaryen_add_vec_f32x4"
|
|
1184
1157
|
|
|
1185
1158
|
let add_vec_f32x4 = add_vec_f32x4 ()
|
|
@@ -1241,14 +1214,6 @@ external sqrt_vec_f64x2 : unit -> t = "caml_binaryen_binaryen_sqrt_vec_f64x2"
|
|
|
1241
1214
|
|
|
1242
1215
|
let sqrt_vec_f64x2 = sqrt_vec_f64x2 ()
|
|
1243
1216
|
|
|
1244
|
-
external qfma_vec_f64x2 : unit -> t = "caml_binaryen_binaryen_qfma_vec_f64x2"
|
|
1245
|
-
|
|
1246
|
-
let qfma_vec_f64x2 = qfma_vec_f64x2 ()
|
|
1247
|
-
|
|
1248
|
-
external qfms_vec_f64x2 : unit -> t = "caml_binaryen_binaryen_qfms_vec_f64x2"
|
|
1249
|
-
|
|
1250
|
-
let qfms_vec_f64x2 = qfms_vec_f64x2 ()
|
|
1251
|
-
|
|
1252
1217
|
external add_vec_f64x2 : unit -> t = "caml_binaryen_binaryen_add_vec_f64x2"
|
|
1253
1218
|
|
|
1254
1219
|
let add_vec_f64x2 = add_vec_f64x2 ()
|
|
@@ -1308,16 +1273,6 @@ external trunc_sat_u_vec_f32x4_to_vec_i32x4 : unit -> t
|
|
|
1308
1273
|
|
|
1309
1274
|
let trunc_sat_u_vec_f32x4_to_vec_i32x4 = trunc_sat_u_vec_f32x4_to_vec_i32x4 ()
|
|
1310
1275
|
|
|
1311
|
-
external trunc_sat_s_vec_f64x2_to_vec_i64x2 : unit -> t
|
|
1312
|
-
= "caml_binaryen_binaryen_trunc_sat_s_vec_f64x2_to_vec_i64x2"
|
|
1313
|
-
|
|
1314
|
-
let trunc_sat_s_vec_f64x2_to_vec_i64x2 = trunc_sat_s_vec_f64x2_to_vec_i64x2 ()
|
|
1315
|
-
|
|
1316
|
-
external trunc_sat_u_vec_f64x2_to_vec_i64x2 : unit -> t
|
|
1317
|
-
= "caml_binaryen_binaryen_trunc_sat_u_vec_f64x2_to_vec_i64x2"
|
|
1318
|
-
|
|
1319
|
-
let trunc_sat_u_vec_f64x2_to_vec_i64x2 = trunc_sat_u_vec_f64x2_to_vec_i64x2 ()
|
|
1320
|
-
|
|
1321
1276
|
external convert_s_vec_i32x4_to_vec_f32x4 : unit -> t
|
|
1322
1277
|
= "caml_binaryen_binaryen_convert_s_vec_i32x4_to_vec_f32x4"
|
|
1323
1278
|
|
|
@@ -1328,66 +1283,6 @@ external convert_u_vec_i32x4_to_vec_f32x4 : unit -> t
|
|
|
1328
1283
|
|
|
1329
1284
|
let convert_u_vec_i32x4_to_vec_f32x4 = convert_u_vec_i32x4_to_vec_f32x4 ()
|
|
1330
1285
|
|
|
1331
|
-
external convert_s_vec_i64x2_to_vec_f64x2 : unit -> t
|
|
1332
|
-
= "caml_binaryen_binaryen_convert_s_vec_i64x2_to_vec_f64x2"
|
|
1333
|
-
|
|
1334
|
-
let convert_s_vec_i64x2_to_vec_f64x2 = convert_s_vec_i64x2_to_vec_f64x2 ()
|
|
1335
|
-
|
|
1336
|
-
external convert_u_vec_i64x2_to_vec_f64x2 : unit -> t
|
|
1337
|
-
= "caml_binaryen_binaryen_convert_u_vec_i64x2_to_vec_f64x2"
|
|
1338
|
-
|
|
1339
|
-
let convert_u_vec_i64x2_to_vec_f64x2 = convert_u_vec_i64x2_to_vec_f64x2 ()
|
|
1340
|
-
|
|
1341
|
-
external load_splat_vec8x16 : unit -> t
|
|
1342
|
-
= "caml_binaryen_binaryen_load_splat_vec8x16"
|
|
1343
|
-
|
|
1344
|
-
let load_splat_vec8x16 = load_splat_vec8x16 ()
|
|
1345
|
-
|
|
1346
|
-
external load_splat_vec16x8 : unit -> t
|
|
1347
|
-
= "caml_binaryen_binaryen_load_splat_vec16x8"
|
|
1348
|
-
|
|
1349
|
-
let load_splat_vec16x8 = load_splat_vec16x8 ()
|
|
1350
|
-
|
|
1351
|
-
external load_splat_vec32x4 : unit -> t
|
|
1352
|
-
= "caml_binaryen_binaryen_load_splat_vec32x4"
|
|
1353
|
-
|
|
1354
|
-
let load_splat_vec32x4 = load_splat_vec32x4 ()
|
|
1355
|
-
|
|
1356
|
-
external load_splat_vec64x2 : unit -> t
|
|
1357
|
-
= "caml_binaryen_binaryen_load_splat_vec64x2"
|
|
1358
|
-
|
|
1359
|
-
let load_splat_vec64x2 = load_splat_vec64x2 ()
|
|
1360
|
-
|
|
1361
|
-
external load_ext_s_vec8x8_to_vec_i16x8 : unit -> t
|
|
1362
|
-
= "caml_binaryen_binaryen_load_ext_s_vec8x8_to_vec_i16x8"
|
|
1363
|
-
|
|
1364
|
-
let load_ext_s_vec8x8_to_vec_i16x8 = load_ext_s_vec8x8_to_vec_i16x8 ()
|
|
1365
|
-
|
|
1366
|
-
external load_ext_u_vec8x8_to_vec_i16x8 : unit -> t
|
|
1367
|
-
= "caml_binaryen_binaryen_load_ext_u_vec8x8_to_vec_i16x8"
|
|
1368
|
-
|
|
1369
|
-
let load_ext_u_vec8x8_to_vec_i16x8 = load_ext_u_vec8x8_to_vec_i16x8 ()
|
|
1370
|
-
|
|
1371
|
-
external load_ext_s_vec16x4_to_vec_i32x4 : unit -> t
|
|
1372
|
-
= "caml_binaryen_binaryen_load_ext_s_vec16x4_to_vec_i32x4"
|
|
1373
|
-
|
|
1374
|
-
let load_ext_s_vec16x4_to_vec_i32x4 = load_ext_s_vec16x4_to_vec_i32x4 ()
|
|
1375
|
-
|
|
1376
|
-
external load_ext_u_vec16x4_to_vec_i32x4 : unit -> t
|
|
1377
|
-
= "caml_binaryen_binaryen_load_ext_u_vec16x4_to_vec_i32x4"
|
|
1378
|
-
|
|
1379
|
-
let load_ext_u_vec16x4_to_vec_i32x4 = load_ext_u_vec16x4_to_vec_i32x4 ()
|
|
1380
|
-
|
|
1381
|
-
external load_ext_s_vec32x2_to_vec_i64x2 : unit -> t
|
|
1382
|
-
= "caml_binaryen_binaryen_load_ext_s_vec32x2_to_vec_i64x2"
|
|
1383
|
-
|
|
1384
|
-
let load_ext_s_vec32x2_to_vec_i64x2 = load_ext_s_vec32x2_to_vec_i64x2 ()
|
|
1385
|
-
|
|
1386
|
-
external load_ext_u_vec32x2_to_vec_i64x2 : unit -> t
|
|
1387
|
-
= "caml_binaryen_binaryen_load_ext_u_vec32x2_to_vec_i64x2"
|
|
1388
|
-
|
|
1389
|
-
let load_ext_u_vec32x2_to_vec_i64x2 = load_ext_u_vec32x2_to_vec_i64x2 ()
|
|
1390
|
-
|
|
1391
1286
|
external narrow_s_vec_i16x8_to_vec_i8x16 : unit -> t
|
|
1392
1287
|
= "caml_binaryen_binaryen_narrow_s_vec_i16x8_to_vec_i8x16"
|
|
1393
1288
|
|
|
@@ -1408,46 +1303,38 @@ external narrow_u_vec_i32x4_to_vec_i16x8 : unit -> t
|
|
|
1408
1303
|
|
|
1409
1304
|
let narrow_u_vec_i32x4_to_vec_i16x8 = narrow_u_vec_i32x4_to_vec_i16x8 ()
|
|
1410
1305
|
|
|
1411
|
-
external
|
|
1412
|
-
= "caml_binaryen_binaryen_widen_low_s_vec_i8x16_to_vec_i16x8"
|
|
1306
|
+
external swizzle_vec8x16 : unit -> t = "caml_binaryen_binaryen_swizzle_vec8x16"
|
|
1413
1307
|
|
|
1414
|
-
let
|
|
1308
|
+
let swizzle_vec8x16 = swizzle_vec8x16 ()
|
|
1415
1309
|
|
|
1416
|
-
external
|
|
1417
|
-
= "caml_binaryen_binaryen_widen_high_s_vec_i8x16_to_vec_i16x8"
|
|
1310
|
+
external ref_is_null : unit -> t = "caml_binaryen_binaryen_ref_is_null"
|
|
1418
1311
|
|
|
1419
|
-
let
|
|
1312
|
+
let ref_is_null = ref_is_null ()
|
|
1420
1313
|
|
|
1421
|
-
external
|
|
1422
|
-
= "caml_binaryen_binaryen_widen_low_u_vec_i8x16_to_vec_i16x8"
|
|
1314
|
+
external ref_is_func : unit -> t = "caml_binaryen_binaryen_ref_is_func"
|
|
1423
1315
|
|
|
1424
|
-
let
|
|
1316
|
+
let ref_is_func = ref_is_func ()
|
|
1425
1317
|
|
|
1426
|
-
external
|
|
1427
|
-
= "caml_binaryen_binaryen_widen_high_u_vec_i8x16_to_vec_i16x8"
|
|
1318
|
+
external ref_is_data : unit -> t = "caml_binaryen_binaryen_ref_is_data"
|
|
1428
1319
|
|
|
1429
|
-
let
|
|
1320
|
+
let ref_is_data = ref_is_data ()
|
|
1430
1321
|
|
|
1431
|
-
external
|
|
1432
|
-
= "caml_binaryen_binaryen_widen_low_s_vec_i16x8_to_vec_i32x4"
|
|
1322
|
+
external ref_is_i31 : unit -> t = "caml_binaryen_binaryen_ref_is_i31"
|
|
1433
1323
|
|
|
1434
|
-
let
|
|
1324
|
+
let ref_is_i31 = ref_is_i31 ()
|
|
1435
1325
|
|
|
1436
|
-
external
|
|
1437
|
-
= "caml_binaryen_binaryen_widen_high_s_vec_i16x8_to_vec_i32x4"
|
|
1326
|
+
external ref_as_non_null : unit -> t = "caml_binaryen_binaryen_ref_as_non_null"
|
|
1438
1327
|
|
|
1439
|
-
let
|
|
1328
|
+
let ref_as_non_null = ref_as_non_null ()
|
|
1440
1329
|
|
|
1441
|
-
external
|
|
1442
|
-
= "caml_binaryen_binaryen_widen_low_u_vec_i16x8_to_vec_i32x4"
|
|
1330
|
+
external ref_as_func : unit -> t = "caml_binaryen_binaryen_ref_as_func"
|
|
1443
1331
|
|
|
1444
|
-
let
|
|
1332
|
+
let ref_as_func = ref_as_func ()
|
|
1445
1333
|
|
|
1446
|
-
external
|
|
1447
|
-
= "caml_binaryen_binaryen_widen_high_u_vec_i16x8_to_vec_i32x4"
|
|
1334
|
+
external ref_as_data : unit -> t = "caml_binaryen_binaryen_ref_as_data"
|
|
1448
1335
|
|
|
1449
|
-
let
|
|
1336
|
+
let ref_as_data = ref_as_data ()
|
|
1450
1337
|
|
|
1451
|
-
external
|
|
1338
|
+
external ref_as_i31 : unit -> t = "caml_binaryen_binaryen_ref_as_i31"
|
|
1452
1339
|
|
|
1453
|
-
let
|
|
1340
|
+
let ref_as_i31 = ref_as_i31 ()
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
external get_optimize_level : unit -> int = "caml_binaryen_get_optimize_level"
|
|
2
|
+
|
|
3
|
+
external set_optimize_level : int -> unit = "caml_binaryen_set_optimize_level"
|
|
4
|
+
|
|
5
|
+
external get_shrink_level : unit -> int = "caml_binaryen_get_shrink_level"
|
|
6
|
+
|
|
7
|
+
external set_shrink_level : int -> unit = "caml_binaryen_set_shrink_level"
|
|
8
|
+
|
|
9
|
+
external get_debug_info : unit -> bool = "caml_binaryen_get_debug_info"
|
|
10
|
+
|
|
11
|
+
external set_debug_info : bool -> unit = "caml_binaryen_set_debug_info"
|
|
12
|
+
|
|
13
|
+
external get_low_memory_unused : unit -> bool
|
|
14
|
+
= "caml_binaryen_get_low_memory_unused"
|
|
15
|
+
|
|
16
|
+
external set_low_memory_unused : bool -> unit
|
|
17
|
+
= "caml_binaryen_set_low_memory_unused"
|
|
18
|
+
|
|
19
|
+
external get_pass_argument : string -> string
|
|
20
|
+
= "caml_binaryen_get_pass_argument"
|
|
21
|
+
|
|
22
|
+
external set_pass_argument : string -> string -> unit
|
|
23
|
+
= "caml_binaryen_set_pass_argument"
|
|
24
|
+
|
|
25
|
+
external get_always_inline_max_size : unit -> int
|
|
26
|
+
= "caml_binaryen_get_always_inline_max_size"
|
|
27
|
+
|
|
28
|
+
external set_always_inline_max_size : int -> unit
|
|
29
|
+
= "caml_binaryen_set_always_inline_max_size"
|
|
30
|
+
|
|
31
|
+
external get_flexible_inline_max_size : unit -> int
|
|
32
|
+
= "caml_binaryen_get_flexible_inline_max_size"
|
|
33
|
+
|
|
34
|
+
external set_flexible_inline_max_size : int -> unit
|
|
35
|
+
= "caml_binaryen_set_flexible_inline_max_size"
|
|
36
|
+
|
|
37
|
+
external get_one_caller_inline_max_size : unit -> int
|
|
38
|
+
= "caml_binaryen_get_one_caller_inline_max_size"
|
|
39
|
+
|
|
40
|
+
external set_one_caller_inline_max_size : int -> unit
|
|
41
|
+
= "caml_binaryen_set_one_caller_inline_max_size"
|
|
42
|
+
|
|
43
|
+
external set_colors_enabled : bool -> unit = "caml_binaryen_set_colors_enabled"
|
|
44
|
+
|
|
45
|
+
external are_colors_enabled : unit -> bool = "caml_binaryen_are_colors_enabled"
|
binaryen-archive/src/table.ml
CHANGED
|
@@ -1,4 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
type t
|
|
2
|
+
|
|
3
|
+
external add_table : Module.t -> string -> int -> int -> t
|
|
4
|
+
= "caml_binaryen_add_table"
|
|
5
|
+
(** Module, name, initial size, maximum size. *)
|
|
6
|
+
|
|
7
|
+
external add_active_element_segment :
|
|
8
|
+
Module.t ->
|
|
9
|
+
string ->
|
|
10
|
+
string ->
|
|
11
|
+
string list ->
|
|
12
|
+
Expression.t ->
|
|
13
|
+
Element_segment.t = "caml_binaryen_add_active_element_segment"
|
|
14
|
+
(** Module, table, name, function names, offset. *)
|
|
15
|
+
|
|
16
|
+
external remove_element_segment : Module.t -> string -> unit
|
|
17
|
+
= "caml_binaryen_remove_element_segment"
|
|
18
|
+
|
|
19
|
+
external get_num_element_segments : Module.t -> int
|
|
20
|
+
= "caml_binaryen_get_num_element_segments"
|
|
21
|
+
|
|
22
|
+
external get_element_segment : Module.t -> string -> Element_segment.t
|
|
23
|
+
= "caml_binaryen_get_element_segment"
|
|
24
|
+
|
|
25
|
+
external get_element_segment_by_index : Module.t -> int -> Element_segment.t
|
|
26
|
+
= "caml_binaryen_get_element_segment_by_index"
|
binaryen-archive/src/type.ml
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
module C = Configurator.V1
|
|
2
|
+
|
|
3
|
+
let () =
|
|
4
|
+
C.main ~name:"ocamlopt_flags" (fun c ->
|
|
5
|
+
let default = [] in
|
|
6
|
+
|
|
7
|
+
let ocamlopt_flags =
|
|
8
|
+
match C.ocaml_config_var c "system" with
|
|
9
|
+
| Some "macosx" ->
|
|
10
|
+
(* These flags preserve the original C++ error behavior. Ref https://github.com/ocaml/ocaml/issues/10423 *)
|
|
11
|
+
[ "-cc"; "clang++" ]
|
|
12
|
+
| Some _ -> default
|
|
13
|
+
| None -> default
|
|
14
|
+
in
|
|
15
|
+
|
|
16
|
+
C.Flags.write_sexp "ocamlopt_flags.sexp" ocamlopt_flags)
|
binaryen-archive/test/dune
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
(name test)
|
|
5
5
|
(modules test)
|
|
6
6
|
(libraries binaryen)
|
|
7
|
+
(ocamlopt_flags
|
|
8
|
+
(:include ./config/ocamlopt_flags.sexp))
|
|
7
9
|
(action
|
|
8
10
|
(run %{test})))
|
|
9
11
|
|
|
@@ -20,6 +22,8 @@
|
|
|
20
22
|
(name test_native)
|
|
21
23
|
(modules test_native)
|
|
22
24
|
(libraries binaryen binaryen.native)
|
|
25
|
+
(ocamlopt_flags
|
|
26
|
+
(:include ./config/ocamlopt_flags.sexp))
|
|
23
27
|
(action
|
|
24
28
|
(run %{test})))
|
|
25
29
|
|