aboutsummaryrefslogtreecommitdiffstats
path: root/mppa_k1c/SelectLongproof.v
diff options
context:
space:
mode:
Diffstat (limited to 'mppa_k1c/SelectLongproof.v')
-rw-r--r--mppa_k1c/SelectLongproof.v104
1 files changed, 104 insertions, 0 deletions
diff --git a/mppa_k1c/SelectLongproof.v b/mppa_k1c/SelectLongproof.v
index 51b989d6..3fab35b3 100644
--- a/mppa_k1c/SelectLongproof.v
+++ b/mppa_k1c/SelectLongproof.v
@@ -390,6 +390,15 @@ Proof.
- TrivialExists.
Qed.
+Lemma int64_eq_commut: forall x y : int64,
+ (Int64.eq x y) = (Int64.eq y x).
+Proof.
+ intros.
+ predSpec Int64.eq Int64.eq_spec x y;
+ predSpec Int64.eq Int64.eq_spec y x;
+ congruence.
+Qed.
+
Theorem eval_andl: binary_constructor_sound andl Val.andl.
Proof.
unfold andl; destruct Archi.splitlong. apply SplitLongproof.eval_andl.
@@ -398,6 +407,25 @@ Proof.
- InvEval. apply eval_andlimm; auto.
- (*andn*) InvEval. TrivialExists. simpl. congruence.
- (*andn reverse*) InvEval. rewrite Val.andl_commut. TrivialExists; simpl. congruence.
+ (*
+- (* selectl *)
+ InvEval.
+ predSpec Int64.eq Int64.eq_spec zero1 Int64.zero; simpl; TrivialExists.
+ + constructor. econstructor; constructor.
+ constructor; try constructor; try constructor; try eassumption.
+ + simpl in *. f_equal. inv H6.
+ unfold selectl.
+ simpl.
+ destruct v3; simpl; trivial.
+ rewrite int64_eq_commut.
+ destruct (Int64.eq i Int64.zero); simpl.
+ * replace (Int64.repr (Int.signed (Int.neg Int.zero))) with Int64.zero by Int64.bit_solve.
+ destruct y; simpl; trivial.
+ * replace (Int64.repr (Int.signed (Int.neg Int.one))) with Int64.mone by Int64.bit_solve.
+ destruct y; simpl; trivial.
+ rewrite Int64.and_commut. rewrite Int64.and_mone. reflexivity.
+ + constructor. econstructor. constructor. econstructor. constructor. econstructor. constructor. eassumption. constructor. simpl. f_equal. constructor. simpl. f_equal. constructor. simpl. f_equal. constructor. eassumption. constructor.
+ + simpl in *. congruence. *)
- TrivialExists.
Qed.
@@ -414,6 +442,7 @@ Proof.
- TrivialExists.
Qed.
+
Theorem eval_orl: binary_constructor_sound orl Val.orl.
Proof.
unfold orl; destruct Archi.splitlong. apply SplitLongproof.eval_orl.
@@ -423,6 +452,81 @@ Proof.
- InvEval. apply eval_orlimm; auto.
- (*orn*) InvEval. TrivialExists; simpl; congruence.
- (*orn reversed*) InvEval. rewrite Val.orl_commut. TrivialExists; simpl; congruence.
+ - (* selectl *)
+ destruct (same_expr_pure y0 y1) eqn:PURE; simpl; try TrivialExists.
+ predSpec Int64.eq Int64.eq_spec zero0 Int64.zero; simpl; try TrivialExists.
+ predSpec Int64.eq Int64.eq_spec zero1 Int64.zero; simpl; [ | TrivialExists].
+ inv H.
+ inv H0.
+ inv H6.
+ inv H3.
+ inv H2.
+ inv H7.
+ inv H4.
+ inv H3.
+ inv H6.
+ inv H4.
+ inv H3.
+ inv H14.
+ inv H13.
+ inv H6.
+ inv H4.
+ inv H13.
+ inv H14.
+ inv H9.
+ inv H11.
+ inv H13.
+ inv H3.
+ inv H6.
+ inv H7.
+ inv H3.
+ inv H14.
+ inv H17.
+ simpl in *.
+ inv H8.
+ inv H5.
+ inv H10.
+ inv H12.
+ inv H15.
+ inv H16.
+ inv H11.
+ inv H13.
+ unfold same_expr_pure in PURE.
+ destruct y0; try congruence.
+ destruct y1; try congruence.
+ destruct (ident_eq i i0); try congruence; clear PURE.
+ rewrite <- e0 in *; clear e0.
+ inv H6.
+ inv H7.
+ rename v10 into vtest.
+ replace v11 with vtest in * by congruence.
+ TrivialExists.
+ simpl.
+ f_equal.
+ rewrite eval_selectl_to2.
+ unfold eval_selectl2.
+ destruct vtest; simpl; trivial.
+ rewrite Val.andl_commut.
+ destruct v4; simpl; trivial.
+ rewrite Val.andl_commut.
+ rewrite Val.orl_commut.
+ destruct v9; simpl; trivial.
+ rewrite int64_eq_commut.
+ destruct (Int64.eq Int64.zero i1); simpl.
+
+ + replace (Int64.repr (Int.signed (Int.neg Int.one))) with Int64.mone by Int64.bit_solve.
+ replace (Int64.repr (Int.signed (Int.neg Int.zero))) with Int64.zero by Int64.bit_solve.
+ rewrite Int64.and_mone.
+ rewrite Int64.and_zero.
+ rewrite Int64.or_commut.
+ rewrite Int64.or_zero.
+ reflexivity.
+ + replace (Int64.repr (Int.signed (Int.neg Int.one))) with Int64.mone by Int64.bit_solve.
+ replace (Int64.repr (Int.signed (Int.neg Int.zero))) with Int64.zero by Int64.bit_solve.
+ rewrite Int64.and_mone.
+ rewrite Int64.and_zero.
+ rewrite Int64.or_zero.
+ reflexivity.
- TrivialExists.
Qed.