summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2009-02-26 14:48:59 +0000
committerGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2009-02-26 14:48:59 +0000
commita745efa7f07a10cec625b9c302eb0196b7bfaefb (patch)
treeaf32acc8865cf704b63bd27b8eb21da6b29d83b6 /common
parent26fcc4dbd92f367ecb20f4457cdf887eea0b6568 (diff)
Reserve register GPR13 for compatibility with EABI. Optimize operations 'x >= 0' and 'x < 0'.
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@999 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'common')
-rw-r--r--common/Values.v17
1 files changed, 17 insertions, 0 deletions
diff --git a/common/Values.v b/common/Values.v
index 27d4f50..8182d7a 100644
--- a/common/Values.v
+++ b/common/Values.v
@@ -918,6 +918,23 @@ Proof.
elim H0; intro; subst v; reflexivity.
Qed.
+Lemma rolm_lt_zero:
+ forall v, rolm v Int.one Int.one = cmp Clt v (Vint Int.zero).
+Proof.
+ intros. destruct v; simpl; auto.
+ transitivity (Vint (Int.shru i (Int.repr (Z_of_nat wordsize - 1)))).
+ decEq. symmetry. rewrite Int.shru_rolm. auto. auto.
+ rewrite Int.shru_lt_zero. destruct (Int.lt i Int.zero); auto.
+Qed.
+
+Lemma rolm_ge_zero:
+ forall v,
+ xor (rolm v Int.one Int.one) (Vint Int.one) = cmp Cge v (Vint Int.zero).
+Proof.
+ intros. rewrite rolm_lt_zero. destruct v; simpl; auto.
+ destruct (Int.lt i Int.zero); auto.
+Qed.
+
(** The ``is less defined'' relation between values.
A value is less defined than itself, and [Vundef] is
less defined than any value. *)