aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-04-12 13:27:38 +0200
committerDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-04-12 13:27:38 +0200
commit819e0e55f945923adc6e8cfccb2e7a9b44a814ac (patch)
treebf914fb5bb94f601f6902d74ddab902fa6ce135c
parent64d7dab2720d63e1b40ae893d76895a23c11e2d1 (diff)
downloadcompcert-kvx-819e0e55f945923adc6e8cfccb2e7a9b44a814ac.tar.gz
compcert-kvx-819e0e55f945923adc6e8cfccb2e7a9b44a814ac.zip
some simplifications (long)
-rw-r--r--mppa_k1c/SelectLong.vp12
-rw-r--r--mppa_k1c/SelectLongproof.v46
2 files changed, 58 insertions, 0 deletions
diff --git a/mppa_k1c/SelectLong.vp b/mppa_k1c/SelectLong.vp
index 6389bca2..ed2006b0 100644
--- a/mppa_k1c/SelectLong.vp
+++ b/mppa_k1c/SelectLong.vp
@@ -331,6 +331,18 @@ Nondetfunction notl (e: expr) :=
| Eop (Oorlimm n) (e1:::Enil) => Eop (Onorlimm n) (e1:::Enil)
| Eop Oxorl (e1:::e2:::Enil) => Eop Onxorl (e1:::e2:::Enil)
| Eop (Oxorlimm n) (e1:::Enil) => Eop (Onxorlimm n) (e1:::Enil)
+ | Eop Onandl (e1:::e2:::Enil) => Eop Oandl (e1:::e2:::Enil)
+ | Eop (Onandlimm n) (e1:::Enil) => Eop (Oandlimm n) (e1:::Enil)
+ | Eop Onorl (e1:::e2:::Enil) => Eop Oorl (e1:::e2:::Enil)
+ | Eop (Onorlimm n) (e1:::Enil) => Eop (Oorlimm n) (e1:::Enil)
+ | Eop Onxorl (e1:::e2:::Enil) => Eop Oxorl (e1:::e2:::Enil)
+ | Eop (Onxorlimm n) (e1:::Enil) => Eop (Oxorlimm n) (e1:::Enil)
+ | Eop Oandnl (e1:::e2:::Enil) => Eop Oornl (e2:::e1:::Enil)
+ | Eop (Oandnlimm n) (e1:::Enil) => Eop (Oorlimm (Int64.not n)) (e1:::Enil)
+ | Eop Oornl (e1:::e2:::Enil) => Eop Oandnl (e2:::e1:::Enil)
+ | Eop (Oornlimm n) (e1:::Enil) => Eop (Oandlimm (Int64.not n)) (e1:::Enil)
+ | Eop Onotl (e1:::Enil) => e1
+ | Eop (Olongconst k) Enil => Eop (Olongconst (Int64.not k)) Enil
| _ => Eop Onotl (e:::Enil)
end.
(* old: if Archi.splitlong then SplitLong.notl e else xorlimm Int64.mone e. *)
diff --git a/mppa_k1c/SelectLongproof.v b/mppa_k1c/SelectLongproof.v
index d4893eb8..0700ac4d 100644
--- a/mppa_k1c/SelectLongproof.v
+++ b/mppa_k1c/SelectLongproof.v
@@ -566,6 +566,52 @@ Proof.
- TrivialExists; simpl; congruence.
- TrivialExists; simpl; congruence.
- TrivialExists; simpl; congruence.
+ - subst x. exists (Val.andl v1 v0); split; trivial.
+ econstructor. constructor. eassumption. constructor.
+ eassumption. constructor. simpl. reflexivity.
+ - subst x. exists (Val.andl v1 (Vlong n)); split; trivial.
+ econstructor. constructor. eassumption. constructor.
+ simpl. reflexivity.
+ - subst x. exists (Val.orl v1 v0); split; trivial.
+ econstructor. constructor. eassumption. constructor.
+ eassumption. constructor. simpl. reflexivity.
+ - subst x. exists (Val.orl v1 (Vlong n)); split; trivial.
+ econstructor. constructor. eassumption. constructor.
+ simpl. reflexivity.
+ - subst x. exists (Val.xorl v1 v0); split; trivial.
+ econstructor. constructor. eassumption. constructor.
+ eassumption. constructor. simpl. reflexivity.
+ - subst x. exists (Val.xorl v1 (Vlong n)); split; trivial.
+ econstructor. constructor. eassumption. constructor.
+ simpl. reflexivity.
+ (* andn *)
+ - subst x. TrivialExists. simpl.
+ destruct v0; destruct v1; simpl; trivial.
+ f_equal. f_equal.
+ rewrite Int64.not_and_or_not.
+ rewrite Int64.not_involutive.
+ apply Int64.or_commut.
+ - subst x. TrivialExists. simpl.
+ destruct v1; simpl; trivial.
+ f_equal. f_equal.
+ rewrite Int64.not_and_or_not.
+ rewrite Int64.not_involutive.
+ reflexivity.
+ (* orn *)
+ - subst x. TrivialExists. simpl.
+ destruct v0; destruct v1; simpl; trivial.
+ f_equal. f_equal.
+ rewrite Int64.not_or_and_not.
+ rewrite Int64.not_involutive.
+ apply Int64.and_commut.
+ - subst x. TrivialExists. simpl.
+ destruct v1; simpl; trivial.
+ f_equal. f_equal.
+ rewrite Int64.not_or_and_not.
+ rewrite Int64.not_involutive.
+ reflexivity.
+ - subst x. exists v1; split; trivial.
+ - TrivialExists.
- TrivialExists.
Qed.