Module Wordsize_8.
Definition wordsize := 8%nat.
Remark wordsize_not_zero: wordsize <> 0%nat.
Remark int_ltu_2_inv:
forall y z,
Int.ltu y iwordsize' = true ->
Int.ltu z iwordsize' = true ->
Int.unsigned (Int.add y z) <= Int.unsigned iwordsize' ->
let y' := repr (Int.unsigned y) in
let z' := repr (Int.unsigned z) in
Int.unsigned y = unsigned y'
/\ Int.unsigned z = unsigned z'
/\ ltu y' iwordsize = true
/\ ltu z' iwordsize = true
/\ Int.unsigned (Int.add y z) = unsigned (add y' z')
/\ add y' z' = repr (Int.unsigned (Int.add y z)).

Theorem shru'_shl':
forall x y z, Int.ltu y iwordsize' = true -> Int.ltu z iwordsize' = true ->
shru' (shl' x y) z =
if Int.ltu z y then shl' (zero_ext (zwordsize - Int.unsigned y) x) (Int.sub y z)
else zero_ext (zwordsize - Int.unsigned z) (shru' x (Int.sub z y)).