From 5feecb99712de3604f284e5934aed73f2b606659 Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Tue, 4 Jun 2019 11:47:14 +0200 Subject: start to have whole path if-conversion? --- mppa_k1c/SelectOp.vp | 5 ++++- mppa_k1c/SelectOpproof.v | 14 +++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) (limited to 'mppa_k1c') diff --git a/mppa_k1c/SelectOp.vp b/mppa_k1c/SelectOp.vp index 219a462b..ee614253 100644 --- a/mppa_k1c/SelectOp.vp +++ b/mppa_k1c/SelectOp.vp @@ -66,7 +66,10 @@ Section SELECT. Context {hf: helper_functions}. (** Ternary operator *) -Definition select (ty : typ) (cond : condition) (args : exprlist) (e1 e2: expr) : option expr := None. +(** TODO *) +Definition select (ty : typ) (cond : condition) (args : exprlist) (e1 e2: expr) : option expr := + Some (Eop (Osel (Ccomp0 Cne) ty) (e1 ::: e2 ::: + (Eop (Ocmp cond) args) ::: Enil)). (** ** Constants **) diff --git a/mppa_k1c/SelectOpproof.v b/mppa_k1c/SelectOpproof.v index 26f1bb89..7c6dfb7d 100644 --- a/mppa_k1c/SelectOpproof.v +++ b/mppa_k1c/SelectOpproof.v @@ -1424,7 +1424,19 @@ Theorem eval_select: eval_expr ge sp e m le a v /\ Val.lessdef (Val.select (Some b) v1 v2 ty) v. Proof. - discriminate. + unfold select. + intros until b. + intro Hop; injection Hop; clear Hop; intro; subst a. + intros HeL He1 He2 HeC. + econstructor; split. + { + repeat (try econstructor; try eassumption). + } + apply Val.select_lessdef; trivial. + right. + rewrite HeC. + simpl. + destruct b; reflexivity. Qed. (* floating-point division *) -- cgit