Skip to content

Commit 291da6b

Browse files
committed
OxCaml: arrays of unboxed numbers
1 parent e0e5df8 commit 291da6b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

compiler/lib/specialize_js.ml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,14 @@ let specialize_instr opt_count ~target info i =
188188
incr opt_count;
189189
Let (x, Prim (Extern "%direct_int_mod", [ y; z ]))
190190
| _ -> i)
191+
| Let (x, Prim (Extern "caml_make_unboxed_int32_vect_bytecode", [ y ])), _ ->
192+
Let (x, Prim (Extern "caml_make_vect", [ y; Pc (Int32 0l) ]))
193+
| Let (x, Prim (Extern "caml_make_unboxed_int64_vect_bytecode", [ y ])), _ ->
194+
Let (x, Prim (Extern "caml_make_vect", [ y; Pc (Int64 0L) ]))
195+
| Let (x, Prim (Extern "caml_make_unboxed_nativeint_vect_bytecode", [ y ])), _ ->
196+
Let (x, Prim (Extern "caml_make_vect", [ y; Pc (NativeInt 0l) ]))
197+
| Let (x, Prim (Extern "caml_make_unboxed_float32_vect_bytecode", [ y ])), _ ->
198+
Let (x, Prim (Extern "caml_make_vect", [ y; Pc (Float32 0L) ]))
191199
| _, _ -> i
192200

193201
let skip_event cont (Event _ :: l | l) = cont l

0 commit comments

Comments
 (0)