Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
New ARM backend #5433
Original bug ID: 5433
The following is basically copy&paste from https://github.com/bmeurer/ocaml-arm/wiki:
This patch contains my work on a new ARM backend for the OCaml native code compiler, currently based on the 3.12.1 release. Compared to the old ARM backend, this one does the following:
See https://github.com/bmeurer/ocaml-arm/wiki for up-to-date information about the current state of the patch.
The latest patch is attached, but it's not necessarily the final patch. It's almost a complete rewrite of the ARM backend, so it will need some more testing.
Comment author: @xavierleroy
I have a concern about Proc.destroyed_at_oper, case Iop(Iextcall(, true)): the result should really be all_phys_regs as in the original code. Indeed, an allocating extcall can raise a Caml exception, which will not reload any of the callee-save registers. Also, such an extcall can trigger a GC, and if GC roots are stored in callee-save regs across the Iextcall, the GC assumes that these callee-save regs have been saved in memory in a location pointed to by caml_gc_regs (cf. caml_call_gc in asmrun/.S). For both reasons, all Caml values live across a Iextcall(, true) must be stack-allocated, and this is achieved by saying that the Iextcall destroys all registers.
Comment author: meurer
I just merged the latest commit ec5b444c7f of my development repository at https://github.com/bmeurer/ocaml-arm/tree/ec5b444c7f into trunk with revision 12124.