Skip to content

Convert float32 constants to int32 in first stage compiler #3371

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
edit
  • Loading branch information
TheNumbat committed Dec 12, 2024
commit 487338323b2eeed5f36960aaf0024b25d05a4443
2 changes: 1 addition & 1 deletion bytecomp/symtable.ml
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ let rec transl_const = function
| Const_base(Const_float32 f)
| Const_base(Const_unboxed_float32 f) ->
if float32_is_stage1 ()
then Misc.fatal_error "Bytecode compilation should not produce float32 constants."
then Misc.fatal_error "The stage one bytecode compiler should not produce float32 constants."
else Obj.repr (float32_of_string f)
| Const_base(Const_float f)
| Const_base(Const_unboxed_float f) -> Obj.repr (float_of_string f)
Expand Down
2 changes: 1 addition & 1 deletion middle_end/flambda2/numbers/floats/float32_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ CAMLprim value compiler_float32_format(value fmt, value arg)
}

// These replace the OCaml runtime versions for use in the stage one compiler.
// They must be weak symbols with the sames name as in runtime/ because the stage
// They must be weak symbols with the same names as in runtime/ because the stage
// two compiler will link against runtime/.

CAMLweakdef value caml_float32_is_stage1(value v) {
Expand Down
Loading