Commit Graph

14 Commits (540996d21ee3793a1cecce252c81fb76a6b9fd61)

Author SHA1 Message Date
Nicolás Ojeda Bär 540996d21e Remove Spacetime 2020-10-08 20:28:12 +02:00
Stephen Dolan b735f187ac
Avoid Cconst_natint where Cconst_int will do (#9838)
Cconst_int generates better code, as it hits the instruction
selector's cases for small immediates.
2020-08-25 16:27:11 +01:00
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
Xavier Leroy 7f5a137972 New representation of closures, native-code compilation
In code that builds closures, instead of the old arity field,
produce a closure information field encoding arity + position of environment.
2020-06-05 17:46:58 +02:00
Greta Yorsh 6cb283b1d8 Move float compare from cmmgen to cmm_helpers 2020-05-27 16:59:15 +01:00
Greta Yorsh 8fce17d902 Bind arguments of integer and float compare in cmmgen 2020-05-27 14:49:35 +01:00
Stephen Dolan 2d92955749
Remove Const_pointer (#9578)
Since #9316 was merged, Cconst_pointer is compiled in exactly the same way as Cconst_int. This commit removes the now-redundant Cconst_pointer and Cconst_natpointer.
2020-05-19 15:31:08 +02:00
Stephen Dolan 2986beaa78 Replace Location.t with Lambda.scoped_location in Lambda code
This commit threads scopes through translation from Typedtree to
Lambda, extending the scopes when entering functions, modules,
classes and methods.
2020-04-27 12:58:53 +01:00
Greta Yorsh 824ce35492
Replace caml_int_compare and caml_float_compare with primitives (#2324) 2020-03-26 10:58:10 +01:00
Stephen Dolan 1336ce0c0d Use typing information from Clambda for mutable Cmm variables 2020-02-25 15:03:14 +00:00
Vincent Laviron 42e9ab34f4 Fix addition kind in cache_public_method
No Changes entry needed
2019-10-24 18:47:38 +02:00
Stephen Dolan fd568688d7 Remove the transformation untag_int(tag_int x) = x. (#9032)
This transformation is incorrect for certain large values of x,
as it can get the wrong value in the high bit. In certain cases
where the high bit is not used (esp. storing a byte into a string),
the transformation is kept intact.

Fixes #9028.
2019-10-14 14:39:17 +02:00
Stephen Dolan 09a01b7080 Avoid redundant sign-extensions for int32 on 64-bit platforms. 2019-10-14 10:45:11 +01:00
Vincent Laviron 60f58174ba
Split cmmgen into generic cmm helpers and clambda-specific transformations (#1963) 2019-10-04 17:49:59 +02:00