summaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
authorGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2012-01-15 08:57:09 +0000
committerGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2012-01-15 08:57:09 +0000
commitc4877832826fa26aea9c236f16bdc2de16c98150 (patch)
treed25f713d4c6f4cf6126ad0451b80b32138eac84a /backend
parenta82c9c0e4a0b8e37c9c3ea5ae99714982563606f (diff)
Added volatile_read_global and volatile_store_global builtins.
Finished updating IA32 and ARM ports. git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1792 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'backend')
-rw-r--r--backend/Constprop.v3
-rw-r--r--backend/Constpropproof.v10
2 files changed, 10 insertions, 3 deletions
diff --git a/backend/Constprop.v b/backend/Constprop.v
index 4c303ac..c3b9863 100644
--- a/backend/Constprop.v
+++ b/backend/Constprop.v
@@ -199,6 +199,9 @@ Definition transf_instr (app: D.t) (instr: instruction) :=
Icall sig (transf_ros app ros) args res s
| Itailcall sig ros args =>
Itailcall sig (transf_ros app ros) args
+ | Ibuiltin ef args res s =>
+ let (ef', args') := builtin_strength_reduction ef args (approx_regs app args) in
+ Ibuiltin ef' args' res s
| Icond cond args s1 s2 =>
match eval_static_condition cond (approx_regs app args) with
| Some b =>
diff --git a/backend/Constpropproof.v b/backend/Constpropproof.v
index 7ac4339..9affea8 100644
--- a/backend/Constpropproof.v
+++ b/backend/Constpropproof.v
@@ -416,12 +416,16 @@ Proof.
constructor; auto. apply regs_lessdef_regs; auto.
(* Ibuiltin *)
+Opaque builtin_strength_reduction.
+ destruct (builtin_strength_reduction ef args (approx_regs (analyze f)#pc args)) as [ef' args']_eqn.
+ generalize (builtin_strength_reduction_correct ge sp (analyze f)!!pc rs
+ MATCH ef args (approx_regs (analyze f) # pc args) _ _ _ _ (refl_equal _) H0).
+ rewrite Heqp. intros P.
exploit external_call_mem_extends; eauto.
- instantiate (1 := rs'##args). apply regs_lessdef_regs; auto.
+ instantiate (1 := rs'##args'). apply regs_lessdef_regs; auto.
intros [v' [m2' [A [B [C D]]]]].
- TransfInstr. intro.
exists (State s' (transf_function f) sp pc' (rs'#res <- v') m2'); split.
- eapply exec_Ibuiltin; eauto.
+ eapply exec_Ibuiltin. TransfInstr. rewrite Heqp. eauto.
eapply external_call_symbols_preserved; eauto.
exact symbols_preserved. exact varinfo_preserved.
econstructor; eauto.