Skip to content
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

float32 backend plumbing/casts #2391

Merged
merged 73 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
430b6b7
float32 in flambda2
TheNumbat Mar 14, 2024
627203b
fixes
TheNumbat Mar 14, 2024
296e7b8
arm
TheNumbat Mar 14, 2024
a0a2282
more crs
TheNumbat Mar 14, 2024
7458491
primitives
TheNumbat Mar 14, 2024
8644e75
format
TheNumbat Mar 14, 2024
d0342f1
upstream build
TheNumbat Mar 14, 2024
797a7a6
delete array case
TheNumbat Mar 19, 2024
fad1816
casts
TheNumbat Mar 19, 2024
0bd3e82
format
TheNumbat Mar 19, 2024
f195d02
Merge branch 'f32-fl2' into f32-backend
TheNumbat Mar 19, 2024
9c8d442
testsuite cmm parser
TheNumbat Mar 19, 2024
a2af96d
format
TheNumbat Mar 19, 2024
9451a8f
cast fl2
TheNumbat Mar 19, 2024
84e23ff
num conv
TheNumbat Mar 19, 2024
39b36ca
merge
TheNumbat Mar 19, 2024
e42799a
fix name in cfg
TheNumbat Mar 19, 2024
0b86abd
float32 static consts
TheNumbat Mar 19, 2024
2fe6ea4
add test
TheNumbat Mar 19, 2024
7e93f52
fixes
TheNumbat Mar 19, 2024
8d56965
Merge branch 'f32-fl2' into f32-backend
TheNumbat Mar 19, 2024
8ade880
another fix
TheNumbat Mar 19, 2024
7f64da8
Merge branch 'f32-fl2' into f32-backend
TheNumbat Mar 19, 2024
0d24bdd
fix nan test
TheNumbat Mar 19, 2024
0937fc4
actually use cconst_float32
TheNumbat Mar 20, 2024
2ea3d51
separate storage single and actual float32
TheNumbat Mar 22, 2024
4375a5d
merge
TheNumbat Mar 22, 2024
b6662e4
fix cmm test parser again
TheNumbat Mar 22, 2024
d83be31
comments
TheNumbat Mar 22, 2024
d8663f1
parsecmm again
TheNumbat Mar 22, 2024
96403b6
Merge branch 'main' into f32-fl2
TheNumbat Mar 22, 2024
4068688
merge
TheNumbat Mar 22, 2024
2d2498d
parsecmm again
TheNumbat Mar 22, 2024
5ea8e3e
arm
TheNumbat Mar 22, 2024
9fa47cd
unify single mem chunks
TheNumbat Apr 2, 2024
d9347fe
fix size_expr f32 const
TheNumbat Apr 2, 2024
ccfbe36
merge fix from later pr
TheNumbat Apr 2, 2024
ae04a8e
parsecmm...
TheNumbat Apr 2, 2024
01c848f
arm build
TheNumbat Apr 2, 2024
b13bd15
new machtype component
TheNumbat Apr 2, 2024
1b19d02
fix ext args
TheNumbat Apr 2, 2024
7eaa6ec
Apply suggestions from code review
TheNumbat Apr 3, 2024
f5766a3
comments
TheNumbat Apr 3, 2024
a42f8f7
use 4b size in selectgen
TheNumbat Apr 3, 2024
e38b256
real f32 ops in f32_by_bit_pattern
TheNumbat Apr 8, 2024
a7b32de
float32 parsing (untested)
TheNumbat Apr 8, 2024
050b46b
install stubs for testsuite
TheNumbat Apr 8, 2024
f899698
merge
TheNumbat Apr 8, 2024
d08462a
merge
TheNumbat Apr 8, 2024
5c150cd
merge arm changes
TheNumbat Apr 8, 2024
7d45d1f
Update ocaml/middle_end/flambda/closure_conversion.ml
TheNumbat Apr 9, 2024
64b2663
address comments
TheNumbat Apr 9, 2024
d165586
Merge branch 'f32-fl2' of github.com:ocaml-flambda/flambda-backend in…
TheNumbat Apr 9, 2024
62d2c75
Merge branch 'f32-fl2' into f32-backend
TheNumbat Apr 9, 2024
9eec365
comment
TheNumbat Apr 9, 2024
0f9dae1
Merge branch 'f32-fl2' into f32-backend
TheNumbat Apr 9, 2024
cbd71a1
simplify locale defs
TheNumbat Apr 9, 2024
fa7870b
Merge branch 'f32-fl2' into f32-backend
TheNumbat Apr 9, 2024
8e9bdf8
move f32 lib to external
TheNumbat Apr 11, 2024
7f69249
fix build system
TheNumbat Apr 11, 2024
9ac6060
format
TheNumbat Apr 11, 2024
eacd280
Merge branch 'f32-fl2' into f32-backend
TheNumbat Apr 11, 2024
b78a2e4
fix compare
TheNumbat Apr 16, 2024
f551594
Merge branch 'f32-fl2' into f32-backend
TheNumbat Apr 16, 2024
4daf82d
fix static const
TheNumbat Apr 16, 2024
04bd989
typo
TheNumbat Apr 16, 2024
77e83d9
Merge branch 'f32-fl2' into f32-backend
TheNumbat Apr 16, 2024
2a3a4f2
typo
TheNumbat Apr 16, 2024
fc02a69
Merge branch 'f32-fl2' into f32-backend
TheNumbat Apr 16, 2024
df6688e
another tagging fix
TheNumbat Apr 16, 2024
c50b64f
Merge branch 'f32-fl2' into f32-backend
TheNumbat Apr 16, 2024
b0ed404
merge
TheNumbat Apr 26, 2024
ac288c1
fix arm build
TheNumbat Apr 26, 2024
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
format
  • Loading branch information
TheNumbat committed Mar 19, 2024
commit a2af96d788b668276c54060bf0781b70ceb83e0b
10 changes: 5 additions & 5 deletions backend/cfg/cfg.ml
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,8 @@ let dump_op ppf = function
| Scalarcast (Float_to_int Pfloat64) -> Format.fprintf ppf "intoffloat"
| Scalarcast (Float_of_int Pfloat32) -> Format.fprintf ppf "float32toint"
| Scalarcast (Float_to_int Pfloat32) -> Format.fprintf ppf "intoffloat32"
| Scalarcast (Float_of_float32) -> Format.fprintf ppf "floatoffloat32"
| Scalarcast (Float_to_float32) -> Format.fprintf ppf "float32offloat"
| Scalarcast Float_of_float32 -> Format.fprintf ppf "floatoffloat32"
| Scalarcast Float_to_float32 -> Format.fprintf ppf "float32offloat"
| Vectorcast Bits128 -> Format.fprintf ppf "vec128->vec128"
| Scalarcast (V128_to_scalar ty) ->
Format.fprintf ppf "%s->scalar" (Primitive.vec128_name ty)
Expand Down Expand Up @@ -550,9 +550,9 @@ let is_noop_move instr =
( Const_int _ | Const_float _ | Const_symbol _ | Const_vec128 _
| Stackoffset _ | Load _ | Store _ | Intop _ | Intop_imm _
| Intop_atomic _ | Negf | Absf | Addf | Subf | Mulf | Divf | Compf _
| Opaque | Valueofint | Intofvalue
| Scalarcast _ | Probe_is_enabled _ | Specific _ | Name_for_debugger _
| Begin_region | End_region | Dls_get | Poll | Alloc _ )
| Opaque | Valueofint | Intofvalue | Scalarcast _ | Probe_is_enabled _
| Specific _ | Name_for_debugger _ | Begin_region | End_region | Dls_get
| Poll | Alloc _ )
| Reloadretaddr | Pushtrap _ | Poptrap | Prologue ->
false

Expand Down
13 changes: 6 additions & 7 deletions backend/cfg/cfg_comballoc.ml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,9 @@ let rec find_next_allocation : cell option -> allocation option =
( Move | Spill | Reload | Const_int _ | Const_float _ | Const_symbol _
| Const_vec128 _ | Stackoffset _ | Load _ | Store _ | Intop _
| Intop_imm _ | Intop_atomic _ | Negf | Absf | Addf | Subf | Mulf | Divf
| Compf _ | Csel _ | Valueofint | Intofvalue
| Vectorcast _ | Scalarcast _ | Probe_is_enabled _ | Opaque
| Begin_region | End_region | Specific _ | Name_for_debugger _ | Dls_get
| Poll )
| Compf _ | Csel _ | Valueofint | Intofvalue | Vectorcast _
| Scalarcast _ | Probe_is_enabled _ | Opaque | Begin_region | End_region
| Specific _ | Name_for_debugger _ | Dls_get | Poll )
| Reloadretaddr | Pushtrap _ | Poptrap | Prologue ->
find_next_allocation (DLL.next cell))

Expand Down Expand Up @@ -99,9 +98,9 @@ let find_compatible_allocations :
{ allocations = List.rev allocations; next_cell = Some cell }
| Op
( Move | Spill | Reload | Negf | Absf | Addf | Subf | Mulf | Divf
| Valueofint | Intofvalue | Vectorcast _
| Opaque | Const_int _ | Const_float _ | Const_vec128 _
| Const_symbol _ | Stackoffset _ | Load _
| Valueofint | Intofvalue | Vectorcast _ | Opaque | Const_int _
| Const_float _ | Const_vec128 _ | Const_symbol _ | Stackoffset _
| Load _
| Store (_, _, _)
| Compf _ | Csel _ | Specific _ | Name_for_debugger _
| Probe_is_enabled _ | Scalarcast _ | Dls_get
Expand Down
3 changes: 1 addition & 2 deletions backend/cfg/cfg_cse.ml
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ class cse_generic =
| Intop_imm (_, _) -> Op_pure
| Intop_atomic _ -> Op_store true
| Compf _ | Csel _ | Negf | Absf | Addf | Subf | Mulf | Divf
| Scalarcast _ | Valueofint | Intofvalue
| Vectorcast _ ->
| Scalarcast _ | Valueofint | Intofvalue | Vectorcast _ ->
Op_pure
| Specific _ -> Op_other
| Name_for_debugger _ -> Op_other
Expand Down
3 changes: 2 additions & 1 deletion backend/cfg/cfg_equivalence.ml
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,8 @@ let check_operation : location -> Cfg.operation -> Cfg.operation -> unit =
when Cmm.equal_float_comparison left_comp right_comp ->
()
| Scalarcast left_scalar, Scalarcast right_scalar
when Cmm.equal_scalar_cast left_scalar right_scalar -> ()
when Cmm.equal_scalar_cast left_scalar right_scalar ->
()
| Valueofint, Valueofint -> ()
| Intofvalue, Intofvalue -> ()
| ( Probe_is_enabled { name = expected_name },
Expand Down
7 changes: 3 additions & 4 deletions backend/cfg/cfgize.ml
Original file line number Diff line number Diff line change
Expand Up @@ -629,10 +629,9 @@ module Stack_offset_and_exn = struct
( Move | Spill | Reload | Const_int _ | Const_float _ | Const_symbol _
| Const_vec128 _ | Load _ | Store _ | Intop _ | Intop_imm _
| Intop_atomic _ | Negf | Absf | Addf | Subf | Mulf | Divf | Compf _
| Valueofint | Csel _ | Intofvalue
| Scalarcast _ | Vectorcast _ | Probe_is_enabled _ | Opaque
| Begin_region | End_region | Specific _ | Name_for_debugger _ | Dls_get
| Poll | Alloc _ )
| Valueofint | Csel _ | Intofvalue | Scalarcast _ | Vectorcast _
| Probe_is_enabled _ | Opaque | Begin_region | End_region | Specific _
| Name_for_debugger _ | Dls_get | Poll | Alloc _ )
| Reloadretaddr | Prologue ->
stack_offset, traps

Expand Down
14 changes: 7 additions & 7 deletions backend/cmm_helpers.ml
Original file line number Diff line number Diff line change
Expand Up @@ -705,11 +705,11 @@ let test_bool dbg cmm =

let box_float32 dbg mode exp =
Cop
( Calloc mode,
[ alloc_boxedfloat32_header mode dbg;
Cconst_symbol (global_symbol caml_float32_ops, dbg);
exp ],
dbg )
( Calloc mode,
[ alloc_boxedfloat32_header mode dbg;
Cconst_symbol (global_symbol caml_float32_ops, dbg);
exp ],
dbg )

let unbox_float32 dbg =
map_tail ~kind:Any (function
Expand Down Expand Up @@ -3392,9 +3392,9 @@ let int_of_float32 = unary (Cscalarcast (Float_to_int Pfloat32))

let float32_of_int = unary (Cscalarcast (Float_of_int Pfloat32))

let float32_of_float = unary (Cscalarcast (Float_to_float32))
let float32_of_float = unary (Cscalarcast Float_to_float32)

let float_of_float32 = unary (Cscalarcast (Float_of_float32))
let float_of_float32 = unary (Cscalarcast Float_of_float32)

let lsl_int_caml_raw ~dbg arg1 arg2 =
incr_int (lsl_int (decr_int arg1 dbg) arg2 dbg) dbg
Expand Down
16 changes: 8 additions & 8 deletions backend/debug/available_regs.ml
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,10 @@ let rec available_regs (instr : M.instruction) ~all_regs_that_might_be_named
| Iconst_int _ | Iconst_float _ | Iconst_vec128 _ | Iconst_symbol _
| Iextcall _ | Istackoffset _ | Iload _ | Istore _ | Iintop _
| Iintop_imm _ | Iintop_atomic _ | Icompf _ | Inegf | Iabsf | Iaddf
| Isubf | Imulf | Idivf | Icsel _
| Ivalueofint | Iintofvalue | Iopaque | Ispecific _ | Iscalarcast _
| Ivectorcast _ | Iprobe_is_enabled _ | Ibeginregion | Iendregion
| Idls_get ) as op) ->
| Isubf | Imulf | Idivf | Icsel _ | Ivalueofint | Iintofvalue
| Iopaque | Ispecific _ | Iscalarcast _ | Ivectorcast _
| Iprobe_is_enabled _ | Ibeginregion | Iendregion | Idls_get ) as op)
->
(* We split the calculation of registers that become unavailable after a
call into two parts. First: anything that the target marks as
destroyed by the operation, combined with any registers that will be
Expand Down Expand Up @@ -288,10 +288,10 @@ let rec available_regs (instr : M.instruction) ~all_regs_that_might_be_named
| Iconst_vec128 _ | Iconst_symbol _ | Itailcall_ind | Itailcall_imm _
| Iextcall _ | Istackoffset _ | Iload _ | Istore _ | Iintop _
| Iintop_imm _ | Iintop_atomic _ | Icompf _ | Inegf | Iabsf | Iaddf
| Isubf | Imulf | Idivf | Icsel _
| Ivalueofint | Iintofvalue | Iopaque | Ispecific _ | Iscalarcast _
| Ivectorcast _ | Iname_for_debugger _ | Iprobe_is_enabled _
| Ibeginregion | Idls_get ->
| Isubf | Imulf | Idivf | Icsel _ | Ivalueofint | Iintofvalue
| Iopaque | Ispecific _ | Iscalarcast _ | Ivectorcast _
| Iname_for_debugger _ | Iprobe_is_enabled _ | Ibeginregion | Idls_get
->
RD.Set.empty
in
let made_unavailable =
Expand Down