summaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
Diffstat (limited to 'backend')
-rw-r--r--backend/NeedDomain.v15
1 files changed, 14 insertions, 1 deletions
diff --git a/backend/NeedDomain.v b/backend/NeedDomain.v
index 99d70a8..47f6975 100644
--- a/backend/NeedDomain.v
+++ b/backend/NeedDomain.v
@@ -603,7 +603,7 @@ Proof.
- destruct v; auto with na.
Qed.
-(** Modular arithmetic operations: add, mul.
+(** Modular arithmetic operations: add, mul, opposite.
(But not subtraction because of the pointer - pointer case. *)
Definition modarith (x: nval) :=
@@ -642,6 +642,19 @@ Proof.
- inv H; auto. inv H0; auto. destruct w1; auto.
Qed.
+Lemma neg_sound:
+ forall v w x,
+ vagree v w (modarith x) ->
+ vagree (Val.neg v) (Val.neg w) x.
+Proof.
+ intros; destruct x; simpl in *.
+- auto.
+- unfold Val.neg; InvAgree.
+ apply eqmod_iagree. apply Int.eqmod_neg. apply iagree_eqmod; auto.
+- destruct v, w; simpl; auto.
+- inv H; simpl; auto.
+Qed.
+
(** Conversions: zero extension, sign extension, single-of-float *)
Definition zero_ext (n: Z) (x: nval) :=