aboutsummaryrefslogtreecommitdiffstats
path: root/backend/Constprop.v
diff options
context:
space:
mode:
authorxleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2013-09-14 16:24:30 +0000
committerxleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2013-09-14 16:24:30 +0000
commit76ea1108be6f8b4ba9dc0118a13f685bcb62bc2b (patch)
tree8b2dad961e6b368426573e8a217594b9bcb42752 /backend/Constprop.v
parent9a0ff6bb768cb0a6e45c1c75727d1cd8199cb89e (diff)
downloadcompcert-kvx-76ea1108be6f8b4ba9dc0118a13f685bcb62bc2b.tar.gz
compcert-kvx-76ea1108be6f8b4ba9dc0118a13f685bcb62bc2b.zip
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
Diffstat (limited to 'backend/Constprop.v')
-rw-r--r--backend/Constprop.v4
1 files changed, 3 insertions, 1 deletions
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', _ =>