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 *)
(** Load address of symbol *)
(** Shifted operands *)
Remark transl_shift_not_none:
forall s a, transl_shift s a <> SOnone.
Remark or_zero_eval_shift_op_int:
forall v s, s <> SOnone -> Val.or (Vint Int.zero) (eval_shift_op_int v s) = eval_shift_op_int v s.
Remark or_zero_eval_shift_op_long:
forall v s, s <> SOnone -> Val.orl (Vlong Int64.zero) (eval_shift_op_long v s) = eval_shift_op_long v s.
Remark add_zero_eval_shift_op_long:
forall v s, s <> SOnone -> Val.addl (Vlong Int64.zero) (eval_shift_op_long v s) = eval_shift_op_long v s.
(** Zero- and Sign- extensions *)

Lemma exec_arith_extended:
forall (sem: val -> val -> val)
(insnX: iregsp -> iregsp -> ireg -> extend_op -> instruction)
(insnS: ireg -> ireg0 -> ireg -> shift_op -> instruction),
(forall rd r1 r2 x rs m,
exec_instr ge fn (insnX rd r1 r2 x) rs m =
Next (nextinstr (rs#rd <- (sem rs#r1 (eval_extend rs#r2 x)))) m) ->
(forall rd r1 r2 s rs m,
exec_instr ge fn (insnS rd r1 r2 s) rs m =
Next (nextinstr (rs#rd <- (sem rs###r1 (eval_shift_op_long rs#r2 s)))) m) ->
forall (rd r1 r2: ireg) (ex: extension) (a: amount64) (k: code) rs m,
r1 <> X16 ->
exists rs',
exec_straight ge fn (arith_extended insnX insnS rd r1 r2 ex a k) rs m k rs' m
/\ rs'#rd = sem rs#r1 (Op.eval_extend ex rs#r2 a)
/\ forall r, data_preg r = true -> r <> rd -> rs'#r = rs#r.