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/PrintCsyntax.ml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'cfrontend/PrintCsyntax.ml') diff --git a/cfrontend/PrintCsyntax.ml b/cfrontend/PrintCsyntax.ml index ebeda7cc..d6788319 100644 --- a/cfrontend/PrintCsyntax.ml +++ b/cfrontend/PrintCsyntax.ml @@ -25,7 +25,7 @@ let name_unop = function | Onotbool -> "!" | Onotint -> "~" | Oneg -> "-" - + | Ofabs -> "__builtin_fabs" let name_binop = function | Oadd -> "+" @@ -131,6 +131,7 @@ let parenthesis_level (Expr (e, ty)) = | Econst_int _ -> 0 | Econst_float _ -> 0 | Evar _ -> 0 + | Eunop(Ofabs, _) -> -10 (* force parentheses around argument *) | Eunop(_, _) -> 30 | Ederef _ -> 20 | Eaddrof _ -> 30 -- cgit