From 336a1f906a9c617e68e9d43e244bf42e9bdbae64 Mon Sep 17 00:00:00 2001 From: xleroy Date: Wed, 9 Apr 2014 13:26:16 +0000 Subject: 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 --- lib/Integers.v | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib') 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. -- cgit v1.2.3