diff options
author | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2010-10-28 14:56:39 +0000 |
---|---|---|
committer | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2010-10-28 14:56:39 +0000 |
commit | 14a9bb4b267eeead8cd9503ee19e860a8bc0d763 (patch) | |
tree | c70dda532a974a7b62969c6b199b80d65784dc91 /cfrontend/Cshmgenproof.v | |
parent | b54721f58c2ecb65ce554d8b34f214d5121a2b0c (diff) | |
download | compcert-14a9bb4b267eeead8cd9503ee19e860a8bc0d763.tar.gz compcert-14a9bb4b267eeead8cd9503ee19e860a8bc0d763.zip |
Float.intoffloat and Float.intuoffloat are now partial functions.
(May fail if float is too big to be converted.)
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1544 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'cfrontend/Cshmgenproof.v')
-rw-r--r-- | cfrontend/Cshmgenproof.v | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/cfrontend/Cshmgenproof.v b/cfrontend/Cshmgenproof.v index 4784e1ed..88f042de 100644 --- a/cfrontend/Cshmgenproof.v +++ b/cfrontend/Cshmgenproof.v @@ -361,8 +361,18 @@ Proof. destruct sg; econstructor; eauto. Qed. +Lemma make_intoffloat_correct: + forall e le m a sg f i, + eval_expr ge e le m a (Vfloat f) -> + cast_float_int sg f = Some i -> + eval_expr ge e le m (make_intoffloat a sg) (Vint i). +Proof. + unfold cast_float_int, make_intoffloat; intros. + destruct sg; econstructor; eauto; simpl; rewrite H0; auto. +Qed. + Hint Resolve make_intconst_correct make_floatconst_correct - make_floatofint_correct + make_floatofint_correct make_intoffloat_correct eval_Eunop eval_Ebinop: cshm. Hint Extern 2 (@eq trace _ _) => traceEq: cshm. @@ -650,7 +660,8 @@ Proof. (* cast_int_int *) destruct sz2; destruct si2; repeat econstructor; eauto with cshm. (* cast_float_int *) - destruct sz2; destruct si2; unfold make_intoffloat; repeat econstructor; eauto with cshm; simpl; auto. + exploit make_intoffloat_correct; eauto. intros A. + destruct sz2; destruct si2; eauto with cshm. (* cast_int_float *) destruct sz2; destruct si1; unfold make_floatofint; repeat econstructor; eauto with cshm; simpl; auto. (* cast_float_float *) |