aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Integers.v
diff options
context:
space:
mode:
authorxleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2013-12-20 13:05:53 +0000
committerxleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2013-12-20 13:05:53 +0000
commit7698300cfe2d3f944ce2e1d4a60a263620487718 (patch)
tree74292bb5f65bc797906b5c768df2e2e937e869b6 /lib/Integers.v
parentc511207bd0f25c4199770233175924a725526bd3 (diff)
downloadcompcert-7698300cfe2d3f944ce2e1d4a60a263620487718.tar.gz
compcert-7698300cfe2d3f944ce2e1d4a60a263620487718.zip
Merge of branch value-analysis.
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2381 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'lib/Integers.v')
-rw-r--r--lib/Integers.v13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/Integers.v b/lib/Integers.v
index cbbf28c7..d85007b4 100644
--- a/lib/Integers.v
+++ b/lib/Integers.v
@@ -2454,6 +2454,19 @@ Proof.
generalize wordsize_pos; generalize wordsize_max_unsigned; omega.
Qed.
+Theorem ror_rol_neg:
+ forall x y, (zwordsize | modulus) -> ror x y = rol x (neg y).
+Proof.
+ intros. apply same_bits_eq; intros.
+ rewrite bits_ror by auto. rewrite bits_rol by auto.
+ f_equal. apply eqmod_mod_eq. omega.
+ apply eqmod_trans with (i - (- unsigned y)).
+ apply eqmod_refl2; omega.
+ apply eqmod_sub. apply eqmod_refl.
+ apply eqmod_divides with modulus.
+ apply eqm_unsigned_repr. auto.
+Qed.
+
Theorem or_ror:
forall x y z,
ltu y iwordsize = true ->