Hint Rewrite bits_rol bits_ror: ints.

(* Specifications: *)
Theorem shl_rolm:
forall x n,
ltu n iwordsize = true ->
shl x n = rolm x n (shl mone n).
Theorem shru_rolm:
forall x n,
ltu n iwordsize = true ->
shru x n = rolm x (sub iwordsize n) (shru mone n).
Theorem rol_zero:
forall x,
rol x zero = x.
Lemma bitwise_binop_rol:
forall f f' x y n,
(forall x y i, 0 <= i < zwordsize -> testbit (f x y) i = f' (testbit x i) (testbit y i)) ->
rol (f x y) n = f (rol x n) (rol y n).
Theorem rol_and:
forall x y n,
rol (and x y) n = and (rol x n) (rol y n).
Theorem rol_or:
forall x y n,
rol (or x y) n = or (rol x n) (rol y n).
Theorem rol_xor:
forall x y n,
rol (xor x y) n = xor (rol x n) (rol y n).
Theorem rol_rol:
forall x n m,
Z.divide zwordsize modulus ->
rol (rol x n) m = rol x (modu (add n m) iwordsize).
Theorem rolm_zero:
forall x m,
rolm x zero m = and x m.
Theorem rolm_rolm:
forall x n1 m1 n2 m2,
Z.divide zwordsize modulus ->
rolm (rolm x n1 m1) n2 m2 =
rolm x (modu (add n1 n2) iwordsize)
(and (rol m1 n2) m2).
Theorem or_rolm:
forall x n m1 m2,
or (rolm x n m1) (rolm x n m2) = rolm x n (or m1 m2).
Theorem ror_rol:
forall x y,
ltu y iwordsize = true ->
ror x y = rol x (sub iwordsize y).
Theorem ror_rol_neg:
forall x y, (zwordsize | modulus) -> ror x y = rol x (neg y).
Theorem or_ror:
forall x y z,
ltu y iwordsize = true ->
ltu z iwordsize = true ->
add y z = iwordsize ->
ror x z = or (shl x y) (shru x z).
Theorem shl_rolm:
forall x n,
ltu n iwordsize = true ->
shl x n = rolm x n (shl mone n).
Theorem shru_rolm:
forall x n,
ltu n iwordsize = true ->
shru x n = rolm x (sub iwordsize n) (shru mone n).
Theorem rol_zero:
forall x,
rol x zero = x.
Lemma bitwise_binop_rol:
forall f f' x y n,
(forall x y i, 0 <= i < zwordsize -> testbit (f x y) i = f' (testbit x i) (testbit y i)) ->
rol (f x y) n = f (rol x n) (rol y n).
Theorem rol_and:
forall x y n,
rol (and x y) n = and (rol x n) (rol y n).
Theorem rol_or:
forall x y n,
rol (or x y) n = or (rol x n) (rol y n).
Theorem rol_xor:
forall x y n,
rol (xor x y) n = xor (rol x n) (rol y n).
Theorem rol_rol:
forall x n m,
Z.divide zwordsize modulus ->
rol (rol x n) m = rol x (modu (add n m) iwordsize).
Theorem rolm_zero:
forall x m,
rolm x zero m = and x m.
Theorem rolm_rolm:
forall x n1 m1 n2 m2,
Z.divide zwordsize modulus ->
rolm (rolm x n1 m1) n2 m2 =
rolm x (modu (add n1 n2) iwordsize)
(and (rol m1 n2) m2).
Theorem or_rolm:
forall x n m1 m2,
or (rolm x n m1) (rolm x n m2) = rolm x n (or m1 m2).
Theorem ror_rol:
forall x y,
ltu y iwordsize = true ->
ror x y = rol x (sub iwordsize y).
Theorem ror_rol_neg:
forall x y, (zwordsize | modulus) -> ror x y = rol x (neg y).
Theorem or_ror:
forall x y z,
ltu y iwordsize = true ->
ltu z iwordsize = true ->
add y z = iwordsize ->
ror x z = or (shl x y) (shru x z).