Hint Resolve ireg_of_not_X31 ireg_of_not_X31': asmgen.
(** Useful simplification tactic *)
Ltac Simplif :=
((rewrite nextinstr_inv by eauto with asmgen)
|| (rewrite nextinstr_inv1 by eauto with asmgen)
|| (rewrite Pregmap.gss)
|| (rewrite nextinstr_pc)
|| (rewrite Pregmap.gso by eauto with asmgen)); auto with asmgen.
Ltac Simpl := repeat Simplif.
(** * Correctness of RISC-V constructor functions *)
Section CONSTRUCTORS.
Variable ge: genv.
Variable fn: function.
(** 32-bit integer constants and arithmetic *)

Lemma opimm32_correct:
forall (op: ireg -> ireg0 -> ireg0 -> instruction)
(opi: ireg -> ireg0 -> int -> instruction)
(sem: val -> val -> val) m,
(forall d s1 s2 rs,
exec_instr ge fn (op d s1 s2) rs m = Next (nextinstr (rs#d <- (sem rs##s1 rs##s2))) m) ->
(forall d s n rs,
exec_instr ge fn (opi d s n) rs m = Next (nextinstr (rs#d <- (sem rs##s (Vint n)))) m) ->
forall rd r1 n k rs,
r1 <> X31 ->
exists rs',
exec_straight ge fn (opimm32 op opi rd r1 n k) rs m k rs' m
/\ rs'#rd = sem rs##r1 (Vint n)
/\ forall r, r <> PC -> r <> rd -> r <> X31 -> rs'#r = rs#r.