aboutsummaryrefslogtreecommitdiffstats
path: root/mppa_k1c/Asmblockgenproof1.v
diff options
context:
space:
mode:
authorDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-06-04 11:25:11 +0200
committerDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-06-04 11:25:11 +0200
commiteec7948bd0204787ad8ddde70c5a28fdfd62356a (patch)
tree4767ce4339d74366693e0428e0d56d22e4df19fe /mppa_k1c/Asmblockgenproof1.v
parent30f549e4e04567e35fb6a4eda269132f6cd22dd1 (diff)
downloadcompcert-kvx-eec7948bd0204787ad8ddde70c5a28fdfd62356a.tar.gz
compcert-kvx-eec7948bd0204787ad8ddde70c5a28fdfd62356a.zip
Osel -> assembleur
Diffstat (limited to 'mppa_k1c/Asmblockgenproof1.v')
-rw-r--r--mppa_k1c/Asmblockgenproof1.v57
1 files changed, 57 insertions, 0 deletions
diff --git a/mppa_k1c/Asmblockgenproof1.v b/mppa_k1c/Asmblockgenproof1.v
index 8125741b..86e640c9 100644
--- a/mppa_k1c/Asmblockgenproof1.v
+++ b/mppa_k1c/Asmblockgenproof1.v
@@ -1649,6 +1649,25 @@ Proof.
destruct (Z.eq_dec _ _); destruct (Z.eq_dec _ _); congruence.
Qed.
+Lemma select_same_lessdef:
+ forall ty c v,
+ Val.lessdef (Val.select c v v ty) v.
+Proof.
+ intros.
+ unfold Val.select.
+ destruct c; try econstructor.
+ replace (if b then v else v) with v by (destruct b ; trivial).
+ destruct v; destruct ty; simpl; econstructor.
+Qed.
+
+Lemma if_neg : forall X,
+ forall a,
+ forall b c : X,
+ (if (negb a) then b else c) = (if a then c else b).
+Proof.
+ destruct a; reflexivity.
+Qed.
+
Lemma transl_op_correct:
forall op args res k (rs: regset) m v c,
transl_op op args res k = OK c ->
@@ -1719,6 +1738,44 @@ Opaque Int.eq.
- (* Ocmp *)
exploit transl_cond_op_correct; eauto. intros (rs' & A & B & C).
exists rs'; split. eexact A. eauto with asmgen.
+- (* Osel *)
+ unfold conditional_move in *.
+ destruct (ireg_eq _ _).
+ {
+ subst x. inv EQ2.
+ econstructor; split.
+ {
+ apply exec_straight_one.
+ simpl. reflexivity.
+ }
+ split.
+ { apply select_same_lessdef. }
+ intros; trivial.
+ }
+
+ destruct c0; simpl in *.
+ 1, 2, 3:
+ destruct c; simpl in *; inv EQ2;
+ econstructor; split; try (apply exec_straight_one; constructor);
+ split; try (simpl; intros; rewrite Pregmap.gso; trivial; assumption);
+ unfold Val.select; simpl;
+ rewrite Pregmap.gss;
+ destruct (rs x1); simpl; trivial;
+ rewrite if_neg;
+ apply Val.lessdef_normalize.
+
+ destruct c; simpl in *; inv EQ2;
+ econstructor; split; try (apply exec_straight_one; constructor);
+ split; try (simpl; intros; rewrite Pregmap.gso; trivial; assumption);
+ unfold Val.select; simpl;
+ rewrite Pregmap.gss;
+ destruct (rs x1); simpl; trivial;
+ rewrite if_neg;
+ try apply Val.lessdef_normalize;
+
+ destruct Archi.ptr64; simpl; replace (Int64.eq Int64.zero Int64.zero) with true by reflexivity; simpl; trivial;
+ destruct (_ || _); trivial;
+ apply Val.lessdef_normalize.
Qed.
(** Memory accesses *)