aboutsummaryrefslogtreecommitdiffstats
path: root/backend/Duplicate.v
diff options
context:
space:
mode:
authorCyril SIX <cyril.six@kalray.eu>2019-10-03 17:09:03 +0200
committerCyril SIX <cyril.six@kalray.eu>2019-10-03 17:09:03 +0200
commit79d48fa72a3ac0cd2b84dc8c70eb9170088e0353 (patch)
tree44f3acebcf48ffdda76bb55b41aed5be528bf429 /backend/Duplicate.v
parent6e159e4c2e0978116522f3b6f42a7cbe6b204fe4 (diff)
downloadcompcert-kvx-79d48fa72a3ac0cd2b84dc8c70eb9170088e0353.tar.gz
compcert-kvx-79d48fa72a3ac0cd2b84dc8c70eb9170088e0353.zip
Icall
Diffstat (limited to 'backend/Duplicate.v')
-rw-r--r--backend/Duplicate.v19
1 files changed, 19 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.