(** Translation of condition operators *)

(* Specifications: *)
Lemma transl_cond_int32s_correct:
forall cmp rd r1 r2 k rs m,
exists rs',
exec_straight ge fn (transl_cond_int32s cmp rd r1 r2 k) rs m k rs' m
/\ Val.lessdef (Val.cmp cmp rs##r1 rs##r2) rs'#rd
/\ forall r, r <> PC -> r <> rd -> rs'#r = rs#r.
Lemma transl_cond_int32u_correct:
forall cmp rd r1 r2 k rs m,
exists rs',
exec_straight ge fn (transl_cond_int32u cmp rd r1 r2 k) rs m k rs' m
/\ rs'#rd = Val.cmpu (Mem.valid_pointer m) cmp rs##r1 rs##r2
/\ forall r, r <> PC -> r <> rd -> rs'#r = rs#r.
Lemma transl_cond_int64s_correct:
forall cmp rd r1 r2 k rs m,
exists rs',
exec_straight ge fn (transl_cond_int64s cmp rd r1 r2 k) rs m k rs' m
/\ Val.lessdef (Val.maketotal (Val.cmpl cmp rs###r1 rs###r2)) rs'#rd
/\ forall r, r <> PC -> r <> rd -> rs'#r = rs#r.
Lemma transl_cond_int64u_correct:
forall cmp rd r1 r2 k rs m,
exists rs',
exec_straight ge fn (transl_cond_int64u cmp rd r1 r2 k) rs m k rs' m
/\ rs'#rd = Val.maketotal (Val.cmplu (Mem.valid_pointer m) cmp rs###r1 rs###r2)
/\ forall r, r <> PC -> r <> rd -> rs'#r = rs#r.
Lemma transl_condimm_int32s_correct:
forall cmp rd r1 n k rs m,
r1 <> X31 ->
exists rs',
exec_straight ge fn (transl_condimm_int32s cmp rd r1 n k) rs m k rs' m
/\ Val.lessdef (Val.cmp cmp rs#r1 (Vint n)) rs'#rd
/\ forall r, r <> PC -> r <> rd -> r <> X31 -> rs'#r = rs#r.
Lemma transl_condimm_int32u_correct:
forall cmp rd r1 n k rs m,
r1 <> X31 ->
exists rs',
exec_straight ge fn (transl_condimm_int32u cmp rd r1 n k) rs m k rs' m
/\ Val.lessdef (Val.cmpu (Mem.valid_pointer m) cmp rs#r1 (Vint n)) rs'#rd
/\ forall r, r <> PC -> r <> rd -> r <> X31 -> rs'#r = rs#r.
Lemma transl_condimm_int64s_correct:
forall cmp rd r1 n k rs m,
r1 <> X31 ->
exists rs',
exec_straight ge fn (transl_condimm_int64s cmp rd r1 n k) rs m k rs' m
/\ Val.lessdef (Val.maketotal (Val.cmpl cmp rs#r1 (Vlong n))) rs'#rd
/\ forall r, r <> PC -> r <> rd -> r <> X31 -> rs'#r = rs#r.
Lemma transl_condimm_int64u_correct:
forall cmp rd r1 n k rs m,
r1 <> X31 ->
exists rs',
exec_straight ge fn (transl_condimm_int64u cmp rd r1 n k) rs m k rs' m
/\ Val.lessdef (Val.maketotal (Val.cmplu (Mem.valid_pointer m) cmp rs#r1 (Vlong n))) rs'#rd
/\ forall r, r <> PC -> r <> rd -> r <> X31 -> rs'#r = rs#r.
Lemma transl_cond_op_correct:
forall cond rd args k c rs m,
transl_cond_op cond rd args k = OK c ->
exists rs',
exec_straight ge fn c rs m k rs' m
/\ Val.lessdef (Val.of_optbool (eval_condition cond (map rs (map preg_of args)) m)) rs'#rd
/\ forall r, r <> PC -> r <> rd -> r <> X31 -> rs'#r = rs#r.