aboutsummaryrefslogtreecommitdiffstats
path: root/powerpc
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@college-de-france.fr>2021-01-16 15:27:02 +0100
committerXavier Leroy <xavier.leroy@college-de-france.fr>2021-01-16 16:51:02 +0100
commit478ece46d8323ea182ded96a531309becf7445bb (patch)
treea5d79c607cbd8509ee5b25305daab483deef06bb /powerpc
parent6bef869040014b4d589a8e49b42ac36a970d1bc6 (diff)
downloadcompcert-kvx-478ece46d8323ea182ded96a531309becf7445bb.tar.gz
compcert-kvx-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 'powerpc')
-rw-r--r--powerpc/Conventions1.v3
1 files changed, 2 insertions, 1 deletions
diff --git a/powerpc/Conventions1.v b/powerpc/Conventions1.v
index 045eb471..56beffe8 100644
--- a/powerpc/Conventions1.v
+++ b/powerpc/Conventions1.v
@@ -349,8 +349,9 @@ Proof.
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.