Remark val_lessdef_normalize:
forall v v' ty,
Val.has_type v ty -> Val.lessdef v v' ->
Val.lessdef v (Val.load_result (chunk_of_type ty) v').

(* Specifications: *)
Lemma subst_loc_satisf:
forall env src dst rs ls e e',
subst_loc dst src e = Some e' ->
well_typed_move env dst e = true ->
wt_regset env rs ->
satisf rs ls e' ->
satisf rs (Locmap.set dst (ls src) ls) e.
Lemma in_subst_loc_part:
forall l1 l2 k q (e e': eqs),
EqSet.In q e ->
subst_loc_part l1 l2 k e = Some e' ->
(eloc q = l1 /\ ekind q = k /\ EqSet.In (Eq Full (ereg q) l2) e') \/ (Loc.diff l1 (eloc q) /\ EqSet.In q e').
Lemma subst_loc_part_satisf_lowlong:
forall src dst rs ls e e',
subst_loc_part (R dst) (R src) Low e = Some e' ->
satisf rs ls e' ->
satisf rs (Locmap.set (R dst) (Val.loword (ls (R src))) ls) e.
Lemma subst_loc_part_satisf_highlong:
forall src dst rs ls e e',
subst_loc_part (R dst) (R src) High e = Some e' ->
satisf rs ls e' ->
satisf rs (Locmap.set (R dst) (Val.hiword (ls (R src))) ls) e.
Lemma in_subst_loc_pair:
forall l1 l2 l2' q (e e': eqs),
EqSet.In q e ->
subst_loc_pair l1 l2  l2' e = Some e' ->
(eloc q = l1 /\ ekind q = Full /\ EqSet.In (Eq High (ereg q) l2) e' /\ EqSet.In (Eq Low (ereg q) l2') e')
\/ (Loc.diff l1 (eloc q) /\ EqSet.In q e').
Lemma long_type_compat_charact:
forall env l e q,
long_type_compat env l e = true ->
EqSet.In q e ->
subtype (env (ereg q)) Tlong = true \/ Loc.diff l (eloc q).
Lemma subst_loc_pair_satisf_makelong:
forall env src1 src2 dst rs ls e e',
subst_loc_pair (R dst) (R src1) (R src2) e = Some e' ->
long_type_compat env (R dst) e = true ->
wt_regset env rs ->
satisf rs ls e' ->
Archi.ptr64 = false ->
satisf rs (Locmap.set (R dst) (Val.longofwords (ls (R src1)) (ls (R src2))) ls) e.
Lemma can_undef_sound:
forall e ml q,
can_undef ml e = true -> EqSet.In q e -> Loc.notin (eloc q) (map R ml).
Lemma undef_regs_outside:
forall ml ls l,
Loc.notin l (map R ml) -> undef_regs ml ls l = ls l.
Lemma can_undef_satisf:
forall ml e rs ls,
can_undef ml e = true ->
satisf rs ls e ->
satisf rs (undef_regs ml ls) e.
Lemma can_undef_except_sound:
forall lx e ml q,
can_undef_except lx ml e = true -> EqSet.In q e -> Loc.diff (eloc q) lx -> Loc.notin (eloc q) (map R ml).
Lemma subst_loc_undef_satisf:
forall env src dst rs ls ml e e',
subst_loc dst src e = Some e' ->
well_typed_move env dst e = true ->
can_undef_except dst ml e = true ->
wt_regset env rs ->
satisf rs ls e' ->
satisf rs (Locmap.set dst (ls src) (undef_regs ml ls)) e.
Lemma transfer_use_def_satisf:
forall args res args' res' und e e' rs ls,
transfer_use_def args res args' res' und e = Some e' ->
satisf rs ls e' ->
Val.lessdef_list rs##args (reglist ls args') /\
(forall v v', Val.lessdef v v' ->
satisf (rs#res <- v) (Locmap.set (R res') v' (undef_regs und ls)) e).
Lemma add_equations_res_lessdef:
forall r oty l e e' rs ls,
add_equations_res r oty l e = Some e' ->
satisf rs ls e' ->
Val.has_type rs#r (match oty with Some ty => ty | None => Tint end) ->
Val.lessdef rs#r (Locmap.getpair (map_rpair R l) ls).
Lemma return_regs_agree_callee_save:
forall caller callee,
agree_callee_save caller (return_regs caller callee).
Lemma no_caller_saves_sound:
forall e q,
no_caller_saves e = true ->
EqSet.In q e ->
callee_save_loc (eloc q).
Lemma val_hiword_longofwords:
forall v1 v2, Val.lessdef (Val.hiword (Val.longofwords v1 v2)) v1.
Lemma val_loword_longofwords:
forall v1 v2, Val.lessdef (Val.loword (Val.longofwords v1 v2)) v2.
Lemma function_return_satisf:
forall rs ls_before ls_after res res' sg e e' v,
res' = loc_result sg ->
remove_equations_res res res' e = Some e' ->
satisf rs ls_before e' ->
forallb (fun l => reg_loc_unconstrained res l e') (map R (regs_of_rpair res')) = true ->
no_caller_saves e' = true ->
Val.lessdef v (Locmap.getpair (map_rpair R res') ls_after) ->
agree_callee_save ls_before ls_after ->
satisf (rs#res <- v) ls_after e.
Lemma compat_left_sound:
forall r l e q,
compat_left r l e = true -> EqSet.In q e -> ereg q = r -> ekind q = Full /\ eloc q = l.
Lemma compat_left2_sound:
forall r l1 l2 e q,
compat_left2 r l1 l2 e = true -> EqSet.In q e -> ereg q = r ->
(ekind q = High /\ eloc q = l1) \/ (ekind q = Low /\ eloc q = l2).
Lemma compat_entry_satisf:
forall rl ll e,
compat_entry rl ll e = true ->
forall vl ls,
Val.lessdef_list vl (map (fun p => Locmap.getpair p ls) ll) ->
satisf (init_regs vl rl) ls e.
Lemma call_regs_param_values:
forall sg ls,
map (fun p => Locmap.getpair p (call_regs ls)) (loc_parameters sg)
= map (fun p => Locmap.getpair p ls) (loc_arguments sg).
Lemma return_regs_arg_values:
forall sg ls1 ls2,
tailcall_is_possible sg = true ->
map (fun p => Locmap.getpair p (return_regs ls1 ls2)) (loc_arguments sg)
= map (fun p => Locmap.getpair p ls2) (loc_arguments sg).
Lemma find_function_tailcall:
forall tge ros ls1 ls2,
ros_compatible_tailcall ros = true ->
find_function tge ros (return_regs ls1 ls2) = find_function tge ros ls2.
Lemma loadv_int64_split:
forall m a v,
Mem.loadv Mint64 m a = Some v -> Archi.splitlong = true ->
exists v1 v2,
Mem.loadv Mint32 m a = Some (if Archi.big_endian then v1 else v2)
/\ Mem.loadv Mint32 m (Val.add a (Vint (Int.repr 4))) = Some (if Archi.big_endian then v2 else v1)
/\ Val.lessdef (Val.hiword v) v1
/\ Val.lessdef (Val.loword v) v2.
Lemma add_equations_builtin_arg_satisf:
forall env rs ls arg arg' e e',
add_equations_builtin_arg env arg arg' e = Some e' ->
satisf rs ls e' -> satisf rs ls e.
Lemma add_equations_builtin_arg_lessdef:
forall env (ge: RTL.genv) sp rs ls m arg v,
eval_builtin_arg ge (fun r => rs#r) sp m arg v ->
forall e e' arg',
add_equations_builtin_arg env arg arg' e = Some e' ->
satisf rs ls e' ->
wt_regset env rs ->
exists v', eval_builtin_arg ge ls sp m arg' v' /\ Val.lessdef v v'.
Lemma add_equations_builtin_args_satisf:
forall env rs ls arg arg' e e',
add_equations_builtin_args env arg arg' e = Some e' ->
satisf rs ls e' -> satisf rs ls e.
Lemma add_equations_builtin_args_lessdef:
forall env (ge: RTL.genv) sp rs ls m tm arg vl,
eval_builtin_args ge (fun r => rs#r) sp m arg vl ->
forall arg' e e',
add_equations_builtin_args env arg arg' e = Some e' ->
satisf rs ls e' ->
wt_regset env rs ->
Mem.extends m tm ->
exists vl', eval_builtin_args ge ls sp tm arg' vl' /\ Val.lessdef_list vl vl'.
Lemma add_equations_debug_args_satisf:
forall env rs ls arg arg' e e',
add_equations_debug_args env arg arg' e = Some e' ->
satisf rs ls e' -> satisf rs ls e.
Lemma add_equations_debug_args_eval:
forall env (ge: RTL.genv) sp rs ls m tm arg vl,
eval_builtin_args ge (fun r => rs#r) sp m arg vl ->
forall arg' e e',
add_equations_debug_args env arg arg' e = Some e' ->
satisf rs ls e' ->
wt_regset env rs ->
Mem.extends m tm ->
exists vl', eval_builtin_args ge ls sp tm arg' vl'.
Lemma add_equations_builtin_eval:
forall ef env args args' e1 e2 m1 m1' rs ls (ge: RTL.genv) sp vargs t vres m2,
wt_regset env rs ->
match ef with
| EF_debug _ _ _ => add_equations_debug_args env args args' e1
| _              => add_equations_builtin_args env args args' e1
end = Some e2 ->
Mem.extends m1 m1' ->
satisf rs ls e2 ->
eval_builtin_args ge (fun r => rs # r) sp m1 args vargs ->
external_call ef ge vargs m1 t vres m2 ->
satisf rs ls e1 /\
exists vargs' vres' m2',
eval_builtin_args ge ls sp m1' args' vargs'
/\ external_call ef ge vargs' m1' t vres' m2'
/\ Val.lessdef vres vres'
/\ Mem.extends m2 m2'.
Lemma parallel_set_builtin_res_satisf:
forall env res res' e0 e1 rs ls v v',
remove_equations_builtin_res env res res' e0 = Some e1 ->
forallb (fun r => reg_unconstrained r e1) (params_of_builtin_res res) = true ->
forallb (fun mr => loc_unconstrained (R mr) e1) (params_of_builtin_res res') = true ->
satisf rs ls e1 ->
Val.lessdef v v' ->
satisf (regmap_setres res v rs) (Locmap.setres res' v' ls) e0.