aboutsummaryrefslogtreecommitdiffstats
path: root/ia32/ConstpropOp.vp
diff options
context:
space:
mode:
authorxleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2012-07-13 15:01:51 +0000
committerxleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2012-07-13 15:01:51 +0000
commit48b839d15e69c3c9995ca3c25e6a7c4730224292 (patch)
tree2394d10bcb90b36617bfd79f32aa5e04492a860a /ia32/ConstpropOp.vp
parent926bf226e89e0a4935da8815852af76c8d2b3cdf (diff)
downloadcompcert-kvx-48b839d15e69c3c9995ca3c25e6a7c4730224292.tar.gz
compcert-kvx-48b839d15e69c3c9995ca3c25e6a7c4730224292.zip
Support for MacOS X's indirect symbols. (first try)
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1978 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'ia32/ConstpropOp.vp')
-rw-r--r--ia32/ConstpropOp.vp15
1 files changed, 14 insertions, 1 deletions
diff --git a/ia32/ConstpropOp.vp b/ia32/ConstpropOp.vp
index a5e4e0d2..0643296f 100644
--- a/ia32/ConstpropOp.vp
+++ b/ia32/ConstpropOp.vp
@@ -145,6 +145,19 @@ Nondetfunction eval_static_operation (op: operation) (vl: list approx) :=
| _, _ => Unknown
end.
+(** * Generation of constants *)
+
+Parameter generate_float_constants : unit -> bool.
+
+Definition const_for_result (a: approx) : option operation :=
+ match a with
+ | I n => Some(Ointconst n)
+ | F n => if generate_float_constants tt then Some(Ofloatconst n) else None
+ | G symb ofs => Some(Olea (Aglobal symb ofs))
+ | S ofs => Some(Olea (Ainstack ofs))
+ | _ => None
+ end.
+
(** * Operator strength reduction *)
(** We now define auxiliary functions for strength reduction of
@@ -217,7 +230,7 @@ Nondetfunction addr_strength_reduction
Definition make_addimm (n: int) (r: reg) :=
if Int.eq n Int.zero
then (Omove, r :: nil)
- else (Oaddimm n, r :: nil).
+ else (Olea (Aindexed n), r :: nil).
Definition make_shlimm (n: int) (r: reg) :=
if Int.eq n Int.zero