From a745efa7f07a10cec625b9c302eb0196b7bfaefb Mon Sep 17 00:00:00 2001 From: xleroy Date: Thu, 26 Feb 2009 14:48:59 +0000 Subject: 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 --- common/Values.v | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'common') diff --git a/common/Values.v b/common/Values.v index 27d4f50c..8182d7a5 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. *) -- cgit