(** Useful simplification tactic *)
Ltac Simplif :=
match goal with
| [ |- nextinstr_nf _ _ = _ ] =>
((rewrite nextinstr_nf_inv by auto with asmgen)
|| (rewrite nextinstr_nf_inv1 by auto with asmgen)); auto
| [ |- nextinstr _ _ = _ ] =>
((rewrite nextinstr_inv by auto with asmgen)
|| (rewrite nextinstr_inv1 by auto with asmgen)); auto
| [ |- Pregmap.get ?x (Pregmap.set ?x _ _) = _ ] =>
rewrite Pregmap.gss; auto
| [ |- Pregmap.set ?x _ _ ?x = _ ] =>
rewrite Pregmap.gss; auto
| [ |- Pregmap.get _ (Pregmap.set _ _ _) = _ ] =>
rewrite Pregmap.gso by (auto with asmgen); auto
| [ |- Pregmap.set _ _ _ _ = _ ] =>
rewrite Pregmap.gso by (auto with asmgen); auto
end.
Ltac Simplifs := repeat Simplif.
(** * Correctness of x86-64 constructor functions *)
Section CONSTRUCTORS.
Variable ge: genv.
Variable fn: function.
(** Smart constructor for moves. *)

Lemma mk_mov_correct:
forall rd rs k c rs1 m,
mk_mov rd rs k = OK c ->
exists rs2,
exec_straight ge fn c rs1 m k rs2 m
/\ rs2#rd = rs1#rs
/\ forall r, data_preg r = true -> r <> rd -> rs2#r = rs1#r.