diff options
author | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2014-04-09 13:26:16 +0000 |
---|---|---|
committer | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2014-04-09 13:26:16 +0000 |
commit | 336a1f906a9c617e68e9d43e244bf42e9bdbae64 (patch) | |
tree | 47c65aa1aa9c9eadbd98ec0e443ad0105bb0b268 /lib | |
parent | 76f49ca6af4ffbc77c0ba7965d409c3de04011bd (diff) |
Constprop: use "not" for "xorimm(-1)"; optimize == 1 and != 0 comparisons over booleans.
Select*: more systematic constant propagation; don't CP shifts by amounts outside of [0..31].
Driver: timer for whole compilation.
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2452 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Integers.v | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Integers.v b/lib/Integers.v index d85007b..4464d26 100644 --- a/lib/Integers.v +++ b/lib/Integers.v @@ -1202,6 +1202,11 @@ Qed. Remark Ztestbit_0: forall n, Z.testbit 0 n = false. Proof Z.testbit_0_l. +Remark Ztestbit_1: forall n, Z.testbit 1 n = zeq n 0. +Proof. + intros. destruct n; simpl; auto. +Qed. + Remark Ztestbit_m1: forall n, 0 <= n -> Z.testbit (-1) n = true. Proof. intros. destruct n; simpl; auto. @@ -1515,6 +1520,11 @@ Proof. intros. unfold testbit. rewrite unsigned_zero. apply Ztestbit_0. Qed. +Remark bits_one: forall n, testbit one n = zeq n 0. +Proof. + unfold testbit; intros. rewrite unsigned_one. apply Ztestbit_1. +Qed. + Lemma bits_mone: forall i, 0 <= i < zwordsize -> testbit mone i = true. Proof. |