(** Connection between Mach and Asm calling conventions for external functions. *)

(* Specifications: *)
Lemma extcall_arg_match:
forall ms sp rs m m' l v,
agree ms sp rs ->
Mem.extends m m' ->
Mach.extcall_arg ms m sp l v ->
exists v', Asm.extcall_arg rs m' l v' /\ Val.lessdef v v'.
Lemma extcall_arg_pair_match:
forall ms sp rs m m' p v,
agree ms sp rs ->
Mem.extends m m' ->
Mach.extcall_arg_pair ms m sp p v ->
exists v', Asm.extcall_arg_pair rs m' p v' /\ Val.lessdef v v'.
Lemma extcall_args_match:
forall ms sp rs m m', agree ms sp rs -> Mem.extends m m' ->
forall ll vl,
list_forall2 (Mach.extcall_arg_pair ms m sp) ll vl ->
exists vl', list_forall2 (Asm.extcall_arg_pair rs m') ll vl' /\ Val.lessdef_list vl vl'.
Lemma extcall_arguments_match:
forall ms m m' sp rs sg args,
agree ms sp rs -> Mem.extends m m' ->
Mach.extcall_arguments ms m sp sg args ->
exists args', Asm.extcall_arguments rs m' sg args' /\ Val.lessdef_list args args'.