(** * Correctness of PowerPC constructor functions *)
Section CONSTRUCTORS.
Variable ge: genv.
Variable fn: function.
(** Properties of comparisons. *)

(* Specifications: *)
Lemma compare_float_spec:
forall rs v1 v2,
let rs1 := nextinstr (compare_float rs v1 v2) in
rs1#CR0_0 = Val.cmpf Clt v1 v2
/\ rs1#CR0_1 = Val.cmpf Cgt v1 v2
/\ rs1#CR0_2 = Val.cmpf Ceq v1 v2
/\ forall r', r' <> CR0_0 -> r' <> CR0_1 -> r' <> CR0_2 -> r' <> CR0_3 -> r' <> PC -> rs1#r' = rs#r'.
Lemma compare_sint_spec:
forall rs v1 v2,
let rs1 := nextinstr (compare_sint rs v1 v2) in
rs1#CR0_0 = Val.cmp Clt v1 v2
/\ rs1#CR0_1 = Val.cmp Cgt v1 v2
/\ rs1#CR0_2 = Val.cmp Ceq v1 v2
/\ forall r', r' <> CR0_0 -> r' <> CR0_1 -> r' <> CR0_2 -> r' <> CR0_3 -> r' <> PC -> rs1#r' = rs#r'.
Lemma compare_uint_spec:
forall rs m v1 v2,
let rs1 := nextinstr (compare_uint rs m v1 v2) in
rs1#CR0_0 = Val.cmpu (Mem.valid_pointer m) Clt v1 v2
/\ rs1#CR0_1 = Val.cmpu (Mem.valid_pointer m) Cgt v1 v2
/\ rs1#CR0_2 = Val.cmpu (Mem.valid_pointer m) Ceq v1 v2
/\ forall r', r' <> CR0_0 -> r' <> CR0_1 -> r' <> CR0_2 -> r' <> CR0_3 -> r' <> PC -> rs1#r' = rs#r'.
Lemma compare_slong_spec:
forall rs v1 v2,
let rs1 := nextinstr (compare_slong rs v1 v2) in
rs1#CR0_0 = Val.of_optbool (Val.cmpl_bool Clt v1 v2)
/\ rs1#CR0_1 = Val.of_optbool (Val.cmpl_bool Cgt v1 v2)
/\ rs1#CR0_2 = Val.of_optbool (Val.cmpl_bool Ceq v1 v2)
/\ forall r', r' <> CR0_0 -> r' <> CR0_1 -> r' <> CR0_2 -> r' <> CR0_3 -> r' <> PC -> rs1#r' = rs#r'.
Lemma compare_ulong_spec:
forall rs m v1 v2,
let rs1 := nextinstr (compare_ulong rs m v1 v2) in
rs1#CR0_0 = Val.of_optbool (Val.cmplu_bool (Mem.valid_pointer m) Clt v1 v2)
/\ rs1#CR0_1 = Val.of_optbool (Val.cmplu_bool (Mem.valid_pointer m) Cgt v1 v2)
/\ rs1#CR0_2 = Val.of_optbool (Val.cmplu_bool (Mem.valid_pointer m) Ceq v1 v2)
/\ forall r', r' <> CR0_0 -> r' <> CR0_1 -> r' <> CR0_2 -> r' <> CR0_3 -> r' <> PC -> rs1#r' = rs#r'.