summaryrefslogtreecommitdiff
path: root/ia32/Op.v
diff options
context:
space:
mode:
authorGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2010-10-28 14:56:39 +0000
committerGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2010-10-28 14:56:39 +0000
commit14a9bb4b267eeead8cd9503ee19e860a8bc0d763 (patch)
treec70dda532a974a7b62969c6b199b80d65784dc91 /ia32/Op.v
parentb54721f58c2ecb65ce554d8b34f214d5121a2b0c (diff)
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 'ia32/Op.v')
-rw-r--r--ia32/Op.v5
1 files changed, 4 insertions, 1 deletions
diff --git a/ia32/Op.v b/ia32/Op.v
index ea28845..c09dc5b 100644
--- a/ia32/Op.v
+++ b/ia32/Op.v
@@ -285,7 +285,7 @@ Definition eval_operation
| Osingleoffloat, v1 :: nil =>
Some (Val.singleoffloat v1)
| Ointoffloat, Vfloat f1 :: nil =>
- Some (Vint (Float.intoffloat f1))
+ option_map Vint (Float.intoffloat f1)
| Ofloatofint, Vint n1 :: nil =>
Some (Vfloat (Float.floatofint n1))
| Ocmp c, _ =>
@@ -547,6 +547,7 @@ Proof.
injection H0; intro; subst v; exact I. discriminate.
simpl. eapply type_of_addressing_sound; eauto.
destruct v0; exact I.
+ destruct (Float.intoffloat f); simpl in H0; inv H0. exact I.
destruct (eval_condition c vl).
destruct b; injection H0; intro; subst v; exact I.
discriminate.
@@ -727,6 +728,7 @@ Proof.
destruct (Int.ltu i Int.iwordsize); congruence.
destruct (Int.ltu i Int.iwordsize); congruence.
apply eval_addressing_weaken; auto.
+ destruct (Float.intoffloat f); simpl in H; inv H. auto.
caseEq (eval_condition c vl); intros; rewrite H0 in H.
replace v with (Val.of_bool b).
eapply eval_condition_weaken; eauto.
@@ -832,6 +834,7 @@ Proof.
destruct (Int.ltu i Int.iwordsize); inv H0; TrivialExists.
eapply eval_addressing_lessdef; eauto.
exists (Val.singleoffloat v2); split. auto. apply Val.singleoffloat_lessdef; auto.
+ exists v1; split; auto.
caseEq (eval_condition c vl1); intros. rewrite H1 in H0.
rewrite (eval_condition_lessdef c H H1).
destruct b; inv H0; TrivialExists.