Section CONSTRUCTORS.
Variable ge: genv.
Variable fn: function.
(** Decomposition of integer literals *)
Inductive wf_decomposition: list (Z * Z) -> Prop :=
| wf_decomp_nil:
wf_decomposition nil
| wf_decomp_cons: forall m n p l,
n = Zzero_ext 16 m -> 0 <= p -> wf_decomposition l ->
wf_decomposition ((n, p) :: l).
Fixpoint recompose_int (accu: Z) (l: list (Z * Z)) : Z :=
match l with
| nil => accu
| (n, p) :: l => recompose_int (Zinsert accu n p 16) l
end.
(** Add immediate *)
(** Logical immediate *)

Lemma exec_logicalimm32:
forall (insn1: ireg -> ireg0 -> Z -> instruction)
(insn2: ireg -> ireg0 -> ireg -> shift_op -> instruction)
(sem: val -> val -> val),
(forall rd r1 n rs m,
exec_instr ge fn (insn1 rd r1 n) rs m =
Next (nextinstr (rs#rd <- (sem rs##r1 (Vint (Int.repr n))))) m) ->
(forall rd r1 r2 s rs m,
exec_instr ge fn (insn2 rd r1 r2 s) rs m =
Next (nextinstr (rs#rd <- (sem rs##r1 (eval_shift_op_int rs#r2 s)))) m) ->
forall rd r1 n k rs m,
r1 <> X16 ->
exists rs',
exec_straight ge fn (logicalimm32 insn1 insn2 rd r1 n k) rs m k rs' m
/\ rs'#rd = sem rs#r1 (Vint n)
/\ forall r, data_preg r = true -> r <> rd -> rs'#r = rs#r.