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). (commit: 9fcb295)
ARM64 back-end: support the iOS/macOS ABI for calling external C functions
Unboxed arguments of type `int32` that are passed on the stack are passed in 32-bit words instead of 64-bit words as in the AAPCS64 ABI.
To support this, we introduce a new specific operation, `Imove32`, that compiles down to 32-bit moves or 32-bit stack loads or 32-bit stack stores.
In the Selection pass, method `insert_move_extcall_arg`, we generate `Imove32` instructions when required, i.e. if the argument is an unboxed `int32` and needs to be passed on stack.
We then update `Proc.loc_external_arguments` to use 32-bit stack words for `int32` arguments. (commit: ed8f3b4)