diff options
author | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2019-05-13 14:02:23 +0200 |
---|---|---|
committer | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2019-05-13 14:02:23 +0200 |
commit | 5e53b6e6447b22eb34e5be1bc45320ca4e3d82a1 (patch) | |
tree | 46cd387020eb3af3c65d8bd8d0b73af3e47feaaf /mppa_k1c | |
parent | c1b36f701c8c3968bb5fad86c94dd5ccfa81e3e5 (diff) | |
download | compcert-kvx-5e53b6e6447b22eb34e5be1bc45320ca4e3d82a1.tar.gz compcert-kvx-5e53b6e6447b22eb34e5be1bc45320ca4e3d82a1.zip |
we directly call 64-bit unsigned division
Diffstat (limited to 'mppa_k1c')
-rw-r--r-- | mppa_k1c/ExtValues.v | 2 | ||||
-rw-r--r-- | mppa_k1c/SelectOp.vp | 6 | ||||
-rw-r--r-- | mppa_k1c/SelectOpproof.v | 20 |
3 files changed, 24 insertions, 4 deletions
diff --git a/mppa_k1c/ExtValues.v b/mppa_k1c/ExtValues.v index 8e00dc99..3529a36f 100644 --- a/mppa_k1c/ExtValues.v +++ b/mppa_k1c/ExtValues.v @@ -180,4 +180,4 @@ Proof. { apply Z_div_pos; omega. } pose proof modulus_fits_64. omega. -Qed.
\ No newline at end of file +Qed. diff --git a/mppa_k1c/SelectOp.vp b/mppa_k1c/SelectOp.vp index 6adcebe5..c4b01d89 100644 --- a/mppa_k1c/SelectOp.vp +++ b/mppa_k1c/SelectOp.vp @@ -423,7 +423,11 @@ Definition mods_base (e1: expr) (e2: expr) := Eexternal i32_smod sig_ii_i (e1 ::: e2 ::: Enil). Definition divu_base (e1: expr) (e2: expr) := - Eexternal i32_udiv sig_ii_i (e1 ::: e2 ::: Enil). + Eop Olowlong + ((Eexternal i64_udiv sig_ll_l + ((Eop Ocast32unsigned (e1 ::: Enil))::: + (Eop Ocast32unsigned (e2 ::: Enil))::: Enil)) + :::Enil). Definition modu_base (e1: expr) (e2: expr) := Eexternal i32_umod sig_ii_i (e1 ::: e2 ::: Enil). diff --git a/mppa_k1c/SelectOpproof.v b/mppa_k1c/SelectOpproof.v index 9e2eec8b..2730ee91 100644 --- a/mppa_k1c/SelectOpproof.v +++ b/mppa_k1c/SelectOpproof.v @@ -872,8 +872,24 @@ Theorem eval_divu_base: Val.divu x y = Some z -> exists v, eval_expr ge sp e m le (divu_base a b) v /\ Val.lessdef z v. Proof. - intros; unfold divu_base. - econstructor; split. eapply eval_helper_2; eauto. DeclHelper. UseHelper. auto. + intros until z. + intros Hax Hby Hdiv. unfold divu_base. + pose proof (divu_is_divlu x y) as DIVU. + destruct (Val.divlu (Val.longofintu x) (Val.longofintu y)) + as [ ql | ] eqn:Ediv. + { TrivialExists. + { econstructor. eapply eval_helper_2; eauto. + { econstructor. econstructor. eassumption. + constructor. simpl. reflexivity. } + { econstructor. econstructor. eassumption. + constructor. simpl. reflexivity. } + { DeclHelper. } + { UseHelper. } + constructor. } + simpl. + congruence. + } + congruence. Qed. Theorem eval_modu_base: |