@@ -260,12 +260,14 @@ and value_kind =
260
260
non_consts : (int * value_kind list ) list ;
261
261
}
262
262
| Parrayval of array_kind
263
+ | Pboxedvectorval of boxed_vector
263
264
264
265
and layout =
265
266
| Ptop
266
267
| Pvalue of value_kind
267
268
| Punboxed_float
268
269
| Punboxed_int of boxed_integer
270
+ | Punboxed_vector of boxed_vector
269
271
| Pbottom
270
272
271
273
and block_shape =
@@ -289,6 +291,9 @@ and array_set_kind =
289
291
and boxed_integer = Primitive. boxed_integer =
290
292
Pnativeint | Pint32 | Pint64
291
293
294
+ and boxed_vector = Primitive. boxed_vector =
295
+ | Pvec128
296
+
292
297
and bigarray_kind =
293
298
Pbigarray_unknown
294
299
| Pbigarray_float32 | Pbigarray_float64
@@ -310,6 +315,8 @@ and raise_kind =
310
315
311
316
let equal_boxed_integer = Primitive. equal_boxed_integer
312
317
318
+ let equal_boxed_vector = Primitive. equal_boxed_vector
319
+
313
320
let equal_primitive =
314
321
(* Should be implemented like [equal_value_kind] of [equal_boxed_integer],
315
322
i.e. by matching over the various constructors but the type has more
@@ -321,6 +328,8 @@ let rec equal_value_kind x y =
321
328
| Pgenval , Pgenval -> true
322
329
| Pfloatval , Pfloatval -> true
323
330
| Pboxedintval bi1 , Pboxedintval bi2 -> equal_boxed_integer bi1 bi2
331
+ | Pboxedvectorval bi1 , Pboxedvectorval bi2 ->
332
+ equal_boxed_vector bi1 bi2
324
333
| Pintval , Pintval -> true
325
334
| Parrayval elt_kind1 , Parrayval elt_kind2 -> elt_kind1 = elt_kind2
326
335
| Pvariant { consts = consts1; non_consts = non_consts1; },
@@ -337,7 +346,7 @@ let rec equal_value_kind x y =
337
346
&& List. for_all2 equal_value_kind fields1 fields2)
338
347
non_consts1 non_consts2
339
348
| (Pgenval | Pfloatval | Pboxedintval _ | Pintval | Pvariant _
340
- | Parrayval _ ), _ -> false
349
+ | Parrayval _ | Pboxedvectorval _ ), _ -> false
341
350
342
351
let equal_layout x y =
343
352
match x, y with
@@ -354,9 +363,10 @@ let compatible_layout x y =
354
363
| Punboxed_float , Punboxed_float -> true
355
364
| Punboxed_int bi1 , Punboxed_int bi2 ->
356
365
equal_boxed_integer bi1 bi2
366
+ | Punboxed_vector bi1 , Punboxed_vector bi2 -> equal_boxed_vector bi1 bi2
357
367
| Ptop , Ptop -> true
358
368
| Ptop , _ | _ , Ptop -> false
359
- | (Pvalue _ | Punboxed_float | Punboxed_int _ ), _ -> false
369
+ | (Pvalue _ | Punboxed_float | Punboxed_int _ | Punboxed_vector _ ), _ -> false
360
370
361
371
let must_be_value layout =
362
372
match layout with
@@ -640,6 +650,8 @@ let layout_functor = Pvalue Pgenval
640
650
let layout_boxed_float = Pvalue Pfloatval
641
651
let layout_string = Pvalue Pgenval
642
652
let layout_boxedint bi = Pvalue (Pboxedintval bi)
653
+
654
+ let layout_boxed_vector vi = Pvalue (Pboxedvectorval vi)
643
655
let layout_lazy = Pvalue Pgenval
644
656
let layout_lazy_contents = Pvalue Pgenval
645
657
let layout_any_value = Pvalue Pgenval
@@ -1442,6 +1454,7 @@ let primitive_result_layout (p : primitive) =
1442
1454
| Pbox_float _ -> layout_boxed_float
1443
1455
| Punbox_float -> Punboxed_float
1444
1456
| Pccall { prim_native_repr_res = _ , Untagged_int ; _} -> layout_int
1457
+ | Pccall { prim_native_repr_res = _ , Unboxed_vector v ; _} -> layout_boxed_vector v
1445
1458
| Pccall { prim_native_repr_res = _ , Unboxed_float ; _} -> layout_boxed_float
1446
1459
| Pccall { prim_native_repr_res = _ , Same_as_ocaml_repr s ; _} ->
1447
1460
begin match s with
0 commit comments