diff options
author | Léo Gourdin <leo.gourdin@univ-grenoble-alpes.fr> | 2021-03-02 10:29:23 +0100 |
---|---|---|
committer | Léo Gourdin <leo.gourdin@univ-grenoble-alpes.fr> | 2021-03-02 10:29:23 +0100 |
commit | be4dcbd9fcd3c859a0fae7a37cd226493a8abefb (patch) | |
tree | 3d69513c3f082e7db01bd9ade327c0ebc8a2f441 /common | |
parent | fd1a0395e540ee9fcd91d8f09161b34a22d9c51e (diff) | |
parent | a9763cd4327e12316d62e80648122f122581cca4 (diff) | |
download | compcert-kvx-be4dcbd9fcd3c859a0fae7a37cd226493a8abefb.tar.gz compcert-kvx-be4dcbd9fcd3c859a0fae7a37cd226493a8abefb.zip |
Merge remote-tracking branch 'origin/riscV-cmov' into riscv-work
Diffstat (limited to 'common')
-rw-r--r-- | common/Values.v | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/common/Values.v b/common/Values.v index 4146dd59..5d32e54e 100644 --- a/common/Values.v +++ b/common/Values.v @@ -89,6 +89,27 @@ Definition has_type (v: val) (t: typ) : Prop := | _, _ => False end. +Definition has_type_b (v: val) (t: typ) := + match v, t with + | Vundef, _ => true + | Vint _, Tint => true + | Vlong _, Tlong => true + | Vfloat _, Tfloat => true + | Vsingle _, Tsingle => true + | Vptr _ _, Tint => negb Archi.ptr64 + | Vptr _ _, Tlong => Archi.ptr64 + | (Vint _ | Vsingle _), Tany32 => true + | Vptr _ _, Tany32 => negb Archi.ptr64 + | _, Tany64 => true + | _, _ => false + end. + +Lemma has_type_b_correct: forall v t, + has_type_b v t = true <-> has_type v t. +Proof. + destruct v; destruct t; cbn; destruct Archi.ptr64; cbn; split; intros; auto; discriminate. +Qed. + Fixpoint has_type_list (vl: list val) (tl: list typ) {struct vl} : Prop := match vl, tl with | nil, nil => True |