aboutsummaryrefslogtreecommitdiffstats
path: root/powerpc/Asm.v
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>2015-03-27 15:28:20 +0100
committerXavier Leroy <xavier.leroy@inria.fr>2015-03-27 15:28:20 +0100
commite11b3b885a6d359925b86743b89698cc6757157a (patch)
tree4729067203418873c940aa27d45085ca9881905d /powerpc/Asm.v
parent33b742bb41725e47bd88dc12f2a4f40173023f83 (diff)
downloadcompcert-kvx-e11b3b885a6d359925b86743b89698cc6757157a.tar.gz
compcert-kvx-e11b3b885a6d359925b86743b89698cc6757157a.zip
Updating the PowerPC and ARM ports.
PowerPC: always use full register names to print annotations.
Diffstat (limited to 'powerpc/Asm.v')
-rw-r--r--powerpc/Asm.v42
1 files changed, 7 insertions, 35 deletions
diff --git a/powerpc/Asm.v b/powerpc/Asm.v
index 18316fb0..d707b2b5 100644
--- a/powerpc/Asm.v
+++ b/powerpc/Asm.v
@@ -276,13 +276,9 @@ Inductive instruction : Type :=
| Pxoris: ireg -> ireg -> constant -> instruction (**r bitwise xor with immediate high *)
| Plabel: label -> instruction (**r define a code label *)
| Pbuiltin: external_function -> list preg -> list preg -> instruction (**r built-in function (pseudo) *)
- | Pannot: external_function -> list annot_param -> instruction (**r annotation statement (pseudo) *)
+ | Pannot: external_function -> list (annot_arg preg) -> instruction (**r annotation statement (pseudo) *)
| Pcfi_adjust: int -> instruction (**r .cfi_adjust debug directive *)
- | Pcfi_rel_offset: int -> instruction (**r .cfi_rel_offset lr debug directive *)
-
-with annot_param : Type :=
- | APreg: preg -> annot_param
- | APstack: memory_chunk -> Z -> annot_param.
+ | Pcfi_rel_offset: int -> instruction. (**r .cfi_rel_offset lr debug directive *)
(** The pseudo-instructions are the following:
@@ -936,20 +932,6 @@ Definition extcall_arguments
Definition loc_external_result (sg: signature) : list preg :=
map preg_of (loc_result sg).
-(** Extract the values of the arguments of an annotation. *)
-
-Inductive annot_arg (rs: regset) (m: mem): annot_param -> val -> Prop :=
- | annot_arg_reg: forall r,
- annot_arg rs m (APreg r) (rs r)
- | annot_arg_stack: forall chunk ofs stk base v,
- rs (IR GPR1) = Vptr stk base ->
- Mem.load chunk m stk (Int.unsigned base + ofs) = Some v ->
- annot_arg rs m (APstack chunk ofs) v.
-
-Definition annot_arguments
- (rs: regset) (m: mem) (params: list annot_param) (args: list val) : Prop :=
- list_forall2 (annot_arg rs m) params args.
-
(** Execution of the instruction at [rs#PC]. *)
Inductive state: Type :=
@@ -978,8 +960,8 @@ Inductive step: state -> trace -> state -> Prop :=
rs PC = Vptr b ofs ->
Genv.find_funct_ptr ge b = Some (Internal f) ->
find_instr (Int.unsigned ofs) f.(fn_code) = Some (Pannot ef args) ->
- annot_arguments rs m args vargs ->
- external_call' ef ge vargs m t v m' ->
+ eval_annot_args ge rs (rs GPR1) m args vargs ->
+ external_call ef ge vargs m t v m' ->
step (State rs m) t
(State (nextinstr rs) m')
| exec_step_external:
@@ -1031,16 +1013,6 @@ Proof.
intros. red in H0; red in H1. eauto.
Qed.
-Remark annot_arguments_determ:
- forall rs m params args1 args2,
- annot_arguments rs m params args1 -> annot_arguments rs m params args2 -> args1 = args2.
-Proof.
- unfold annot_arguments. intros. revert params args1 H args2 H0.
- induction 1; intros.
- inv H0; auto.
- inv H1. decEq; eauto. inv H; inv H4. auto. congruence.
-Qed.
-
Lemma semantics_determinate: forall p, determinate (semantics p).
Proof.
Ltac Equalities :=
@@ -1059,8 +1031,8 @@ Ltac Equalities :=
exploit external_call_determ'. eexact H4. eexact H9. intros [A B].
split. auto. intros. destruct B; auto. subst. auto.
inv H12.
- assert (vargs0 = vargs) by (eapply annot_arguments_determ; eauto). subst vargs0.
- exploit external_call_determ'. eexact H5. eexact H13. intros [A B].
+ assert (vargs0 = vargs) by (eapply eval_annot_args_determ; eauto). subst vargs0.
+ exploit external_call_determ. eexact H5. eexact H13. intros [A B].
split. auto. intros. destruct B; auto. subst. auto.
assert (args0 = args) by (eapply extcall_arguments_determ; eauto). subst args0.
exploit external_call_determ'. eexact H3. eexact H8. intros [A B].
@@ -1069,7 +1041,7 @@ Ltac Equalities :=
red; intros. inv H; simpl.
omega.
inv H3; eapply external_call_trace_length; eauto.
- inv H4; eapply external_call_trace_length; eauto.
+ eapply external_call_trace_length; eauto.
inv H2; eapply external_call_trace_length; eauto.
(* initial states *)
inv H; inv H0. f_equal. congruence.