aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Decidableplus.v
diff options
context:
space:
mode:
authorBernhard Schommer <bschommer@users.noreply.github.com>2017-05-03 11:18:32 +0200
committerGitHub <noreply@github.com>2017-05-03 11:18:32 +0200
commit7873af34a9520ee5a8a6f10faddf3255a4ff02b2 (patch)
tree74500c845c99b39ba91a5507656060dea60404ea /lib/Decidableplus.v
parent25ea686abc4cce13aba92196dbeb284f727b6e0e (diff)
downloadcompcert-kvx-7873af34a9520ee5a8a6f10faddf3255a4ff02b2.tar.gz
compcert-kvx-7873af34a9520ee5a8a6f10faddf3255a4ff02b2.zip
Hybrid 64bit/32bit PowerPC port
This commit adds code generation for 64bit PowerPC architectures which execute 32bit applications. The main difference to the normal 32bit PowerPC port is that it uses the available 64bit instructions instead of using the runtime library functions. However pointers are still 32bit and the 32bit calling convention is used. In order to use this port the target architecture must be either in Server execution mode or if in Embedded execution mode the high order 32 bits of GPRs must be implemented in 32-bit mode. Furthermore the operating system must preserve the high order 32 bits of GPRs.
Diffstat (limited to 'lib/Decidableplus.v')
-rw-r--r--lib/Decidableplus.v28
1 files changed, 14 insertions, 14 deletions
diff --git a/lib/Decidableplus.v b/lib/Decidableplus.v
index 3bb6eee7..6383794d 100644
--- a/lib/Decidableplus.v
+++ b/lib/Decidableplus.v
@@ -30,14 +30,14 @@ Program Instance Decidable_not (P: Prop) (dP: Decidable P) : Decidable (~ P) :=
Decidable_witness := negb (@Decidable_witness P dP)
}.
Next Obligation.
- rewrite negb_true_iff. split. apply Decidable_complete_alt. apply Decidable_sound_alt.
+ rewrite negb_true_iff. split. apply Decidable_complete_alt. apply Decidable_sound_alt.
Qed.
Program Instance Decidable_equiv (P Q: Prop) (dP: Decidable P) (dQ: Decidable Q) : Decidable (P <-> Q) := {
Decidable_witness := Bool.eqb (@Decidable_witness P dP) (@Decidable_witness Q dQ)
}.
Next Obligation.
- rewrite eqb_true_iff.
+ rewrite eqb_true_iff.
split; intros.
split; intros; eapply Decidable_sound; [rewrite <- H | rewrite H]; eapply Decidable_complete; eauto.
destruct (@Decidable_witness Q dQ) eqn:D.
@@ -65,7 +65,7 @@ Program Instance Decidable_implies (P Q: Prop) (dP: Decidable P) (dQ: Decidable
Next Obligation.
split.
- intros. rewrite Decidable_complete in H by auto. eapply Decidable_sound; eauto.
-- intros. destruct (@Decidable_witness P dP) eqn:WP; auto.
+- intros. destruct (@Decidable_witness P dP) eqn:WP; auto.
eapply Decidable_complete. apply H. eapply Decidable_sound; eauto.
Qed.
@@ -75,7 +75,7 @@ Program Definition Decidable_eq {A: Type} (eqdec: forall (x y: A), {x=y} + {x<>y
Decidable_witness := proj_sumbool (eqdec x y)
|}.
Next Obligation.
- split; intros. InvBooleans. auto. subst y. apply dec_eq_true.
+ split; intros. InvBooleans. auto. subst y. apply dec_eq_true.
Qed.
Program Instance Decidable_eq_bool : forall (x y : bool), Decidable (eq x y) := {
@@ -112,14 +112,14 @@ Program Instance Decidable_le_Z : forall (x y: Z), Decidable (x <= y) := {
Decidable_witness := Z.leb x y
}.
Next Obligation.
- apply Z.leb_le.
+ apply Z.leb_le.
Qed.
Program Instance Decidable_lt_Z : forall (x y: Z), Decidable (x < y) := {
Decidable_witness := Z.ltb x y
}.
Next Obligation.
- apply Z.ltb_lt.
+ apply Z.ltb_lt.
Qed.
Program Instance Decidable_ge_Z : forall (x y: Z), Decidable (x >= y) := {
@@ -142,8 +142,8 @@ Program Instance Decidable_divides : forall (x y: Z), Decidable (x | y) := {
Next Obligation.
split.
intros. apply Z.eqb_eq in H. exists (y / x). auto.
- intros [k EQ]. apply Z.eqb_eq.
- destruct (Z.eq_dec x 0).
+ intros [k EQ]. apply Z.eqb_eq.
+ destruct (Z.eq_dec x 0).
subst x. rewrite Z.mul_0_r in EQ. subst y. reflexivity.
assert (k = y / x).
{ apply Zdiv_unique_full with 0. red; omega. rewrite EQ; ring. }
@@ -152,7 +152,7 @@ Qed.
(** Deciding properties over lists *)
-Program Instance Decidable_forall_in_list :
+Program Instance Decidable_forall_in_list :
forall (A: Type) (l: list A) (P: A -> Prop) (dP: forall x:A, Decidable (P x)),
Decidable (forall x:A, In x l -> P x) := {
Decidable_witness := List.forallb (fun x => @Decidable_witness (P x) (dP x)) l
@@ -160,10 +160,10 @@ Program Instance Decidable_forall_in_list :
Next Obligation.
rewrite List.forallb_forall. split; intros.
- eapply Decidable_sound; eauto.
-- eapply Decidable_complete; eauto.
+- eapply Decidable_complete; eauto.
Qed.
-Program Instance Decidable_exists_in_list :
+Program Instance Decidable_exists_in_list :
forall (A: Type) (l: list A) (P: A -> Prop) (dP: forall x:A, Decidable (P x)),
Decidable (exists x:A, In x l /\ P x) := {
Decidable_witness := List.existsb (fun x => @Decidable_witness (P x) (dP x)) l
@@ -188,8 +188,8 @@ Program Instance Decidable_forall : forall (T: Type) (fT: Finite T) (P: T -> Pro
}.
Next Obligation.
rewrite List.forallb_forall. split; intros.
-- eapply Decidable_sound; eauto. apply H. apply Finite_elements_spec.
-- eapply Decidable_complete; eauto.
+- eapply Decidable_sound; eauto. apply H. apply Finite_elements_spec.
+- eapply Decidable_complete; eauto.
Qed.
Program Instance Decidable_exists : forall (T: Type) (fT: Finite T) (P: T -> Prop) (dP: forall x:T, Decidable (P x)), Decidable (exists x, P x) := {
@@ -198,7 +198,7 @@ Program Instance Decidable_exists : forall (T: Type) (fT: Finite T) (P: T -> Pro
Next Obligation.
rewrite List.existsb_exists. split.
- intros (x & A & B). exists x. eapply Decidable_sound; eauto.
-- intros (x & A). exists x; split. eapply Finite_elements_spec. eapply Decidable_complete; eauto.
+- intros (x & A). exists x; split. eapply Finite_elements_spec. eapply Decidable_complete; eauto.
Qed.
(** Some examples of finite types. *)