From c4877832826fa26aea9c236f16bdc2de16c98150 Mon Sep 17 00:00:00 2001 From: xleroy Date: Sun, 15 Jan 2012 08:57:09 +0000 Subject: 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 --- backend/Constprop.v | 3 +++ backend/Constpropproof.v | 10 +++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'backend') diff --git a/backend/Constprop.v b/backend/Constprop.v index 4c303ac4..c3b98634 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 7ac43391..9affea88 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. -- cgit