aboutsummaryrefslogtreecommitdiffstats
path: root/kvx/SelectOpproof.v
diff options
context:
space:
mode:
authorDavid Monniaux <David.Monniaux@univ-grenoble-alpes.fr>2022-02-16 09:32:24 +0100
committerDavid Monniaux <David.Monniaux@univ-grenoble-alpes.fr>2022-02-16 09:32:24 +0100
commiteaae75e487a82021cc615856b31f86bd05853b1e (patch)
tree12a7d62bafc8927e0023cc2b3b1cd170638051e3 /kvx/SelectOpproof.v
parent867b74d57fc2b834cc19176b650dc62a1e4e0fd2 (diff)
downloadcompcert-kvx-eaae75e487a82021cc615856b31f86bd05853b1e.tar.gz
compcert-kvx-eaae75e487a82021cc615856b31f86bd05853b1e.zip
builtins pour signed div/mod
Diffstat (limited to 'kvx/SelectOpproof.v')
-rw-r--r--kvx/SelectOpproof.v88
1 files changed, 88 insertions, 0 deletions
diff --git a/kvx/SelectOpproof.v b/kvx/SelectOpproof.v
index a45d367f..19393091 100644
--- a/kvx/SelectOpproof.v
+++ b/kvx/SelectOpproof.v
@@ -2046,6 +2046,94 @@ Proof.
}
inv EVAL.
constructor.
+ - cbn in *.
+ intro EVAL.
+ inv EVAL. discriminate.
+ inv H0. discriminate.
+ inv H2. 2: discriminate.
+ inv Heval.
+ intro EVAL.
+ destruct v1; try discriminate.
+ destruct v0; try discriminate.
+ unfold Int.eq in EVAL.
+ change (Int.unsigned Int.zero) with 0 in EVAL.
+ unfold zeq in EVAL.
+ destruct (Z.eq_dec (Int.unsigned i0) 0) as [EQ | NEQ].
+ { discriminate. }
+ exists (Vint (Int.divs i i0)). split.
+ {
+ apply FPDivision32.fp_divs32_correct; auto.
+ pose proof (Int.unsigned_range i0).
+ lia.
+ }
+ inv EVAL.
+ constructor.
+ - cbn in *.
+ intro EVAL.
+ inv EVAL. discriminate.
+ inv H0. discriminate.
+ inv H2. 2: discriminate.
+ inv Heval.
+ intro EVAL.
+ destruct v1; try discriminate.
+ destruct v0; try discriminate.
+ unfold Int64.eq in EVAL.
+ change (Int64.unsigned Int64.zero) with 0 in EVAL.
+ unfold zeq in EVAL.
+ destruct (Z.eq_dec (Int64.unsigned i0) 0) as [EQ | NEQ].
+ { discriminate. }
+ exists (Vlong (Int64.divs i i0)). split.
+ {
+ apply FPDivision64.fp_divs64_correct; auto.
+ pose proof (Int64.unsigned_range i0).
+ lia.
+ }
+ inv EVAL.
+ constructor.
+ - cbn in *.
+ intro EVAL.
+ inv EVAL. discriminate.
+ inv H0. discriminate.
+ inv H2. 2: discriminate.
+ inv Heval.
+ intro EVAL.
+ destruct v1; try discriminate.
+ destruct v0; try discriminate.
+ unfold Int.eq in EVAL.
+ change (Int.unsigned Int.zero) with 0 in EVAL.
+ unfold zeq in EVAL.
+ destruct (Z.eq_dec (Int.unsigned i0) 0) as [EQ | NEQ].
+ { discriminate. }
+ exists (Vint (Int.mods i i0)). split.
+ {
+ apply FPDivision32.fp_mods32_correct; auto.
+ pose proof (Int.unsigned_range i0).
+ lia.
+ }
+ inv EVAL.
+ constructor.
+ - cbn in *.
+ intro EVAL.
+ inv EVAL. discriminate.
+ inv H0. discriminate.
+ inv H2. 2: discriminate.
+ inv Heval.
+ intro EVAL.
+ destruct v1; try discriminate.
+ destruct v0; try discriminate.
+ unfold Int64.eq in EVAL.
+ change (Int64.unsigned Int64.zero) with 0 in EVAL.
+ unfold zeq in EVAL.
+ destruct (Z.eq_dec (Int64.unsigned i0) 0) as [EQ | NEQ].
+ { discriminate. }
+ exists (Vlong (Int64.mods i i0)). split.
+ {
+ apply FPDivision64.fp_mods64_correct; auto.
+ pose proof (Int64.unsigned_range i0).
+ lia.
+ }
+ inv EVAL.
+ constructor.
- apply eval_abs; assumption.
- apply eval_absl; assumption.
Qed.