From 76ea1108be6f8b4ba9dc0118a13f685bcb62bc2b Mon Sep 17 00:00:00 2001 From: xleroy Date: Sat, 14 Sep 2013 16:24:30 +0000 Subject: 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 --- backend/Constprop.v | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'backend/Constprop.v') diff --git a/backend/Constprop.v b/backend/Constprop.v index 24573a59..e5ea64d8 100644 --- a/backend/Constprop.v +++ b/backend/Constprop.v @@ -322,7 +322,9 @@ Function annot_strength_reduction let (targs'', args'') := annot_strength_reduction app targs' args' in match ty, approx_reg app arg with | Tint, I n => (AA_int n :: targs'', args'') - | Tfloat, F n => (AA_float n :: targs'', args'') + | Tfloat, F n => if generate_float_constants tt + then (AA_float n :: targs'', args'') + else (AA_arg ty :: targs'', arg :: args'') | _, _ => (AA_arg ty :: targs'', arg :: args'') end | targ :: targs', _ => -- cgit