diff options
author | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2013-07-08 08:38:02 +0000 |
---|---|---|
committer | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2013-07-08 08:38:02 +0000 |
commit | bdac1f6aba5370b21b34c9ee12429c3920b3dffb (patch) | |
tree | bc81db2ee38bc44158a9032905830a76c888d04b /cfrontend/Cshmgenproof.v | |
parent | 56257af93c1b0785d44e3feba9574e77250d420c (diff) | |
download | compcert-bdac1f6aba5370b21b34c9ee12429c3920b3dffb.tar.gz compcert-bdac1f6aba5370b21b34c9ee12429c3920b3dffb.zip |
Revised handling of int->float conversions:
- introduce Float.floatofint{,u} and use it in the semantics of C
- prove that it is equivalent to int->double conversion followed by
double->float rounding, and use this fact to justify code generation
in Cshmgen.
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2294 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'cfrontend/Cshmgenproof.v')
-rw-r--r-- | cfrontend/Cshmgenproof.v | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/cfrontend/Cshmgenproof.v b/cfrontend/Cshmgenproof.v index 3d5bbbae..24576fc6 100644 --- a/cfrontend/Cshmgenproof.v +++ b/cfrontend/Cshmgenproof.v @@ -144,11 +144,15 @@ Proof. Qed. Lemma make_floatofint_correct: - forall a n sg e le m, + forall a n sg sz e le m, eval_expr ge e le m a (Vint n) -> - eval_expr ge e le m (make_floatofint a sg) (Vfloat(cast_int_float sg n)). + eval_expr ge e le m (make_floatofint a sg sz) (Vfloat(cast_int_float sg sz n)). Proof. - intros. unfold make_floatofint, cast_int_float. + intros. unfold make_floatofint, cast_int_float. + destruct sz. + destruct sg. + rewrite Float.singleofint_floatofint. econstructor. econstructor; eauto. simpl; reflexivity. auto. + rewrite Float.singleofintu_floatofintu. econstructor. econstructor; eauto. simpl; reflexivity. auto. destruct sg; econstructor; eauto. Qed. |