From 3fb4ee15ed74c55923fe702a130d77120a471ca3 Mon Sep 17 00:00:00 2001 From: xleroy Date: Sun, 2 May 2010 07:40:56 +0000 Subject: 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 --- cfrontend/Cshmgenproof2.v | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'cfrontend/Cshmgenproof2.v') 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: -- cgit