diff options
author | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2010-05-02 07:40:56 +0000 |
---|---|---|
committer | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2010-05-02 07:40:56 +0000 |
commit | 3fb4ee15ed74c55923fe702a130d77120a471ca3 (patch) | |
tree | d315dcd8e4338ee2dbc8643473021b6e38fb51c9 /cfrontend/Cshmgenproof2.v | |
parent | 551b52e3b0ddc7a06358f1246b448664a59c86b4 (diff) | |
download | compcert-3fb4ee15ed74c55923fe702a130d77120a471ca3.tar.gz compcert-3fb4ee15ed74c55923fe702a130d77120a471ca3.zip |
Add "fabs" (floating-point absolute value) as a unary operator in
Clight and C#minor. Recognize __builtin_fabs and turn it into this operator.
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1329 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'cfrontend/Cshmgenproof2.v')
-rw-r--r-- | cfrontend/Cshmgenproof2.v | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/cfrontend/Cshmgenproof2.v b/cfrontend/Cshmgenproof2.v index 769aee7f..3f0f4b3e 100644 --- a/cfrontend/Cshmgenproof2.v +++ b/cfrontend/Cshmgenproof2.v @@ -142,6 +142,18 @@ Proof. inversion H2; eauto with cshm. Qed. +Lemma make_fabs_correct: + forall a tya c va v e m, + sem_fabs va = Some v -> + make_fabs a tya = c -> + eval_expr globenv e m a va -> + eval_expr globenv e m c v. +Proof. + intros until m; intro SEM. unfold make_fabs. + functional inversion SEM; intros. + inversion H2; eauto with cshm. +Qed. + Definition binary_constructor_correct (make: expr -> type -> expr -> type -> res expr) (sem: val -> type -> val -> type -> option val): Prop := @@ -298,6 +310,7 @@ Proof. eapply make_notbool_correct; eauto. congruence. eapply make_notint_correct with (tya := tya); eauto. congruence. eapply make_neg_correct; eauto. + eapply make_fabs_correct with (tya := tya); eauto. congruence. Qed. Lemma transl_binop_correct: |