Commit Graph

25 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 6fbecf0f72 Reset Reg.visit_generation during Reg.reset 2020-04-16 13:19:33 +01: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
Daniel Bünzli a7afd89003 s/string_of_int/Int.to_string/g 2018-11-07 13:52:02 +01: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
Damien Doligez cbfe627f92 merge changes from branch 4.02 from branching (rev 14852) to 4.02.0+rc1 (rev 15121)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15125 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2014-08-22 13:45:02 +00: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
Damien Doligez 04b1656222 clean up spaces and tabs
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@9547 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2010-01-22 12:48:24 +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 7cf43583e4 Determination automatique du premier numero de register libre
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@3216 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2000-06-29 11:44:06 +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 f1baf28aa6 Decourager le spilling des registres introduits par reload.
Intel 386: suppression des stack-to-stack moves.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@994 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1996-09-18 14:16:16 +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 1f8a4f6da7 Reecriture du flottant I386 pour utiliser vraiment la pile de registres flottants
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@519 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1995-12-10 09:31:57 +00:00
Xavier Leroy d3397b6cb3 Garder les stamps de registres petits, car interf alloue en N^2 ou N est le plus grand stamp
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@479 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
1995-11-27 19:41:15 +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