Skip to content

Commit 6f29cba

Browse files
authored
Use float32 for float32x4 scalar casts (#2710)
1 parent c1749b6 commit 6f29cba

23 files changed

+418
-264
lines changed

backend/amd64/emit.mlp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,12 +1016,8 @@ let emit_static_cast (cast : Cmm.static_cast) i =
10161016
I.movq (arg i 0) (res i 0)
10171017
| Scalar_of_v128 Int32x4 -> I.movd (arg i 0) (res32 i 0)
10181018
| V128_of_scalar Int32x4 -> I.movd (arg32 i 0) (res i 0)
1019-
| V128_of_scalar Float32x4 ->
1020-
(* CR mslater: (SIMD) remove cvt once we have unboxed float32 *)
1021-
I.cvtsd2ss (arg i 0) (res i 0)
1022-
| Scalar_of_v128 Float32x4 ->
1023-
(* CR mslater: (SIMD) remove cvt once we have unboxed float32 *)
1024-
I.cvtss2sd (arg i 0) (res i 0)
1019+
| V128_of_scalar Float32x4 | Scalar_of_v128 Float32x4 ->
1020+
if distinct then I.movss (arg i 0) (res i 0)
10251021
| Scalar_of_v128 Int16x8 ->
10261022
(* [movw] and [movzx] cannot operate on vector registers.
10271023
We must zero extend as the result is an untagged positive int.

backend/amd64/regalloc_stack_operands.ml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,11 +179,9 @@ let basic (map : spilled_map) (instr : Cfg.basic Cfg.instruction) =
179179
| R_to_RM -> may_use_stack_operand_for_result map instr ~num_args:1
180180
| RM_to_R -> may_use_stack_operand_for_only_argument map instr ~has_result:true)
181181
| Op (Reinterpret_cast (Float_of_float32 | Float32_of_float | V128_of_v128))
182-
| Op (Static_cast (V128_of_scalar Float64x2 | Scalar_of_v128 Float64x2)) ->
183-
unary_operation_argument_or_result_on_stack map instr
182+
| Op (Static_cast (V128_of_scalar Float64x2 | Scalar_of_v128 Float64x2))
184183
| Op (Static_cast (V128_of_scalar Float32x4 | Scalar_of_v128 Float32x4)) ->
185-
(* CR mslater: (SIMD) replace once we have unboxed float32 *)
186-
may_use_stack_operand_for_only_argument map instr ~has_result:true
184+
unary_operation_argument_or_result_on_stack map instr
187185
| Op (Reinterpret_cast (Float_of_int64 | Float32_of_int32))
188186
| Op (Static_cast (V128_of_scalar (Int64x2 | Int32x4 | Int16x8 | Int8x16))) ->
189187
may_use_stack_operand_for_only_argument map instr ~has_result:true

backend/amd64/reload.ml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,16 +164,13 @@ method! reload_operation op arg res =
164164
(* Result must be in register, but argument can be on stack *)
165165
(arg, (if stackp res.(0) then [| self#makereg res.(0) |] else res))
166166
| Ireinterpret_cast (Float_of_float32 | Float32_of_float | V128_of_v128)
167-
| Istatic_cast (V128_of_scalar Float64x2 | Scalar_of_v128 Float64x2) ->
167+
| Istatic_cast (V128_of_scalar Float64x2 | Scalar_of_v128 Float64x2)
168+
| Istatic_cast (V128_of_scalar Float32x4 | Scalar_of_v128 Float32x4) ->
168169
(* These are just moves; either the argument or result may be on the stack. *)
169170
begin match stackp arg.(0), stackp res.(0) with
170171
| true, true -> ([| self#makereg arg.(0) |], res)
171172
| _ -> (arg, res)
172173
end
173-
| Istatic_cast (V128_of_scalar Float32x4 | Scalar_of_v128 Float32x4) ->
174-
(* These do additional logic requiring the result to be a register.
175-
CR mslater: (SIMD) replace once we have unboxed float32 *)
176-
(arg, [| self#makereg res.(0) |])
177174
| Ireinterpret_cast (Float_of_int64 | Float32_of_int32)
178175
| Istatic_cast (V128_of_scalar (Int64x2 | Int32x4 | Int16x8 | Int8x16)) ->
179176
(* Int -> Vec regs need the result to be a register. *)

backend/amd64/simd_proc.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ let register_behavior_sse41 = function
9999
| Blendv_8 | Blendv_32 | Blendv_64 -> R_RM_xmm0_to_fst
100100
| Extract_i64 _ | Extract_i32 _ -> R_to_RM
101101
| Extract_i8 _ | Extract_i16 _ ->
102-
(* CR mslater: (SIMD): replace once we have int8/int16/float32 *)
102+
(* CR mslater: (SIMD): replace once we have int8/int16 *)
103103
R_to_R
104104

105105
let register_behavior_sse42 = function

backend/cmm_builtins.ml

Lines changed: 36 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -195,30 +195,45 @@ let bigstring_atomic_add size (arg1, arg2, arg3) dbg =
195195
let bigstring_atomic_sub size (arg1, arg2, arg3) dbg =
196196
bigstring_atomic_add size (arg1, arg2, neg_int arg3 dbg) dbg
197197

198-
(* Assumes unboxed float64 *)
199-
let rec const_float_args n args name =
198+
let rec const_args_gen ~extract ~type_name n args name =
200199
match n, args with
201200
| 0, [] -> []
202-
| n, Cconst_float (f, _) :: args -> f :: const_float_args (n - 1) args name
203-
| _ -> bad_immediate "Did not find constant float arguments for %s" name
201+
| _, [] ->
202+
bad_immediate "Missing %d constant %s argument(s) for %s" n type_name name
203+
| n, arg :: args -> (
204+
match extract arg with
205+
| Some value ->
206+
value :: const_args_gen ~extract ~type_name (n - 1) args name
207+
| None ->
208+
bad_immediate "Did not find constant %s arguments for %s" type_name name)
209+
210+
(* Assumes unboxed float32 *)
211+
let const_float32_args =
212+
const_args_gen
213+
~extract:(function Cconst_float32 (f, _) -> Some f | _ -> None)
214+
~type_name:"float32"
215+
216+
(* Assumes unboxed float64 *)
217+
let const_float_args =
218+
const_args_gen
219+
~extract:(function Cconst_float (f, _) -> Some f | _ -> None)
220+
~type_name:"float"
204221

205222
(* Assumes untagged int or unboxed int32, always representable by int63 *)
206-
let rec const_int_args n args name =
207-
match n, args with
208-
| 0, [] -> []
209-
| n, Cconst_int (i, _) :: args -> i :: const_int_args (n - 1) args name
210-
| _ -> bad_immediate "Did not find constant int arguments for %s" name
223+
let const_int_args =
224+
const_args_gen
225+
~extract:(function Cconst_int (i, _) -> Some i | _ -> None)
226+
~type_name:"int"
211227

212228
(* Assumes unboxed int64: no tag, comes as Cconst_int when representable by
213229
int63, otherwise we get Cconst_natint *)
214-
let rec const_int64_args n args name =
215-
match n, args with
216-
| 0, [] -> []
217-
| n, Cconst_int (i, _) :: args ->
218-
Int64.of_int i :: const_int64_args (n - 1) args name
219-
| n, Cconst_natint (i, _) :: args ->
220-
Int64.of_nativeint i :: const_int64_args (n - 1) args name
221-
| _ -> bad_immediate "Did not find constant int64 arguments for %s" name
230+
let const_int64_args =
231+
const_args_gen
232+
~extract:(function
233+
| Cconst_int (i, _) -> Some (Int64.of_int i)
234+
| Cconst_natint (i, _) -> Some (Int64.of_nativeint i)
235+
| _ -> None)
236+
~type_name:"int64"
222237

223238
let int64_of_int8 i =
224239
(* CR mslater: (SIMD) replace once we have unboxed int8 *)
@@ -238,7 +253,6 @@ let int64_of_int32 i =
238253
Int64.of_int i |> Int64.logand 0xffffffffL
239254

240255
let int64_of_float32 f =
241-
(* CR mslater: (SIMD) replace once we have unboxed float32 *)
242256
Int32.bits_of_float f |> Int64.of_int32 |> Int64.logand 0xffffffffL
243257

244258
let pack_int32s i0 i1 = Int64.(logor (shift_left i1 32) i0)
@@ -272,12 +286,10 @@ let transl_vec128_builtin name args dbg _typ_res =
272286
| "caml_float64x2_low_to_float" ->
273287
let op = Cstatic_cast (Scalar_of_v128 Float64x2) in
274288
if_operation_supported op ~f:(fun () -> Cop (op, args, dbg))
275-
| "caml_float32x4_low_of_float" ->
276-
(* CR mslater: (SIMD) replace once we have unboxed float32 *)
289+
| "caml_float32x4_low_of_float32" ->
277290
let op = Cstatic_cast (V128_of_scalar Float32x4) in
278291
if_operation_supported op ~f:(fun () -> Cop (op, args, dbg))
279-
| "caml_float32x4_low_to_float" ->
280-
(* CR mslater: (SIMD) replace once we have unboxed float32 *)
292+
| "caml_float32x4_low_to_float32" ->
281293
let op = Cstatic_cast (Scalar_of_v128 Float32x4) in
282294
if_operation_supported op ~f:(fun () -> Cop (op, args, dbg))
283295
| "caml_int64x2_low_of_int64" ->
@@ -310,15 +322,13 @@ let transl_vec128_builtin name args dbg _typ_res =
310322
if_operation_supported op ~f:(fun () -> Cop (op, args, dbg))
311323
(* Constants *)
312324
| "caml_float32x4_const1" ->
313-
(* CR mslater: (SIMD) replace once we have unboxed float32 *)
314-
let f = const_float_args 1 args name |> List.hd in
325+
let f = const_float32_args 1 args name |> List.hd in
315326
let i = int64_of_float32 f in
316327
let i = pack_int32s i i in
317328
Some (Cconst_vec128 ({ low = i; high = i }, dbg))
318329
| "caml_float32x4_const4" ->
319-
(* CR mslater: (SIMD) replace once we have unboxed float32 *)
320330
let i0, i1, i2, i3 =
321-
match const_float_args 4 args name |> List.map int64_of_float32 with
331+
match const_float32_args 4 args name |> List.map int64_of_float32 with
322332
| [i0; i1; i2; i3] -> i0, i1, i2, i3
323333
| _ -> assert false
324334
in

backend/selectgen.ml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,8 @@ let oper_result_type = function
186186
| Cstatic_cast (Float32_of_float | Float_of_int Float32) -> typ_float32
187187
| Cstatic_cast (Int_of_float (Float64 | Float32)) -> typ_int
188188
| Cstatic_cast (V128_of_scalar _) -> typ_vec128
189-
| Cstatic_cast (Scalar_of_v128 (Float64x2 | Float32x4)) ->
190-
(* CR mslater: (SIMD) replace once we have unboxed float32 *)
191-
typ_float
189+
| Cstatic_cast (Scalar_of_v128 Float64x2) -> typ_float
190+
| Cstatic_cast (Scalar_of_v128 Float32x4) -> typ_float32
192191
| Cstatic_cast (Scalar_of_v128 (Int8x16 | Int16x8 | Int32x4 | Int64x2)) -> typ_int
193192
| Craise _ -> typ_void
194193
| Cprobe _ -> typ_void

middle_end/flambda2/from_lambda/closure_conversion.ml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -939,13 +939,14 @@ let close_primitive acc env ~let_bound_ids_with_kinds named
939939
| Pbigstring_set_32 _ | Pbigstring_set_f32 _ | Pbigstring_set_64 _
940940
| Pbigstring_set_128 _ | Pfloatarray_load_128 _ | Pfloat_array_load_128 _
941941
| Pint_array_load_128 _ | Punboxed_float_array_load_128 _
942-
| Punboxed_int32_array_load_128 _ | Punboxed_int64_array_load_128 _
943-
| Punboxed_nativeint_array_load_128 _ | Pfloatarray_set_128 _
944-
| Pfloat_array_set_128 _ | Pint_array_set_128 _
945-
| Punboxed_float_array_set_128 _ | Punboxed_int32_array_set_128 _
946-
| Punboxed_int64_array_set_128 _ | Punboxed_nativeint_array_set_128 _
947-
| Pctconst _ | Pbswap16 | Pbbswap _ | Pint_as_pointer _ | Popaque _
948-
| Pprobe_is_enabled _ | Pobj_dup | Pobj_magic _ | Punbox_float _
942+
| Punboxed_float32_array_load_128 _ | Punboxed_int32_array_load_128 _
943+
| Punboxed_int64_array_load_128 _ | Punboxed_nativeint_array_load_128 _
944+
| Pfloatarray_set_128 _ | Pfloat_array_set_128 _ | Pint_array_set_128 _
945+
| Punboxed_float_array_set_128 _ | Punboxed_float32_array_set_128 _
946+
| Punboxed_int32_array_set_128 _ | Punboxed_int64_array_set_128 _
947+
| Punboxed_nativeint_array_set_128 _ | Pctconst _ | Pbswap16 | Pbbswap _
948+
| Pint_as_pointer _ | Popaque _ | Pprobe_is_enabled _ | Pobj_dup
949+
| Pobj_magic _ | Punbox_float _
949950
| Pbox_float (_, _)
950951
| Punbox_int _ | Pbox_int _ | Pmake_unboxed_product _
951952
| Punboxed_product_field _ | Pget_header _ | Prunstack | Pperform

middle_end/flambda2/from_lambda/lambda_to_flambda.ml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -641,13 +641,15 @@ let primitive_can_raise (prim : Lambda.primitive) =
641641
| Pfloat_array_load_128 { unsafe = false; _ }
642642
| Pint_array_load_128 { unsafe = false; _ }
643643
| Punboxed_float_array_load_128 { unsafe = false; _ }
644+
| Punboxed_float32_array_load_128 { unsafe = false; _ }
644645
| Punboxed_int32_array_load_128 { unsafe = false; _ }
645646
| Punboxed_int64_array_load_128 { unsafe = false; _ }
646647
| Punboxed_nativeint_array_load_128 { unsafe = false; _ }
647648
| Pfloatarray_set_128 { unsafe = false; _ }
648649
| Pfloat_array_set_128 { unsafe = false; _ }
649650
| Pint_array_set_128 { unsafe = false; _ }
650651
| Punboxed_float_array_set_128 { unsafe = false; _ }
652+
| Punboxed_float32_array_set_128 { unsafe = false; _ }
651653
| Punboxed_int32_array_set_128 { unsafe = false; _ }
652654
| Punboxed_int64_array_set_128 { unsafe = false; _ }
653655
| Punboxed_nativeint_array_set_128 { unsafe = false; _ }
@@ -736,13 +738,15 @@ let primitive_can_raise (prim : Lambda.primitive) =
736738
| Pfloat_array_load_128 { unsafe = true; _ }
737739
| Pint_array_load_128 { unsafe = true; _ }
738740
| Punboxed_float_array_load_128 { unsafe = true; _ }
741+
| Punboxed_float32_array_load_128 { unsafe = true; _ }
739742
| Punboxed_int32_array_load_128 { unsafe = true; _ }
740743
| Punboxed_int64_array_load_128 { unsafe = true; _ }
741744
| Punboxed_nativeint_array_load_128 { unsafe = true; _ }
742745
| Pfloatarray_set_128 { unsafe = true; _ }
743746
| Pfloat_array_set_128 { unsafe = true; _ }
744747
| Pint_array_set_128 { unsafe = true; _ }
745748
| Punboxed_float_array_set_128 { unsafe = true; _ }
749+
| Punboxed_float32_array_set_128 { unsafe = true; _ }
746750
| Punboxed_int32_array_set_128 { unsafe = true; _ }
747751
| Punboxed_int64_array_set_128 { unsafe = true; _ }
748752
| Punboxed_nativeint_array_set_128 { unsafe = true; _ }

middle_end/flambda2/from_lambda/lambda_to_flambda_primitives.ml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1845,6 +1845,9 @@ let convert_lprim ~big_endian (prim : L.primitive) (args : Simple.t list list)
18451845
| Punboxed_float_array_load_128 { unsafe; mode }, [[array]; [index]] ->
18461846
[ array_like_load_128 ~dbg ~size_int ~current_region ~unsafe ~mode
18471847
Naked_floats array index ]
1848+
| Punboxed_float32_array_load_128 { unsafe; mode }, [[array]; [index]] ->
1849+
[ array_like_load_128 ~dbg ~size_int ~current_region ~unsafe ~mode
1850+
Naked_float32s array index ]
18481851
| Pint_array_load_128 { unsafe; mode }, [[array]; [index]] ->
18491852
if Targetint.size <> 64
18501853
then Misc.fatal_error "[Pint_array_load_128]: immediates must be 64 bits.";
@@ -1871,6 +1874,10 @@ let convert_lprim ~big_endian (prim : L.primitive) (args : Simple.t list list)
18711874
| Punboxed_float_array_set_128 { unsafe }, [[array]; [index]; [new_value]] ->
18721875
[ array_like_set_128 ~dbg ~size_int ~unsafe Naked_floats array index
18731876
new_value ]
1877+
| Punboxed_float32_array_set_128 { unsafe }, [[array]; [index]; [new_value]]
1878+
->
1879+
[ array_like_set_128 ~dbg ~size_int ~unsafe Naked_float32s array index
1880+
new_value ]
18741881
| Pint_array_set_128 { unsafe }, [[array]; [index]; [new_value]] ->
18751882
if Targetint.size <> 64
18761883
then Misc.fatal_error "[Pint_array_set_128]: immediates must be 64 bits.";
@@ -1985,8 +1992,9 @@ let convert_lprim ~big_endian (prim : L.primitive) (args : Simple.t list list)
19851992
| Pbigstring_load_16 _ | Pbigstring_load_32 _ | Pbigstring_load_f32 _
19861993
| Pbigstring_load_64 _ | Pbigstring_load_128 _ | Pfloatarray_load_128 _
19871994
| Pfloat_array_load_128 _ | Pint_array_load_128 _
1988-
| Punboxed_float_array_load_128 _ | Punboxed_int32_array_load_128 _
1989-
| Punboxed_int64_array_load_128 _ | Punboxed_nativeint_array_load_128 _
1995+
| Punboxed_float_array_load_128 _ | Punboxed_float32_array_load_128 _
1996+
| Punboxed_int32_array_load_128 _ | Punboxed_int64_array_load_128 _
1997+
| Punboxed_nativeint_array_load_128 _
19901998
| Parrayrefu
19911999
( ( Pgenarray_ref _ | Paddrarray_ref | Pintarray_ref
19922000
| Pfloatarray_ref _ | Punboxedfloatarray_ref _
@@ -2023,9 +2031,9 @@ let convert_lprim ~big_endian (prim : L.primitive) (args : Simple.t list list)
20232031
| Pbytes_set_128 _ | Pbigstring_set_16 _ | Pbigstring_set_32 _
20242032
| Pbigstring_set_f32 _ | Pbigstring_set_64 _ | Pbigstring_set_128 _
20252033
| Pfloatarray_set_128 _ | Pfloat_array_set_128 _ | Pint_array_set_128 _
2026-
| Punboxed_float_array_set_128 _ | Punboxed_int32_array_set_128 _
2027-
| Punboxed_int64_array_set_128 _ | Punboxed_nativeint_array_set_128 _
2028-
| Patomic_cas ),
2034+
| Punboxed_float_array_set_128 _ | Punboxed_float32_array_set_128 _
2035+
| Punboxed_int32_array_set_128 _ | Punboxed_int64_array_set_128 _
2036+
| Punboxed_nativeint_array_set_128 _ | Patomic_cas ),
20292037
( []
20302038
| [_]
20312039
| [_; _]

ocaml/bytecomp/bytegen.ml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,13 @@ let preserve_tailcall_for_prim = function
150150
| Pbigstring_load_64 _ | Pbigstring_load_128 _
151151
| Pbigstring_set_16 _ | Pbigstring_set_32 _ | Pbigstring_set_f32 _
152152
| Pfloatarray_load_128 _ | Pfloat_array_load_128 _ | Pint_array_load_128 _
153-
| Punboxed_float_array_load_128 _ | Punboxed_int32_array_load_128 _
154-
| Punboxed_int64_array_load_128 _ | Punboxed_nativeint_array_load_128 _
153+
| Punboxed_float_array_load_128 _ | Punboxed_float32_array_load_128 _
154+
| Punboxed_int32_array_load_128 _ | Punboxed_int64_array_load_128 _
155+
| Punboxed_nativeint_array_load_128 _
155156
| Pfloatarray_set_128 _ | Pfloat_array_set_128 _ | Pint_array_set_128 _
156-
| Punboxed_float_array_set_128 _ | Punboxed_int32_array_set_128 _
157-
| Punboxed_int64_array_set_128 _ | Punboxed_nativeint_array_set_128 _
157+
| Punboxed_float_array_set_128 _ | Punboxed_float32_array_set_128 _
158+
| Punboxed_int32_array_set_128 _ | Punboxed_int64_array_set_128 _
159+
| Punboxed_nativeint_array_set_128 _
158160
| Pbigstring_set_64 _ | Pbigstring_set_128 _
159161
| Pprobe_is_enabled _ | Pobj_dup
160162
| Pctconst _ | Pbswap16 | Pbbswap _ | Pint_as_pointer _
@@ -573,11 +575,13 @@ let comp_primitive stack_info p sz args =
573575
| Pstring_load_128 _ | Pbytes_load_128 _ | Pbytes_set_128 _
574576
| Pbigstring_load_128 _ | Pbigstring_set_128 _
575577
| Pfloatarray_load_128 _ | Pfloat_array_load_128 _ | Pint_array_load_128 _
576-
| Punboxed_float_array_load_128 _ | Punboxed_int32_array_load_128 _
577-
| Punboxed_int64_array_load_128 _ | Punboxed_nativeint_array_load_128 _
578+
| Punboxed_float_array_load_128 _ | Punboxed_float32_array_load_128 _
579+
| Punboxed_int32_array_load_128 _ | Punboxed_int64_array_load_128 _
580+
| Punboxed_nativeint_array_load_128 _
578581
| Pfloatarray_set_128 _ | Pfloat_array_set_128 _ | Pint_array_set_128 _
579-
| Punboxed_float_array_set_128 _ | Punboxed_int32_array_set_128 _
580-
| Punboxed_int64_array_set_128 _ | Punboxed_nativeint_array_set_128 _ ->
582+
| Punboxed_float_array_set_128 _ | Punboxed_float32_array_set_128 _
583+
| Punboxed_int32_array_set_128 _ | Punboxed_int64_array_set_128 _
584+
| Punboxed_nativeint_array_set_128 _ ->
581585
fatal_error "128-bit load/store is not supported in bytecode mode."
582586
(* The cases below are handled in [comp_expr] before the [comp_primitive] call
583587
(in the order in which they appear below),
@@ -1218,3 +1222,4 @@ let compile_phrase expr =
12181222
let init_code = comp_block empty_env expr 1 [Kreturn 1] in
12191223
let fun_code = comp_remainder [] in
12201224
(init_code, fun_code))
1225+

ocaml/lambda/lambda.ml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,13 +270,15 @@ type primitive =
270270
| Pfloat_array_load_128 of { unsafe : bool; mode : alloc_mode }
271271
| Pint_array_load_128 of { unsafe : bool; mode : alloc_mode }
272272
| Punboxed_float_array_load_128 of { unsafe : bool; mode : alloc_mode }
273+
| Punboxed_float32_array_load_128 of { unsafe : bool; mode : alloc_mode }
273274
| Punboxed_int32_array_load_128 of { unsafe : bool; mode : alloc_mode }
274275
| Punboxed_int64_array_load_128 of { unsafe : bool; mode : alloc_mode }
275276
| Punboxed_nativeint_array_load_128 of { unsafe : bool; mode : alloc_mode }
276277
| Pfloatarray_set_128 of { unsafe : bool }
277278
| Pfloat_array_set_128 of { unsafe : bool }
278279
| Pint_array_set_128 of { unsafe : bool }
279280
| Punboxed_float_array_set_128 of { unsafe : bool }
281+
| Punboxed_float32_array_set_128 of { unsafe : bool }
280282
| Punboxed_int32_array_set_128 of { unsafe : bool }
281283
| Punboxed_int64_array_set_128 of { unsafe : bool }
282284
| Punboxed_nativeint_array_set_128 of { unsafe : bool }
@@ -1764,6 +1766,7 @@ let primitive_may_allocate : primitive -> alloc_mode option = function
17641766
| Pfloat_array_load_128 { mode = m; _ }
17651767
| Pint_array_load_128 { mode = m; _ }
17661768
| Punboxed_float_array_load_128 { mode = m; _ }
1769+
| Punboxed_float32_array_load_128 { mode = m; _ }
17671770
| Punboxed_int32_array_load_128 { mode = m; _ }
17681771
| Punboxed_int64_array_load_128 { mode = m; _ }
17691772
| Punboxed_nativeint_array_load_128 { mode = m; _ }
@@ -1782,8 +1785,9 @@ let primitive_may_allocate : primitive -> alloc_mode option = function
17821785
| Pbigstring_set_16 _ | Pbigstring_set_32 _ | Pbigstring_set_f32 _
17831786
| Pbigstring_set_64 _ | Pbigstring_set_128 _
17841787
| Pfloatarray_set_128 _ | Pfloat_array_set_128 _ | Pint_array_set_128 _
1785-
| Punboxed_float_array_set_128 _ | Punboxed_int32_array_set_128 _
1786-
| Punboxed_int64_array_set_128 _ | Punboxed_nativeint_array_set_128 _ -> None
1788+
| Punboxed_float_array_set_128 _ | Punboxed_float32_array_set_128 _
1789+
| Punboxed_int32_array_set_128 _ | Punboxed_int64_array_set_128 _
1790+
| Punboxed_nativeint_array_set_128 _ -> None
17871791
| Pctconst _ -> None
17881792
| Pbswap16 -> None
17891793
| Pbbswap (_, m) -> Some m
@@ -1874,8 +1878,9 @@ let primitive_result_layout (p : primitive) =
18741878
| Pbytes_set_128 _ | Pbigstring_set_16 _ | Pbigstring_set_32 _ | Pbigstring_set_f32 _
18751879
| Pbigstring_set_64 _ | Pbigstring_set_128 _
18761880
| Pfloatarray_set_128 _ | Pfloat_array_set_128 _ | Pint_array_set_128 _
1877-
| Punboxed_float_array_set_128 _ | Punboxed_int32_array_set_128 _
1878-
| Punboxed_int64_array_set_128 _ | Punboxed_nativeint_array_set_128 _
1881+
| Punboxed_float_array_set_128 _ | Punboxed_float32_array_set_128 _
1882+
| Punboxed_int32_array_set_128 _ | Punboxed_int64_array_set_128 _
1883+
| Punboxed_nativeint_array_set_128 _
18791884
-> layout_unit
18801885
| Pgetglobal _ | Psetglobal _ | Pgetpredef _ -> layout_module_field
18811886
| Pmakeblock _ | Pmakefloatblock _ | Pmakearray _ | Pduprecord _
@@ -1941,6 +1946,8 @@ let primitive_result_layout (p : primitive) =
19411946
| Pfloatarray_load_128 _ | Pfloat_array_load_128 _
19421947
| Punboxed_float_array_load_128 _ ->
19431948
layout_boxed_vector (Pvec128 Float64x2)
1949+
| Punboxed_float32_array_load_128 _ ->
1950+
layout_boxed_vector (Pvec128 Float32x4)
19441951
| Pint_array_load_128 _ | Punboxed_int64_array_load_128 _
19451952
| Punboxed_nativeint_array_load_128 _ ->
19461953
(* 128-bit types are only supported in the x86_64 backend, so we may

0 commit comments

Comments
 (0)