Skip to content

Commit

Permalink
feat!: Update libbinaryen to 107 (#152)
Browse files Browse the repository at this point in the history
chore: Update SwizzleVec8x16 naming for v107
feat: Add support for extended_const feature
  • Loading branch information
phated committed May 11, 2022
1 parent 13008ff commit 260c2a1
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 11 deletions.
2 changes: 1 addition & 1 deletion binaryen.opam
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ depends: [
"dune" {>= "2.9.1" < "3.0.0"}
"dune-configurator" {>= "2.9.1" < "3.0.0"}
"js_of_ocaml-compiler" {>= "3.10.0" < "4.0.0"}
"libbinaryen" {>= "106.0.0" < "107.0.0"}
"libbinaryen" {>= "107.0.0" < "108.0.0"}
]
12 changes: 6 additions & 6 deletions esy.lock/index.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"license": "Apache-2.0",
"dependencies": {
"ocaml": ">= 4.12.0 < 4.14.0",
"@grain/libbinaryen": ">= 106.0.0 < 107.0.0",
"@grain/libbinaryen": ">= 107.0.0 < 108.0.0",
"@opam/dune": ">= 2.9.1 < 3.0.0",
"@opam/dune-configurator": ">= 2.9.1 < 3.0.0"
},
Expand Down
6 changes: 6 additions & 0 deletions src/binaryen_stubs_features.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ caml_binaryen_feature_relaxed_simd(value unit) {
CAMLreturn(Val_int(BinaryenFeatureRelaxedSIMD()));
}

CAMLprim value
caml_binaryen_feature_extended_const(value unit) {
CAMLparam1(unit);
CAMLreturn(Val_int(BinaryenFeatureExtendedConst()));
}

CAMLprim value
caml_binaryen_feature_all(value unit) {
CAMLparam1(unit);
Expand Down
6 changes: 6 additions & 0 deletions src/binaryen_stubs_features.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ function caml_binaryen_feature_relaxed_simd() {
return binaryen.Features.RelaxedSIMD;
}

//Provides: caml_binaryen_feature_extended_const
//Requires: binaryen
function caml_binaryen_feature_extended_const() {
return binaryen.Features.ExtendedConst;
}

//Provides: caml_binaryen_feature_all
//Requires: binaryen
function caml_binaryen_feature_all() {
Expand Down
4 changes: 2 additions & 2 deletions src/binaryen_stubs_ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -2167,7 +2167,7 @@ caml_binaryen_binaryen_narrow_u_vec_i32x4_to_vec_i16x8(value unit) {
CAMLprim value
caml_binaryen_binaryen_swizzle_vec8x16(value unit) {
CAMLparam1(unit);
BinaryenOp op = BinaryenSwizzleVec8x16();
BinaryenOp op = BinaryenSwizzleVecI8x16();
CAMLreturn(alloc_BinaryenOp(op));
}

Expand Down Expand Up @@ -2225,4 +2225,4 @@ caml_binaryen_binaryen_ref_as_i31(value unit) {
CAMLparam1(unit);
BinaryenOp op = BinaryenRefAsI31();
CAMLreturn(alloc_BinaryenOp(op));
}
}
2 changes: 1 addition & 1 deletion src/binaryen_stubs_ops.js
Original file line number Diff line number Diff line change
Expand Up @@ -1843,7 +1843,7 @@ function caml_binaryen_binaryen_narrow_u_vec_i32x4_to_vec_i16x8() {
//Provides: caml_binaryen_binaryen_swizzle_vec8x16
//Requires: binaryen
function caml_binaryen_binaryen_swizzle_vec8x16() {
return binaryen.Operations.SwizzleVec8x16;
return binaryen.Operations.SwizzleVecI8x16;
}

//Provides: caml_binaryen_binaryen_ref_is_null
Expand Down
4 changes: 4 additions & 0 deletions src/module.ml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ module Feature = struct

let relaxed_simd = relaxed_simd ()

external extended_const : unit -> t = "caml_binaryen_feature_extended_const"

let extended_const = extended_const ()

external all : unit -> t = "caml_binaryen_feature_all"

let all = all ()
Expand Down
1 change: 1 addition & 0 deletions src/module.mli
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ module Feature : sig
val memory64 : t
val typed_function_references : t
val relaxed_simd : t
val extended_const : t
val all : t
end

Expand Down
1 change: 1 addition & 0 deletions test/test.ml
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ let _ =
Module.Feature.memory64;
Module.Feature.typed_function_references;
Module.Feature.relaxed_simd;
Module.Feature.extended_const;
Module.Feature.all;
]

Expand Down

0 comments on commit 260c2a1

Please sign in to comment.