diff options
author | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2013-09-14 16:24:30 +0000 |
---|---|---|
committer | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2013-09-14 16:24:30 +0000 |
commit | 76ea1108be6f8b4ba9dc0118a13f685bcb62bc2b (patch) | |
tree | 8b2dad961e6b368426573e8a217594b9bcb42752 /backend/SelectDivproof.v | |
parent | 9a0ff6bb768cb0a6e45c1c75727d1cd8199cb89e (diff) | |
download | compcert-kvx-76ea1108be6f8b4ba9dc0118a13f685bcb62bc2b.tar.gz compcert-kvx-76ea1108be6f8b4ba9dc0118a13f685bcb62bc2b.zip |
Floats.v, Nan.v: hard-wire the general shape of binop_pl, so that no axioms
are necessary, only two parameters (default_pl and choose_binop_pl).
SelectDiv: optimize FP division by a power of 2.
ConstpropOp: optimize 2.0 * x and x * 2.0 into x + x.
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2326 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'backend/SelectDivproof.v')
-rw-r--r-- | backend/SelectDivproof.v | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/backend/SelectDivproof.v b/backend/SelectDivproof.v index 4d8f96ac..0719a5ed 100644 --- a/backend/SelectDivproof.v +++ b/backend/SelectDivproof.v @@ -544,4 +544,22 @@ Proof. - eapply eval_mods_base; eauto. Qed. +(** * Floating-point division *) + +Theorem eval_divf: + forall le a b x y, + eval_expr ge sp e m le a x -> + eval_expr ge sp e m le b y -> + exists v, eval_expr ge sp e m le (divf a b) v /\ Val.lessdef (Val.divf x y) v. +Proof. + intros until y. unfold divf. destruct (divf_match b); intros. +- unfold divfimm. destruct (Float.exact_inverse n2) as [n2' | ] eqn:EINV. + + inv H0. inv H4. simpl in H6. inv H6. econstructor; split. + EvalOp. constructor. eauto. constructor. EvalOp. simpl; eauto. constructor. + simpl; eauto. + destruct x; simpl; auto. erewrite Float.div_mul_inverse; eauto. + + TrivialExists. +- TrivialExists. +Qed. + End CMCONSTRS. |