From 41195b91d62b67683d3d2cc5cdd54be28e8a5cbc Mon Sep 17 00:00:00 2001 From: Max Slater Date: Tue, 13 Feb 2024 18:17:03 +0000 Subject: [PATCH 1/2] fix --- middle_end/flambda2/from_lambda/lambda_to_flambda.ml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/middle_end/flambda2/from_lambda/lambda_to_flambda.ml b/middle_end/flambda2/from_lambda/lambda_to_flambda.ml index 4230a055110..37f25bfa1cb 100644 --- a/middle_end/flambda2/from_lambda/lambda_to_flambda.ml +++ b/middle_end/flambda2/from_lambda/lambda_to_flambda.ml @@ -1487,9 +1487,12 @@ and cps_function env ~fid ~(recursive : Recursive.t) ?precomputed_free_idents field_kinds)) | Pvalue (Pvariant { consts = []; non_consts = [(tag, field_kinds)] }) when tag = Obj.double_array_tag -> - assert (List.for_all (fun kind -> kind = Lambda.Pfloatval) field_kinds); + assert (List.for_all (fun kind -> kind = Lambda.(Pboxedfloatval Pfloat64)) field_kinds); Some (Unboxed_float_record (List.length field_kinds)) - | Pvalue Pfloatval -> Some (Unboxed_number Naked_float) + | Pvalue (Pboxedfloatval Pfloat64) -> Some (Unboxed_number Naked_float) + | Pvalue (Pboxedfloatval Pfloat32) -> + (* CR mslater: (float32) middle end support *) + assert false | Pvalue (Pboxedintval bi) -> let bn : Flambda_kind.Boxable_number.t = match bi with @@ -1504,7 +1507,7 @@ and cps_function env ~fid ~(recursive : Recursive.t) ?precomputed_free_idents in Some (Unboxed_number bn) | Pvalue (Pgenval | Pintval | Pvariant _ | Parrayval _) - | Ptop | Pbottom | Punboxed_float | Punboxed_int _ | Punboxed_vector _ + | Ptop | Pbottom | Punboxed_float _ | Punboxed_int _ | Punboxed_vector _ | Punboxed_product _ -> Location.prerr_warning (Debuginfo.Scoped_location.to_location loc) From 9ce296a0ca98238cbfb7f7503f8bdbdf818bf289 Mon Sep 17 00:00:00 2001 From: Max Slater Date: Tue, 13 Feb 2024 18:23:06 +0000 Subject: [PATCH 2/2] format... --- middle_end/flambda2/from_lambda/lambda_to_flambda.ml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/middle_end/flambda2/from_lambda/lambda_to_flambda.ml b/middle_end/flambda2/from_lambda/lambda_to_flambda.ml index 37f25bfa1cb..82ec3e94bb1 100644 --- a/middle_end/flambda2/from_lambda/lambda_to_flambda.ml +++ b/middle_end/flambda2/from_lambda/lambda_to_flambda.ml @@ -1487,7 +1487,10 @@ and cps_function env ~fid ~(recursive : Recursive.t) ?precomputed_free_idents field_kinds)) | Pvalue (Pvariant { consts = []; non_consts = [(tag, field_kinds)] }) when tag = Obj.double_array_tag -> - assert (List.for_all (fun kind -> kind = Lambda.(Pboxedfloatval Pfloat64)) field_kinds); + assert ( + List.for_all + (fun kind -> kind = Lambda.(Pboxedfloatval Pfloat64)) + field_kinds); Some (Unboxed_float_record (List.length field_kinds)) | Pvalue (Pboxedfloatval Pfloat64) -> Some (Unboxed_number Naked_float) | Pvalue (Pboxedfloatval Pfloat32) ->