@grain/binaryen.ml 0.12.1 → 0.13.0

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.
Files changed (41) hide show
  1. binaryen-archive/CHANGELOG.md +14 -0
  2. binaryen-archive/README.md +24 -0
  3. binaryen-archive/binaryen.opam +2 -2
  4. binaryen-archive/esy.lock/index.json +6 -6
  5. binaryen-archive/js/binaryen.es5.js +363 -5
  6. binaryen-archive/js/dune +1 -1
  7. binaryen-archive/js/export.ml +0 -3
  8. binaryen-archive/js/expression.ml +161 -0
  9. binaryen-archive/js/literal.ml +0 -1
  10. binaryen-archive/js/module.ml +6 -9
  11. binaryen-archive/js/op.ml +0 -223
  12. binaryen-archive/js/prelude.js +2 -11
  13. binaryen-archive/js/type.ml +0 -9
  14. binaryen-archive/package.json +2 -2
  15. binaryen-archive/src/binaryen_stubs_expressions.c +250 -0
  16. binaryen-archive/src/binaryen_stubs_features.c +24 -0
  17. binaryen-archive/src/element_segment.ml +0 -1
  18. binaryen-archive/src/export.ml +0 -2
  19. binaryen-archive/src/expression.ml +94 -63
  20. binaryen-archive/src/function.ml +0 -6
  21. binaryen-archive/src/global.ml +0 -2
  22. binaryen-archive/src/literal.ml +0 -3
  23. binaryen-archive/src/module.ml +17 -9
  24. binaryen-archive/src/settings.ml +0 -6
  25. binaryen-archive/src/type.ml +0 -1
  26. binaryen-archive/test/config/ocamlopt_flags.ml +8 -1
  27. binaryen-archive/test/test.expected +8 -0
  28. binaryen-archive/test/test.ml +44 -22
  29. binaryen-archive/virtual/element_segment.mli +0 -4
  30. binaryen-archive/virtual/export.mli +0 -15
  31. binaryen-archive/virtual/expression.mli +93 -115
  32. binaryen-archive/virtual/function.mli +0 -12
  33. binaryen-archive/virtual/global.mli +0 -8
  34. binaryen-archive/virtual/import.mli +0 -4
  35. binaryen-archive/virtual/literal.mli +0 -5
  36. binaryen-archive/virtual/module.mli +4 -29
  37. binaryen-archive/virtual/op.mli +0 -315
  38. binaryen-archive/virtual/settings.mli +0 -17
  39. binaryen-archive/virtual/table.mli +0 -3
  40. binaryen-archive/virtual/type.mli +0 -11
  41. binaryen-archive/js/postlude.js +0 -2
binaryen-archive/js/op.ml CHANGED
@@ -3,53 +3,29 @@ open Js_of_ocaml.Js.Unsafe
3
3
  type t = int
4
4
 
5
5
  let clz_int32 : t = global ##. binaryen ##. Operations ##. ClzInt32
6
-
7
6
  let ctz_int32 : t = global ##. binaryen ##. Operations ##. CtzInt32
8
-
9
7
  let popcnt_int32 : t = global ##. binaryen ##. Operations ##. PopcntInt32
10
-
11
8
  let neg_float32 : t = global ##. binaryen ##. Operations ##. NegFloat32
12
-
13
9
  let abs_float32 : t = global ##. binaryen ##. Operations ##. AbsFloat32
14
-
15
10
  let ceil_float32 : t = global ##. binaryen ##. Operations ##. CeilFloat32
16
-
17
11
  let floor_float32 : t = global ##. binaryen ##. Operations ##. FloorFloat32
18
-
19
12
  let trunc_float32 : t = global ##. binaryen ##. Operations ##. TruncFloat32
20
-
21
13
  let nearest_float32 : t = global ##. binaryen ##. Operations ##. NearestFloat32
22
-
23
14
  let sqrt_float32 : t = global ##. binaryen ##. Operations ##. SqrtFloat32
24
-
25
15
  let eq_z_int32 : t = global ##. binaryen ##. Operations ##. EqZInt32
26
-
27
16
  let clz_int64 : t = global ##. binaryen ##. Operations ##. ClzInt64
28
-
29
17
  let ctz_int64 : t = global ##. binaryen ##. Operations ##. CtzInt64
30
-
31
18
  let popcnt_int64 : t = global ##. binaryen ##. Operations ##. PopcntInt64
32
-
33
19
  let neg_float64 : t = global ##. binaryen ##. Operations ##. NegFloat64
34
-
35
20
  let abs_float64 : t = global ##. binaryen ##. Operations ##. AbsFloat64
36
-
37
21
  let ceil_float64 : t = global ##. binaryen ##. Operations ##. CeilFloat64
38
-
39
22
  let floor_float64 : t = global ##. binaryen ##. Operations ##. FloorFloat64
40
-
41
23
  let trunc_float64 : t = global ##. binaryen ##. Operations ##. TruncFloat64
42
-
43
24
  let nearest_float64 : t = global ##. binaryen ##. Operations ##. NearestFloat64
44
-
45
25
  let sqrt_float64 : t = global ##. binaryen ##. Operations ##. SqrtFloat64
46
-
47
26
  let eq_z_int64 : t = global ##. binaryen ##. Operations ##. EqZInt64
48
-
49
27
  let extend_s_int32 : t = global ##. binaryen ##. Operations ##. ExtendSInt32
50
-
51
28
  let extend_u_int32 : t = global ##. binaryen ##. Operations ##. ExtendUInt32
52
-
53
29
  let wrap_int64 : t = global ##. binaryen ##. Operations ##. WrapInt64
54
30
 
55
31
  let trunc_s_float32_to_int32 : t =
@@ -107,7 +83,6 @@ let convert_u_int64_to_float64 : t =
107
83
  global ##. binaryen ##. Operations ##. ConvertUInt64ToFloat64
108
84
 
109
85
  let promote_float32 : t = global ##. binaryen ##. Operations ##. PromoteFloat32
110
-
111
86
  let demote_float64 : t = global ##. binaryen ##. Operations ##. DemoteFloat64
112
87
 
113
88
  let reinterpret_int32 : t =
@@ -117,179 +92,97 @@ let reinterpret_int64 : t =
117
92
  global ##. binaryen ##. Operations ##. ReinterpretInt64
118
93
 
119
94
  let extend_s8_int32 : t = global ##. binaryen ##. Operations ##. ExtendS8Int32
120
-
121
95
  let extend_s16_int32 : t = global ##. binaryen ##. Operations ##. ExtendS16Int32
122
-
123
96
  let extend_s8_int64 : t = global ##. binaryen ##. Operations ##. ExtendS8Int64
124
-
125
97
  let extend_s16_int64 : t = global ##. binaryen ##. Operations ##. ExtendS16Int64
126
-
127
98
  let extend_s32_int64 : t = global ##. binaryen ##. Operations ##. ExtendS32Int64
128
-
129
99
  let add_int32 : t = global ##. binaryen ##. Operations ##. AddInt32
130
-
131
100
  let sub_int32 : t = global ##. binaryen ##. Operations ##. SubInt32
132
-
133
101
  let mul_int32 : t = global ##. binaryen ##. Operations ##. MulInt32
134
-
135
102
  let div_s_int32 : t = global ##. binaryen ##. Operations ##. DivSInt32
136
-
137
103
  let div_u_int32 : t = global ##. binaryen ##. Operations ##. DivUInt32
138
-
139
104
  let rem_s_int32 : t = global ##. binaryen ##. Operations ##. RemSInt32
140
-
141
105
  let rem_u_int32 : t = global ##. binaryen ##. Operations ##. RemUInt32
142
-
143
106
  let and_int32 : t = global ##. binaryen ##. Operations ##. AndInt32
144
-
145
107
  let or_int32 : t = global ##. binaryen ##. Operations ##. OrInt32
146
-
147
108
  let xor_int32 : t = global ##. binaryen ##. Operations ##. XorInt32
148
-
149
109
  let shl_int32 : t = global ##. binaryen ##. Operations ##. ShlInt32
150
-
151
110
  let shr_u_int32 : t = global ##. binaryen ##. Operations ##. ShrUInt32
152
-
153
111
  let shr_s_int32 : t = global ##. binaryen ##. Operations ##. ShrSInt32
154
-
155
112
  let rot_l_int32 : t = global ##. binaryen ##. Operations ##. RotLInt32
156
-
157
113
  let rot_r_int32 : t = global ##. binaryen ##. Operations ##. RotRInt32
158
-
159
114
  let eq_int32 : t = global ##. binaryen ##. Operations ##. EqInt32
160
-
161
115
  let ne_int32 : t = global ##. binaryen ##. Operations ##. NeInt32
162
-
163
116
  let lt_s_int32 : t = global ##. binaryen ##. Operations ##. LtSInt32
164
-
165
117
  let lt_u_int32 : t = global ##. binaryen ##. Operations ##. LtUInt32
166
-
167
118
  let le_s_int32 : t = global ##. binaryen ##. Operations ##. LeSInt32
168
-
169
119
  let le_u_int32 : t = global ##. binaryen ##. Operations ##. LeUInt32
170
-
171
120
  let gt_s_int32 : t = global ##. binaryen ##. Operations ##. GtSInt32
172
-
173
121
  let gt_u_int32 : t = global ##. binaryen ##. Operations ##. GtUInt32
174
-
175
122
  let ge_s_int32 : t = global ##. binaryen ##. Operations ##. GeSInt32
176
-
177
123
  let ge_u_int32 : t = global ##. binaryen ##. Operations ##. GeUInt32
178
-
179
124
  let add_int64 : t = global ##. binaryen ##. Operations ##. AddInt64
180
-
181
125
  let sub_int64 : t = global ##. binaryen ##. Operations ##. SubInt64
182
-
183
126
  let mul_int64 : t = global ##. binaryen ##. Operations ##. MulInt64
184
-
185
127
  let div_s_int64 : t = global ##. binaryen ##. Operations ##. DivSInt64
186
-
187
128
  let div_u_int64 : t = global ##. binaryen ##. Operations ##. DivUInt64
188
-
189
129
  let rem_s_int64 : t = global ##. binaryen ##. Operations ##. RemSInt64
190
-
191
130
  let rem_u_int64 : t = global ##. binaryen ##. Operations ##. RemUInt64
192
-
193
131
  let and_int64 : t = global ##. binaryen ##. Operations ##. AndInt64
194
-
195
132
  let or_int64 : t = global ##. binaryen ##. Operations ##. OrInt64
196
-
197
133
  let xor_int64 : t = global ##. binaryen ##. Operations ##. XorInt64
198
-
199
134
  let shl_int64 : t = global ##. binaryen ##. Operations ##. ShlInt64
200
-
201
135
  let shr_u_int64 : t = global ##. binaryen ##. Operations ##. ShrUInt64
202
-
203
136
  let shr_s_int64 : t = global ##. binaryen ##. Operations ##. ShrSInt64
204
-
205
137
  let rot_l_int64 : t = global ##. binaryen ##. Operations ##. RotLInt64
206
-
207
138
  let rot_r_int64 : t = global ##. binaryen ##. Operations ##. RotRInt64
208
-
209
139
  let eq_int64 : t = global ##. binaryen ##. Operations ##. EqInt64
210
-
211
140
  let ne_int64 : t = global ##. binaryen ##. Operations ##. NeInt64
212
-
213
141
  let lt_s_int64 : t = global ##. binaryen ##. Operations ##. LtSInt64
214
-
215
142
  let lt_u_int64 : t = global ##. binaryen ##. Operations ##. LtUInt64
216
-
217
143
  let le_s_int64 : t = global ##. binaryen ##. Operations ##. LeSInt64
218
-
219
144
  let le_u_int64 : t = global ##. binaryen ##. Operations ##. LeUInt64
220
-
221
145
  let gt_s_int64 : t = global ##. binaryen ##. Operations ##. GtSInt64
222
-
223
146
  let gt_u_int64 : t = global ##. binaryen ##. Operations ##. GtUInt64
224
-
225
147
  let ge_s_int64 : t = global ##. binaryen ##. Operations ##. GeSInt64
226
-
227
148
  let ge_u_int64 : t = global ##. binaryen ##. Operations ##. GeUInt64
228
-
229
149
  let add_float32 : t = global ##. binaryen ##. Operations ##. AddFloat32
230
-
231
150
  let sub_float32 : t = global ##. binaryen ##. Operations ##. SubFloat32
232
-
233
151
  let mul_float32 : t = global ##. binaryen ##. Operations ##. MulFloat32
234
-
235
152
  let div_float32 : t = global ##. binaryen ##. Operations ##. DivFloat32
236
153
 
237
154
  let copy_sign_float32 : t =
238
155
  global ##. binaryen ##. Operations ##. CopySignFloat32
239
156
 
240
157
  let min_float32 : t = global ##. binaryen ##. Operations ##. MinFloat32
241
-
242
158
  let max_float32 : t = global ##. binaryen ##. Operations ##. MaxFloat32
243
-
244
159
  let eq_float32 : t = global ##. binaryen ##. Operations ##. EqFloat32
245
-
246
160
  let ne_float32 : t = global ##. binaryen ##. Operations ##. NeFloat32
247
-
248
161
  let lt_float32 : t = global ##. binaryen ##. Operations ##. LtFloat32
249
-
250
162
  let le_float32 : t = global ##. binaryen ##. Operations ##. LeFloat32
251
-
252
163
  let gt_float32 : t = global ##. binaryen ##. Operations ##. GtFloat32
253
-
254
164
  let ge_float32 : t = global ##. binaryen ##. Operations ##. GeFloat32
255
-
256
165
  let add_float64 : t = global ##. binaryen ##. Operations ##. AddFloat64
257
-
258
166
  let sub_float64 : t = global ##. binaryen ##. Operations ##. SubFloat64
259
-
260
167
  let mul_float64 : t = global ##. binaryen ##. Operations ##. MulFloat64
261
-
262
168
  let div_float64 : t = global ##. binaryen ##. Operations ##. DivFloat64
263
169
 
264
170
  let copy_sign_float64 : t =
265
171
  global ##. binaryen ##. Operations ##. CopySignFloat64
266
172
 
267
173
  let min_float64 : t = global ##. binaryen ##. Operations ##. MinFloat64
268
-
269
174
  let max_float64 : t = global ##. binaryen ##. Operations ##. MaxFloat64
270
-
271
175
  let eq_float64 : t = global ##. binaryen ##. Operations ##. EqFloat64
272
-
273
176
  let ne_float64 : t = global ##. binaryen ##. Operations ##. NeFloat64
274
-
275
177
  let lt_float64 : t = global ##. binaryen ##. Operations ##. LtFloat64
276
-
277
178
  let le_float64 : t = global ##. binaryen ##. Operations ##. LeFloat64
278
-
279
179
  let gt_float64 : t = global ##. binaryen ##. Operations ##. GtFloat64
280
-
281
180
  let ge_float64 : t = global ##. binaryen ##. Operations ##. GeFloat64
282
-
283
181
  let atomic_rmw_add : t = global ##. binaryen ##. Operations ##. AtomicRMWAdd
284
-
285
182
  let atomic_rmw_sub : t = global ##. binaryen ##. Operations ##. AtomicRMWSub
286
-
287
183
  let atomic_rmw_and : t = global ##. binaryen ##. Operations ##. AtomicRMWAnd
288
-
289
184
  let atomic_rmw_or : t = global ##. binaryen ##. Operations ##. AtomicRMWOr
290
-
291
185
  let atomic_rmw_xor : t = global ##. binaryen ##. Operations ##. AtomicRMWXor
292
-
293
186
  let atomic_rmw_xchg : t = global ##. binaryen ##. Operations ##. AtomicRMWXchg
294
187
 
295
188
  let trunc_sat_s_float32_to_int32 : t =
@@ -371,104 +264,57 @@ let replace_lane_vec_f64x2 : t =
371
264
  global ##. binaryen ##. Operations ##. ReplaceLaneVecF64x2
372
265
 
373
266
  let eq_vec_i8x16 : t = global ##. binaryen ##. Operations ##. EqVecI8x16
374
-
375
267
  let ne_vec_i8x16 : t = global ##. binaryen ##. Operations ##. NeVecI8x16
376
-
377
268
  let lt_s_vec_i8x16 : t = global ##. binaryen ##. Operations ##. LtSVecI8x16
378
-
379
269
  let lt_u_vec_i8x16 : t = global ##. binaryen ##. Operations ##. LtUVecI8x16
380
-
381
270
  let gt_s_vec_i8x16 : t = global ##. binaryen ##. Operations ##. GtSVecI8x16
382
-
383
271
  let gt_u_vec_i8x16 : t = global ##. binaryen ##. Operations ##. GtUVecI8x16
384
-
385
272
  let le_s_vec_i8x16 : t = global ##. binaryen ##. Operations ##. LeSVecI8x16
386
-
387
273
  let le_u_vec_i8x16 : t = global ##. binaryen ##. Operations ##. LeUVecI8x16
388
-
389
274
  let ge_s_vec_i8x16 : t = global ##. binaryen ##. Operations ##. GeSVecI8x16
390
-
391
275
  let ge_u_vec_i8x16 : t = global ##. binaryen ##. Operations ##. GeUVecI8x16
392
-
393
276
  let eq_vec_i16x8 : t = global ##. binaryen ##. Operations ##. EqVecI16x8
394
-
395
277
  let ne_vec_i16x8 : t = global ##. binaryen ##. Operations ##. NeVecI16x8
396
-
397
278
  let lt_s_vec_i16x8 : t = global ##. binaryen ##. Operations ##. LtSVecI16x8
398
-
399
279
  let lt_u_vec_i16x8 : t = global ##. binaryen ##. Operations ##. LtUVecI16x8
400
-
401
280
  let gt_s_vec_i16x8 : t = global ##. binaryen ##. Operations ##. GtSVecI16x8
402
-
403
281
  let gt_u_vec_i16x8 : t = global ##. binaryen ##. Operations ##. GtUVecI16x8
404
-
405
282
  let le_s_vec_i16x8 : t = global ##. binaryen ##. Operations ##. LeSVecI16x8
406
-
407
283
  let le_u_vec_i16x8 : t = global ##. binaryen ##. Operations ##. LeUVecI16x8
408
-
409
284
  let ge_s_vec_i16x8 : t = global ##. binaryen ##. Operations ##. GeSVecI16x8
410
-
411
285
  let ge_u_vec_i16x8 : t = global ##. binaryen ##. Operations ##. GeUVecI16x8
412
-
413
286
  let eq_vec_i32x4 : t = global ##. binaryen ##. Operations ##. EqVecI32x4
414
-
415
287
  let ne_vec_i32x4 : t = global ##. binaryen ##. Operations ##. NeVecI32x4
416
-
417
288
  let lt_s_vec_i32x4 : t = global ##. binaryen ##. Operations ##. LtSVecI32x4
418
-
419
289
  let lt_u_vec_i32x4 : t = global ##. binaryen ##. Operations ##. LtUVecI32x4
420
-
421
290
  let gt_s_vec_i32x4 : t = global ##. binaryen ##. Operations ##. GtSVecI32x4
422
-
423
291
  let gt_u_vec_i32x4 : t = global ##. binaryen ##. Operations ##. GtUVecI32x4
424
-
425
292
  let le_s_vec_i32x4 : t = global ##. binaryen ##. Operations ##. LeSVecI32x4
426
-
427
293
  let le_u_vec_i32x4 : t = global ##. binaryen ##. Operations ##. LeUVecI32x4
428
-
429
294
  let ge_s_vec_i32x4 : t = global ##. binaryen ##. Operations ##. GeSVecI32x4
430
-
431
295
  let ge_u_vec_i32x4 : t = global ##. binaryen ##. Operations ##. GeUVecI32x4
432
-
433
296
  let eq_vec_f32x4 : t = global ##. binaryen ##. Operations ##. EqVecF32x4
434
-
435
297
  let ne_vec_f32x4 : t = global ##. binaryen ##. Operations ##. NeVecF32x4
436
-
437
298
  let lt_vec_f32x4 : t = global ##. binaryen ##. Operations ##. LtVecF32x4
438
-
439
299
  let gt_vec_f32x4 : t = global ##. binaryen ##. Operations ##. GtVecF32x4
440
-
441
300
  let le_vec_f32x4 : t = global ##. binaryen ##. Operations ##. LeVecF32x4
442
-
443
301
  let ge_vec_f32x4 : t = global ##. binaryen ##. Operations ##. GeVecF32x4
444
-
445
302
  let eq_vec_f64x2 : t = global ##. binaryen ##. Operations ##. EqVecF64x2
446
-
447
303
  let ne_vec_f64x2 : t = global ##. binaryen ##. Operations ##. NeVecF64x2
448
-
449
304
  let lt_vec_f64x2 : t = global ##. binaryen ##. Operations ##. LtVecF64x2
450
-
451
305
  let gt_vec_f64x2 : t = global ##. binaryen ##. Operations ##. GtVecF64x2
452
-
453
306
  let le_vec_f64x2 : t = global ##. binaryen ##. Operations ##. LeVecF64x2
454
-
455
307
  let ge_vec_f64x2 : t = global ##. binaryen ##. Operations ##. GeVecF64x2
456
-
457
308
  let not_vec128 : t = global ##. binaryen ##. Operations ##. NotVec128
458
-
459
309
  let and_vec128 : t = global ##. binaryen ##. Operations ##. AndVec128
460
-
461
310
  let or_vec128 : t = global ##. binaryen ##. Operations ##. OrVec128
462
-
463
311
  let xor_vec128 : t = global ##. binaryen ##. Operations ##. XorVec128
464
-
465
312
  let and_not_vec128 : t = global ##. binaryen ##. Operations ##. AndNotVec128
466
313
 
467
314
  let bitselect_vec128 : t =
468
315
  global ##. binaryen ##. Operations ##. BitselectVec128
469
316
 
470
317
  let abs_vec_i8x16 : t = global ##. binaryen ##. Operations ##. AbsVecI8x16
471
-
472
318
  let neg_vec_i8x16 : t = global ##. binaryen ##. Operations ##. NegVecI8x16
473
319
 
474
320
  let all_true_vec_i8x16 : t =
@@ -478,11 +324,8 @@ let bitmask_vec_i8x16 : t =
478
324
  global ##. binaryen ##. Operations ##. BitmaskVecI8x16
479
325
 
480
326
  let shl_vec_i8x16 : t = global ##. binaryen ##. Operations ##. ShlVecI8x16
481
-
482
327
  let shr_s_vec_i8x16 : t = global ##. binaryen ##. Operations ##. ShrSVecI8x16
483
-
484
328
  let shr_u_vec_i8x16 : t = global ##. binaryen ##. Operations ##. ShrUVecI8x16
485
-
486
329
  let add_vec_i8x16 : t = global ##. binaryen ##. Operations ##. AddVecI8x16
487
330
 
488
331
  let add_sat_s_vec_i8x16 : t =
@@ -500,17 +343,11 @@ let sub_sat_u_vec_i8x16 : t =
500
343
  global ##. binaryen ##. Operations ##. SubSatUVecI8x16
501
344
 
502
345
  let min_s_vec_i8x16 : t = global ##. binaryen ##. Operations ##. MinSVecI8x16
503
-
504
346
  let min_u_vec_i8x16 : t = global ##. binaryen ##. Operations ##. MinUVecI8x16
505
-
506
347
  let max_s_vec_i8x16 : t = global ##. binaryen ##. Operations ##. MaxSVecI8x16
507
-
508
348
  let max_u_vec_i8x16 : t = global ##. binaryen ##. Operations ##. MaxUVecI8x16
509
-
510
349
  let avgr_u_vec_i8x16 : t = global ##. binaryen ##. Operations ##. AvgrUVecI8x16
511
-
512
350
  let abs_vec_i16x8 : t = global ##. binaryen ##. Operations ##. AbsVecI16x8
513
-
514
351
  let neg_vec_i16x8 : t = global ##. binaryen ##. Operations ##. NegVecI16x8
515
352
 
516
353
  let all_true_vec_i16x8 : t =
@@ -520,11 +357,8 @@ let bitmask_vec_i16x8 : t =
520
357
  global ##. binaryen ##. Operations ##. BitmaskVecI16x8
521
358
 
522
359
  let shl_vec_i16x8 : t = global ##. binaryen ##. Operations ##. ShlVecI16x8
523
-
524
360
  let shr_s_vec_i16x8 : t = global ##. binaryen ##. Operations ##. ShrSVecI16x8
525
-
526
361
  let shr_u_vec_i16x8 : t = global ##. binaryen ##. Operations ##. ShrUVecI16x8
527
-
528
362
  let add_vec_i16x8 : t = global ##. binaryen ##. Operations ##. AddVecI16x8
529
363
 
530
364
  let add_sat_s_vec_i16x8 : t =
@@ -542,19 +376,12 @@ let sub_sat_u_vec_i16x8 : t =
542
376
  global ##. binaryen ##. Operations ##. SubSatUVecI16x8
543
377
 
544
378
  let mul_vec_i16x8 : t = global ##. binaryen ##. Operations ##. MulVecI16x8
545
-
546
379
  let min_s_vec_i16x8 : t = global ##. binaryen ##. Operations ##. MinSVecI16x8
547
-
548
380
  let min_u_vec_i16x8 : t = global ##. binaryen ##. Operations ##. MinUVecI16x8
549
-
550
381
  let max_s_vec_i16x8 : t = global ##. binaryen ##. Operations ##. MaxSVecI16x8
551
-
552
382
  let max_u_vec_i16x8 : t = global ##. binaryen ##. Operations ##. MaxUVecI16x8
553
-
554
383
  let avgr_u_vec_i16x8 : t = global ##. binaryen ##. Operations ##. AvgrUVecI16x8
555
-
556
384
  let abs_vec_i32x4 : t = global ##. binaryen ##. Operations ##. AbsVecI32x4
557
-
558
385
  let neg_vec_i32x4 : t = global ##. binaryen ##. Operations ##. NegVecI32x4
559
386
 
560
387
  let all_true_vec_i32x4 : t =
@@ -564,99 +391,57 @@ let bitmask_vec_i32x4 : t =
564
391
  global ##. binaryen ##. Operations ##. BitmaskVecI32x4
565
392
 
566
393
  let shl_vec_i32x4 : t = global ##. binaryen ##. Operations ##. ShlVecI32x4
567
-
568
394
  let shr_s_vec_i32x4 : t = global ##. binaryen ##. Operations ##. ShrSVecI32x4
569
-
570
395
  let shr_u_vec_i32x4 : t = global ##. binaryen ##. Operations ##. ShrUVecI32x4
571
-
572
396
  let add_vec_i32x4 : t = global ##. binaryen ##. Operations ##. AddVecI32x4
573
-
574
397
  let sub_vec_i32x4 : t = global ##. binaryen ##. Operations ##. SubVecI32x4
575
-
576
398
  let mul_vec_i32x4 : t = global ##. binaryen ##. Operations ##. MulVecI32x4
577
-
578
399
  let min_s_vec_i32x4 : t = global ##. binaryen ##. Operations ##. MinSVecI32x4
579
-
580
400
  let min_u_vec_i32x4 : t = global ##. binaryen ##. Operations ##. MinUVecI32x4
581
-
582
401
  let max_s_vec_i32x4 : t = global ##. binaryen ##. Operations ##. MaxSVecI32x4
583
-
584
402
  let max_u_vec_i32x4 : t = global ##. binaryen ##. Operations ##. MaxUVecI32x4
585
403
 
586
404
  let dot_s_vec_i16x8_to_vec_i32x4 : t =
587
405
  global ##. binaryen ##. Operations ##. DotSVecI16x8ToVecI32x4
588
406
 
589
407
  let neg_vec_i64x2 : t = global ##. binaryen ##. Operations ##. NegVecI64x2
590
-
591
408
  let shl_vec_i64x2 : t = global ##. binaryen ##. Operations ##. ShlVecI64x2
592
-
593
409
  let shr_s_vec_i64x2 : t = global ##. binaryen ##. Operations ##. ShrSVecI64x2
594
-
595
410
  let shr_u_vec_i64x2 : t = global ##. binaryen ##. Operations ##. ShrUVecI64x2
596
-
597
411
  let add_vec_i64x2 : t = global ##. binaryen ##. Operations ##. AddVecI64x2
598
-
599
412
  let sub_vec_i64x2 : t = global ##. binaryen ##. Operations ##. SubVecI64x2
600
-
601
413
  let mul_vec_i64x2 : t = global ##. binaryen ##. Operations ##. MulVecI64x2
602
-
603
414
  let abs_vec_f32x4 : t = global ##. binaryen ##. Operations ##. AbsVecF32x4
604
-
605
415
  let neg_vec_f32x4 : t = global ##. binaryen ##. Operations ##. NegVecF32x4
606
-
607
416
  let sqrt_vec_f32x4 : t = global ##. binaryen ##. Operations ##. SqrtVecF32x4
608
-
609
417
  let add_vec_f32x4 : t = global ##. binaryen ##. Operations ##. AddVecF32x4
610
-
611
418
  let sub_vec_f32x4 : t = global ##. binaryen ##. Operations ##. SubVecF32x4
612
-
613
419
  let mul_vec_f32x4 : t = global ##. binaryen ##. Operations ##. MulVecF32x4
614
-
615
420
  let div_vec_f32x4 : t = global ##. binaryen ##. Operations ##. DivVecF32x4
616
-
617
421
  let min_vec_f32x4 : t = global ##. binaryen ##. Operations ##. MinVecF32x4
618
-
619
422
  let max_vec_f32x4 : t = global ##. binaryen ##. Operations ##. MaxVecF32x4
620
-
621
423
  let p_min_vec_f32x4 : t = global ##. binaryen ##. Operations ##. PMinVecF32x4
622
-
623
424
  let p_max_vec_f32x4 : t = global ##. binaryen ##. Operations ##. PMaxVecF32x4
624
-
625
425
  let ceil_vec_f32x4 : t = global ##. binaryen ##. Operations ##. CeilVecF32x4
626
-
627
426
  let floor_vec_f32x4 : t = global ##. binaryen ##. Operations ##. FloorVecF32x4
628
-
629
427
  let trunc_vec_f32x4 : t = global ##. binaryen ##. Operations ##. TruncVecF32x4
630
428
 
631
429
  let nearest_vec_f32x4 : t =
632
430
  global ##. binaryen ##. Operations ##. NearestVecF32x4
633
431
 
634
432
  let abs_vec_f64x2 : t = global ##. binaryen ##. Operations ##. AbsVecF64x2
635
-
636
433
  let neg_vec_f64x2 : t = global ##. binaryen ##. Operations ##. NegVecF64x2
637
-
638
434
  let sqrt_vec_f64x2 : t = global ##. binaryen ##. Operations ##. SqrtVecF64x2
639
-
640
435
  let add_vec_f64x2 : t = global ##. binaryen ##. Operations ##. AddVecF64x2
641
-
642
436
  let sub_vec_f64x2 : t = global ##. binaryen ##. Operations ##. SubVecF64x2
643
-
644
437
  let mul_vec_f64x2 : t = global ##. binaryen ##. Operations ##. MulVecF64x2
645
-
646
438
  let div_vec_f64x2 : t = global ##. binaryen ##. Operations ##. DivVecF64x2
647
-
648
439
  let min_vec_f64x2 : t = global ##. binaryen ##. Operations ##. MinVecF64x2
649
-
650
440
  let max_vec_f64x2 : t = global ##. binaryen ##. Operations ##. MaxVecF64x2
651
-
652
441
  let p_min_vec_f64x2 : t = global ##. binaryen ##. Operations ##. PMinVecF64x2
653
-
654
442
  let p_max_vec_f64x2 : t = global ##. binaryen ##. Operations ##. PMaxVecF64x2
655
-
656
443
  let ceil_vec_f64x2 : t = global ##. binaryen ##. Operations ##. CeilVecF64x2
657
-
658
444
  let floor_vec_f64x2 : t = global ##. binaryen ##. Operations ##. FloorVecF64x2
659
-
660
445
  let trunc_vec_f64x2 : t = global ##. binaryen ##. Operations ##. TruncVecF64x2
661
446
 
662
447
  let nearest_vec_f64x2 : t =
@@ -687,19 +472,11 @@ let narrow_u_vec_i32x4_to_vec_i16x8 : t =
687
472
  global ##. binaryen ##. Operations ##. NarrowUVecI32x4ToVecI16x8
688
473
 
689
474
  let swizzle_vec8x16 : t = global ##. binaryen ##. Operations ##. SwizzleVec8x16
690
-
691
475
  let ref_is_null : t = global ##. binaryen ##. Operations ##. RefIsNull
692
-
693
476
  let ref_is_func : t = global ##. binaryen ##. Operations ##. RefIsFunc
694
-
695
477
  let ref_is_data : t = global ##. binaryen ##. Operations ##. RefIsData
696
-
697
478
  let ref_is_i31 : t = global ##. binaryen ##. Operations ##. RefIsI31
698
-
699
479
  let ref_as_non_null : t = global ##. binaryen ##. Operations ##. RefAsNonNull
700
-
701
480
  let ref_as_func : t = global ##. binaryen ##. Operations ##. RefAsFunc
702
-
703
481
  let ref_as_data : t = global ##. binaryen ##. Operations ##. RefAsData
704
-
705
482
  let ref_as_i31 : t = global ##. binaryen ##. Operations ##. RefAsI31
@@ -1,11 +1,2 @@
1
- if (typeof module === 'undefined') {
2
- module = {};
3
- }
4
-
5
- if (typeof exports === 'undefined') {
6
- exports = {};
7
- }
8
-
9
- if (typeof module.exports === 'undefined') {
10
- module.exports = exports;
11
- }
1
+ // Attach binaryen to globalThis so binaryen will register itself on the object
2
+ globalThis.binaryen = {}
@@ -4,23 +4,14 @@ open Js_of_ocaml.Js.Unsafe
4
4
  type t = int
5
5
 
6
6
  let none : t = global##.binaryen##.none
7
-
8
7
  let int32 : t = global##.binaryen##.i32
9
-
10
8
  let int64 : t = global##.binaryen##.i64
11
-
12
9
  let float32 : t = global##.binaryen##.f32
13
-
14
10
  let float64 : t = global##.binaryen##.f64
15
-
16
11
  let vec128 : t = global##.binaryen##.v128
17
-
18
12
  let funcref : t = global##.binaryen##.funcref
19
-
20
13
  let externref : t = global##.binaryen##.externref
21
-
22
14
  let unreachable : t = global##.binaryen##.unreachable
23
-
24
15
  let auto : t = global##.binaryen##.auto
25
16
 
26
17
  let create typs =
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@grain/binaryen.ml",
3
- "version": "0.12.1",
3
+ "version": "0.13.0",
4
4
  "description": "OCaml bindings for Binaryen.",
5
5
  "author": "Oscar Spencer <oscar@grain-lang.org>",
6
6
  "license": "Apache-2.0",
7
7
  "dependencies": {
8
8
  "ocaml": ">= 4.12.0",
9
- "@grain/libbinaryen": "^102.0.4",
9
+ "@grain/libbinaryen": "^103.0.1",
10
10
  "@opam/dune": "^2.9.1",
11
11
  "@opam/dune-configurator": "^2.9.1",
12
12
  "@opam/js_of_ocaml": ">= 3.10.0 < 4.0.0",