diff options
author | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2012-07-03 11:20:51 +0000 |
---|---|---|
committer | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2012-07-03 11:20:51 +0000 |
commit | d566064714fcf048cbec5f3a1cbe89885c9bc293 (patch) | |
tree | 734bac97f2f87a79113fdd461740a05eba1bcb27 /arm | |
parent | c677d5021a9a6e057b15cf9df8ca9ce7c0f5ae30 (diff) |
Update CombineOp for arm and ia32.
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1950 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'arm')
-rw-r--r-- | arm/CombineOp.v | 6 | ||||
-rw-r--r-- | arm/CombineOpproof.v | 8 |
2 files changed, 12 insertions, 2 deletions
diff --git a/arm/CombineOp.v b/arm/CombineOp.v index d153b73..be9824b 100644 --- a/arm/CombineOp.v +++ b/arm/CombineOp.v @@ -41,6 +41,12 @@ Function combine_compimm_eq_0 (x: valnum) : option(condition * list valnum) := | _ => None end. +Function combine_compimm_eq_1 (x: valnum) : option(condition * list valnum) := + match get x with + | Some(Op (Ocmp c) ys) => Some (c, ys) + | _ => None + end. + Function combine_compimm_ne_1 (x: valnum) : option(condition * list valnum) := match get x with | Some(Op (Ocmp c) ys) => Some (negate_condition c, ys) diff --git a/arm/CombineOpproof.v b/arm/CombineOpproof.v index 0d2e6dd..e7080f4 100644 --- a/arm/CombineOpproof.v +++ b/arm/CombineOpproof.v @@ -76,11 +76,11 @@ Lemma combine_compimm_ne_1_sound: eval_condition cond (map valu args) m = Val.cmp_bool Cne (valu x) (Vint Int.one) /\ eval_condition cond (map valu args) m = Val.cmpu_bool (Mem.valid_pointer m) Cne (valu x) (Vint Int.one). Proof. - intros until args. functional induction (combine_compimm_eq_1 get x); intros EQ; inv EQ. + intros until args. functional induction (combine_compimm_ne_1 get x); intros EQ; inv EQ. (* of cmp *) exploit get_sound; eauto. unfold equation_holds. simpl. intro EQ; inv EQ. rewrite eval_negate_condition. - destruct (eval_condition cond (map valu args) m); simpl; auto. destruct b; auto. + destruct (eval_condition c (map valu args) m); simpl; auto. destruct b; auto. Qed. Theorem combine_cond_sound: @@ -91,12 +91,16 @@ Proof. intros. functional inversion H; subst. (* compimm ne zero *) simpl; eapply combine_compimm_ne_0_sound; eauto. + (* compimm ne one *) + simpl; eapply combine_compimm_ne_1_sound; eauto. (* compimm eq zero *) simpl; eapply combine_compimm_eq_0_sound; eauto. (* compimm eq one *) simpl; eapply combine_compimm_eq_1_sound; eauto. (* compuimm ne zero *) simpl; eapply combine_compimm_ne_0_sound; eauto. + (* compuimm ne one *) + simpl; eapply combine_compimm_ne_1_sound; eauto. (* compuimm eq zero *) simpl; eapply combine_compimm_eq_0_sound; eauto. (* compuimm eq one *) |