aboutsummaryrefslogtreecommitdiffstats
path: root/mppa_k1c
diff options
context:
space:
mode:
authorDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-06-04 11:47:14 +0200
committerDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-06-04 11:47:14 +0200
commit5feecb99712de3604f284e5934aed73f2b606659 (patch)
treedfe87bad1fe089f83d82a452d1d8886d2dc17ab1 /mppa_k1c
parenteec7948bd0204787ad8ddde70c5a28fdfd62356a (diff)
downloadcompcert-kvx-5feecb99712de3604f284e5934aed73f2b606659.tar.gz
compcert-kvx-5feecb99712de3604f284e5934aed73f2b606659.zip
start to have whole path if-conversion?
Diffstat (limited to 'mppa_k1c')
-rw-r--r--mppa_k1c/SelectOp.vp5
-rw-r--r--mppa_k1c/SelectOpproof.v14
2 files changed, 17 insertions, 2 deletions
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 *)