(** 64-bit integer operations *)

Definition shift_long (sem: int64 -> int -> int64) (v w: aval) :=
  match w with
  | I amount =>
      if Int.ltu amount Int64.iwordsize' then
        match v with
        | L i => L (sem i amount)
        | _ => ntop1 v
        end
      else ntop1 v
  | _ => ntop1 v
  end.

(* Specifications: *)
Lemma shift_long_sound: forall sem v w x y, vmatch v x -> vmatch w y -> vmatch (match v, w with | Vlong i, Vint j => if Int.ltu j Int64.iwordsize' then Vlong (sem i j) else Vundef | _, _ => Vundef end) (shift_long sem x y).