diff options
author | Cyril SIX <cyril.six@kalray.eu> | 2019-10-03 17:09:03 +0200 |
---|---|---|
committer | Cyril SIX <cyril.six@kalray.eu> | 2019-10-03 17:09:03 +0200 |
commit | 79d48fa72a3ac0cd2b84dc8c70eb9170088e0353 (patch) | |
tree | 44f3acebcf48ffdda76bb55b41aed5be528bf429 /backend | |
parent | 6e159e4c2e0978116522f3b6f42a7cbe6b204fe4 (diff) | |
download | compcert-kvx-79d48fa72a3ac0cd2b84dc8c70eb9170088e0353.tar.gz compcert-kvx-79d48fa72a3ac0cd2b84dc8c70eb9170088e0353.zip |
Icall
Diffstat (limited to 'backend')
-rw-r--r-- | backend/Duplicate.v | 19 | ||||
-rw-r--r-- | backend/Duplicateproof.v | 8 |
2 files changed, 27 insertions, 0 deletions
diff --git a/backend/Duplicate.v b/backend/Duplicate.v index 465b1538..a5e7d92a 100644 --- a/backend/Duplicate.v +++ b/backend/Duplicate.v @@ -45,6 +45,13 @@ Definition verify_is_copy revmap n n' := | Some revn => match (Pos.compare n revn) with Eq => OK tt | _ => Error(msg "verify_is_copy invalid map") end end. +Lemma product_eq {A B: Type} : + (forall (a b: A), {a=b} + {a<>b}) -> + (forall (c d: B), {c=d} + {c<>d}) -> + forall (x y: A+B), {x=y} + {x<>y}. +Proof. + intros H H'. intros. decide equality. +Qed. Definition verify_match_inst revmap inst tinst := match inst with @@ -84,6 +91,18 @@ Definition verify_match_inst revmap inst tinst := else Error (msg "Different addressing in Istore") else Error (msg "Different mchunk in Istore") | _ => Error (msg "verify_match_inst Istore") end + | Icall s ri lr r n => match tinst with + | Icall s' ri' lr' r' n' => + do u <- verify_is_copy revmap n n'; + if (signature_eq s s') then + if (product_eq Pos.eq_dec ident_eq ri ri') then + if (list_eq_dec Pos.eq_dec lr lr') then + if (Pos.eq_dec r r') then OK tt + else Error (msg "Different r r' in Icall") + else Error (msg "Different lr in Icall") + else Error (msg "Different ri in Icall") + else Error (msg "Different signatures in Icall") + | _ => Error (msg "verify_match_inst Icall") end | _ => Error(msg "not implemented") end. diff --git a/backend/Duplicateproof.v b/backend/Duplicateproof.v index c2bdf10d..e9799f08 100644 --- a/backend/Duplicateproof.v +++ b/backend/Duplicateproof.v @@ -106,6 +106,14 @@ Proof. destruct (Pos.eq_dec _ _); try discriminate. clear EQ0. subst. eapply verify_is_copy_correct_one. destruct x. eassumption. constructor. +(* Icall *) + - destruct i'; try (inversion H; fail). monadInv H. + destruct (signature_eq _ _); try discriminate. + destruct (product_eq _ _ _ _); try discriminate. + destruct (list_eq_dec _ _ _); try discriminate. + destruct (Pos.eq_dec _ _); try discriminate. + eapply verify_is_copy_correct_one. destruct x. eassumption. subst. + constructor. Qed. Lemma verify_mapping_mn_correct: |