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/Cshmgen.v | |
parent | 551b52e3b0ddc7a06358f1246b448664a59c86b4 (diff) | |
download | compcert-kvx-3fb4ee15ed74c55923fe702a130d77120a471ca3.tar.gz compcert-kvx-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/Cshmgen.v')
-rw-r--r-- | cfrontend/Cshmgen.v | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/cfrontend/Cshmgen.v b/cfrontend/Cshmgen.v index 548c8df8..cc81d0f4 100644 --- a/cfrontend/Cshmgen.v +++ b/cfrontend/Cshmgen.v @@ -120,6 +120,9 @@ Definition make_notbool (e: expr) (ty: type) := Definition make_notint (e: expr) (ty: type) := Eunop Onotint e. +Definition make_fabs (e: expr) (ty: type) := + Eunop Oabsf e. + Definition make_add (e1: expr) (ty1: type) (e2: expr) (ty2: type) := match classify_add ty1 ty2 with | add_case_ii => OK (Ebinop Oadd e1 e2) @@ -317,6 +320,7 @@ Definition transl_unop (op: Csyntax.unary_operation) (a: expr) (ta: type) : res | Csyntax.Onotbool => OK(make_notbool a ta) | Csyntax.Onotint => OK(make_notint a ta) | Csyntax.Oneg => make_neg a ta + | Csyntax.Ofabs => OK(make_fabs a ta) end. Definition transl_binop (op: Csyntax.binary_operation) |