(** Translation of addressing modes *)

(* Specifications: *)
Lemma transl_addressing_mode_32_correct:
forall addr args am (rs: regset) v,
transl_addressing addr args = OK am ->
eval_addressing32 ge (rs RSP) addr (List.map rs (List.map preg_of args)) = Some v ->
Val.lessdef v (eval_addrmode32 ge am rs).
Lemma transl_addressing_mode_64_correct:
forall addr args am (rs: regset) v,
transl_addressing addr args = OK am ->
eval_addressing64 ge (rs RSP) addr (List.map rs (List.map preg_of args)) = Some v ->
Val.lessdef v (eval_addrmode64 ge am rs).
Lemma transl_addressing_mode_correct:
forall addr args am (rs: regset) v,
transl_addressing addr args = OK am ->
eval_addressing ge (rs RSP) addr (List.map rs (List.map preg_of args)) = Some v ->
Val.lessdef v (eval_addrmode ge am rs).
Lemma normalize_addrmode_32_correct:
forall am rs, eval_addrmode32 ge (normalize_addrmode_32 am) rs = eval_addrmode32 ge am rs.
Lemma normalize_addrmode_64_correct:
forall am rs,
eval_addrmode64 ge am rs =
match normalize_addrmode_64 am with
| (am', None) => eval_addrmode64 ge am' rs
| (am', Some delta) => Val.addl (eval_addrmode64 ge am' rs) (Vlong delta)
end.