summaryrefslogtreecommitdiff
path: root/aarch64
diff options
context:
space:
mode:
authorBrian Campbell2018-09-24 17:33:06 +0100
committerBrian Campbell2018-09-24 17:33:34 +0100
commit738ea556ab030fad03577907ff46f2ba1a54dcb3 (patch)
treec02da8164db41715dde3dd64a91e84e3f9249b8e /aarch64
parent14fe1cea79e9c846b708a5e81b15faed96a6497d (diff)
Coq: more constraint solutions for aarch64
Diffstat (limited to 'aarch64')
-rw-r--r--aarch64/aarch64_extras.v30
1 files changed, 30 insertions, 0 deletions
diff --git a/aarch64/aarch64_extras.v b/aarch64/aarch64_extras.v
index 0bc2c96f..e095f4a2 100644
--- a/aarch64/aarch64_extras.v
+++ b/aarch64/aarch64_extras.v
@@ -184,3 +184,33 @@ apply Z.mul_nonneg_nonneg; auto.
Qed.
Hint Resolve vector_single_nowb_lemma : sail.
+Lemma vector_single_nowb_lemma2 {x esize} : 8 * x = esize -> 8 * (Z.quot esize 8) = esize.
+intro H.
+rewrite <- H.
+rewrite (Z.mul_comm 8 x).
+rewrite Z.quot_mul; auto with zarith.
+Qed.
+Hint Resolve vector_single_nowb_lemma2 : sail.
+
+Lemma simdfp_register_lemma {datasize x0} :
+ 8 = datasize \/ 16 = datasize \/ 32 = datasize \/ 64 = datasize \/ 128 = datasize \/ False ->
+ x0 = datasize ÷ 8 ->
+ 64 >= 0 /\ 8 * x0 >= 0.
+intros.
+split.
+* omega.
+* apply Z.le_ge.
+ apply Z.mul_nonneg_nonneg; auto with zarith.
+ subst.
+ apply Z.quot_pos; omega.
+Qed.
+Hint Resolve simdfp_register_lemma : sail.
+
+Lemma simdfp_register_lemma2 {datasize x0} :
+ 8 = datasize \/ 16 = datasize \/ 32 = datasize \/ 64 = datasize \/ 128 = datasize \/ False ->
+ x0 = datasize ÷ 8 ->
+ datasize = 8 * x0.
+intros [H|[H|[H|[H|[H|[]]]]]] H'; subst;
+reflexivity.
+Qed.
+Hint Resolve simdfp_register_lemma2 : sail.