Commit Graph

18 Commits (master)

Author SHA1 Message Date
Xavier Leroy 9fcb295b98 Revised passing of arguments to external C functions
Introduce the type Cmm.exttype to precisely describe arguments to
external C functions, especially unboxed numerical arguments.

Annotate Cmm.Cextcall with the types of the arguments (Cmm.exttype list).
An empty list means "all arguments have default type XInt".

Annotate Mach.Iextcall with the type of the result (Cmm.machtype)
and the types of the arguments (Cmm.exttype list).

Change (slightly) the API for describing calling conventions in Proc:
- loc_external_arguments now takes a Cmm.exttype list,
  in order to know more precisely the types of the arguments.
- loc_arguments, loc_parameters, loc_results, loc_external_results
  now take a Cmm.machype instead of an array of pseudoregisters.
  (Only the types of the pseudoregisters mattered anyway.)

Update the implementations of module Proc accordingly, in every port.

Introduce a new overridable method in Selectgen, insert_move_extcall_arg,
to produce the code that moves an argument of an external C function
to the locations returned by Proc.loc_external_arguments.

Revise the selection of external calls accordingly
(method emit_extcall_args in Selectgen).
2020-07-24 17:39:22 +02:00
Stephen Dolan d48df3cac1 Visit registers at most once in Coloring.iter_preferred 2020-03-31 12:34:02 +01:00
Stephen Dolan 1336ce0c0d Use typing information from Clambda for mutable Cmm variables 2020-02-25 15:03:14 +00:00
Mark Shinwell 2b5f13c913 GPR#2056 (Backend_var) 2018-09-28 17:59:01 +02:00
Damien Doligez 5401ce8473 Update headers for the new license.
Remains to be done: remove all headers in testsuite/tests.
2016-02-18 16:59:16 +01:00
Xavier Leroy fcc2da3848 PR#6501: harden the native-code generator against certain uses of "%identity".
Technically: when a C-- let-bound variable is assigned to, update its type
so that it is the lub of the types of the initial value and all values
assigned to it, with the type ordering Int <: Addr.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15078 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-11 07:46:25 +00:00
Xavier Leroy 9c1d005ebb New back-end optimization pass: dead code elimination.
(Removes arithmetic and load instructions whose results are unused.)
(Cherry-picked from branch backend-optim.)


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14686 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-04-26 09:31:18 +00:00
Mark Shinwell de489bde2f improved abstractions for register naming in the native code backend
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14465 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-03-17 14:39:12 +00:00
Damien Doligez def31744f9 remove all $Id keywords
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13013 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-10-15 17:50:56 +00:00
Damien Doligez 3b507dd1aa renaming of Objective Caml to OCaml and cleanup of copyright headers
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11156 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2011-07-27 14:17:02 +00:00
Xavier Leroy 1a7d4a3293 Added and used Reg.createv_like.
Selectgen: new methods regs_for, enables ports to store float values
in pairs of integer registers.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@9210 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2009-03-31 09:44:50 +00:00
Xavier Leroy cc0f32b054 Changement de la licence
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@2553 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1999-11-17 18:59:06 +00:00
Xavier Leroy 2301d778e7 Renommage en Objective Caml
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@782 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1996-04-30 14:53:58 +00:00
Jérôme Vouillon 7974a9d8b1 Extension objets.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@756 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1996-04-22 11:15:41 +00:00
Xavier Leroy 986156eadf "with" -> "with type".
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@308 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1995-10-03 14:02:18 +00:00
Xavier Leroy e4066357b1 Ajout des notices de copyright
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@195 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1995-08-09 15:06:35 +00:00
Xavier Leroy 48514aaca8 Integration du generateur de code et du compilateur.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@51 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1995-07-02 16:41:48 +00:00
Xavier Leroy 3ceaa85c72 Premiere version.
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@34 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1995-06-15 08:17:29 +00:00