(** Translation of arithmetic operations. *)
Ltac TranslOpSimpl :=
econstructor; split;
[ apply exec_straight_one; [simpl; eauto | reflexivity]
| split; [ apply Val.lessdef_same; Simpl; fail | intros; Simpl; fail ] ].

(* Specifications: *)
Lemma transl_op_correct_aux:
forall op args res k (rs: regset) m v c,
transl_op op args res k = OK c ->
eval_operation ge (rs#GPR1) op (map rs (map preg_of args)) m = Some v ->
exists rs',
exec_straight ge fn c rs m k rs' m
/\ Val.lessdef v rs'#(preg_of res)
/\ forall r, important_preg r = true -> r <> preg_of res -> preg_notin r (destroyed_by_op op) -> rs' r = rs r.
Lemma transl_op_correct:
forall op args res k ms sp rs m v m' c,
transl_op op args res k = OK c ->
agree ms sp rs ->
eval_operation ge sp op (map ms args) m = Some v ->
Mem.extends m m' ->
exists rs',
exec_straight ge fn c rs m' k rs' m'
/\ agree (Regmap.set res v (Mach.undef_regs (destroyed_by_op op) ms)) sp rs'
/\ forall r, important_preg r = true -> r <> preg_of res -> preg_notin r (destroyed_by_op op) -> rs' r = rs r.