diff options
author | Xavier Leroy <xavier.leroy@college-de-france.fr> | 2021-01-16 15:27:02 +0100 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@college-de-france.fr> | 2021-01-16 16:51:02 +0100 |
commit | 478ece46d8323ea182ded96a531309becf7445bb (patch) | |
tree | a5d79c607cbd8509ee5b25305daab483deef06bb /arm/Conventions1.v | |
parent | 6bef869040014b4d589a8e49b42ac36a970d1bc6 (diff) | |
download | compcert-478ece46d8323ea182ded96a531309becf7445bb.tar.gz compcert-478ece46d8323ea182ded96a531309becf7445bb.zip |
Support re-normalization of function parameters at function entry
This is complementary to 28f235806
Some ABIs leave more flexibility concerning function parameters than
CompCert expects.
For instance, the AArch64/ELF ABI allow the caller of a function to
leave unspecified the "padding bits" of function parameters. As an
example, a parameter of type "unsigned char" may not have zeros in
bits 8 to 63, but may have any bits there.
When the caller is compiled by CompCert, it normalizes argument values
to the parameter types before the call, so padding bits are always
correct w.r.t. the type of the argument. This is no longer guaranteed
in interoperability scenarios, when the caller is not compiled by CompCert.
This commit adds a general mechanism to insert "re-normalization"
conversions on the parameters of a function, at function entry.
This is controlled by the platform-dependent function
Convention1.return_value_needs_normalization.
The semantic preservation proof is still conducted against the
CompCert model, where the argument values of functions are already
normalized. What the proof shows is that the extra conversions have
no effect in this case. In future work we could relax the CompCert
model, allowing functions to pass arguments that are not normalized.
Diffstat (limited to 'arm/Conventions1.v')
-rw-r--r-- | arm/Conventions1.v | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arm/Conventions1.v b/arm/Conventions1.v index 3bd2b553..b94ce9ef 100644 --- a/arm/Conventions1.v +++ b/arm/Conventions1.v @@ -436,8 +436,9 @@ Proof. destruct Archi.abi; reflexivity. Qed. -(** ** Normalization of function results *) +(** ** Normalization of function results and parameters *) (** No normalization needed. *) Definition return_value_needs_normalization (t: rettype) := false. +Definition parameter_needs_normalization (t: rettype) := false. |