aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mppa_k1c/SelectOp.vp2
-rw-r--r--mppa_k1c/SelectOpproof.v19
2 files changed, 17 insertions, 4 deletions
diff --git a/mppa_k1c/SelectOp.vp b/mppa_k1c/SelectOp.vp
index 1af0cd38..25f09e2e 100644
--- a/mppa_k1c/SelectOp.vp
+++ b/mppa_k1c/SelectOp.vp
@@ -564,7 +564,7 @@ Nondetfunction floatofintu (e: expr) :=
Nondetfunction floatofint (e: expr) :=
match e with
| Eop (Ointconst n) Enil => Eop (Ofloatconst (Float.of_int n)) Enil
- | _ => Eop Ofloatofint (e ::: Enil)
+ | _ => Eop Ofloatoflong ((Eop Ocast32signed (e ::: Enil)) ::: Enil)
end.
Definition intofsingle (e: expr) := Eop Ointofsingle (e ::: Enil).
diff --git a/mppa_k1c/SelectOpproof.v b/mppa_k1c/SelectOpproof.v
index e07bc51c..6fa93fd8 100644
--- a/mppa_k1c/SelectOpproof.v
+++ b/mppa_k1c/SelectOpproof.v
@@ -1180,9 +1180,22 @@ Theorem eval_floatofint:
Val.floatofint x = Some y ->
exists v, eval_expr ge sp e m le (floatofint a) v /\ Val.lessdef y v.
Proof.
- intros until y; unfold floatofint. case (floatofint_match a); intros.
- InvEval. simpl in H0. TrivialExists.
- TrivialExists.
+ intros.
+ unfold floatofint.
+ destruct (floatofint_match a).
+ - InvEval.
+ TrivialExists.
+ - InvEval.
+ TrivialExists.
+ constructor. econstructor. constructor. eassumption. constructor.
+ simpl. f_equal. constructor.
+ simpl.
+ destruct x; simpl; trivial.
+ f_equal.
+ inv H0.
+ f_equal.
+ rewrite Float.of_int_of_long.
+ reflexivity.
Qed.
Theorem eval_intofsingle: