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 /backend | |
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 'backend')
-rw-r--r-- | backend/Cminor.v | 4 | ||||
-rw-r--r-- | backend/Selectionproof.v | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/backend/Cminor.v b/backend/Cminor.v index 4e57d3ce..a3a166c0 100644 --- a/backend/Cminor.v +++ b/backend/Cminor.v @@ -240,8 +240,8 @@ Definition eval_unop (op: unary_operation) (arg: val) : option val := | Onegf, Vfloat f1 => Some (Vfloat (Float.neg f1)) | Oabsf, Vfloat f1 => Some (Vfloat (Float.abs f1)) | Osingleoffloat, _ => Some (Val.singleoffloat arg) - | Ointoffloat, Vfloat f1 => Some (Vint (Float.intoffloat f1)) - | Ointuoffloat, Vfloat f1 => Some (Vint (Float.intuoffloat f1)) + | Ointoffloat, Vfloat f1 => option_map Vint (Float.intoffloat f1) + | Ointuoffloat, Vfloat f1 => option_map Vint (Float.intuoffloat f1) | Ofloatofint, Vint n1 => Some (Vfloat (Float.floatofint n1)) | Ofloatofintu, Vint n1 => Some (Vfloat (Float.floatofintu n1)) | _, _ => None diff --git a/backend/Selectionproof.v b/backend/Selectionproof.v index cb9f4fc5..d997015f 100644 --- a/backend/Selectionproof.v +++ b/backend/Selectionproof.v @@ -220,8 +220,8 @@ Proof. apply eval_negf; auto. apply eval_absf; auto. apply eval_singleoffloat; auto. - apply eval_intoffloat; auto. - apply eval_intuoffloat; auto. + remember (Float.intoffloat f) as oi; destruct oi; inv H0. eapply eval_intoffloat; eauto. + remember (Float.intuoffloat f) as oi; destruct oi; inv H0. eapply eval_intuoffloat; eauto. apply eval_floatofint; auto. apply eval_floatofintu; auto. Qed. |