aboutsummaryrefslogtreecommitdiffstats
path: root/mppa_k1c/Op.v
diff options
context:
space:
mode:
Diffstat (limited to 'mppa_k1c/Op.v')
-rw-r--r--mppa_k1c/Op.v15
1 files changed, 15 insertions, 0 deletions
diff --git a/mppa_k1c/Op.v b/mppa_k1c/Op.v
index e619b2f5..51d70693 100644
--- a/mppa_k1c/Op.v
+++ b/mppa_k1c/Op.v
@@ -288,6 +288,21 @@ Definition eval_select (cond : condition0) (v0 : val) (v1 : val) (vselect : val)
| _,_,_ => Vundef
end.
+Definition eval_select2 (cond : condition0) (v0 : val) (v1 : val) (vselect : val) (m: mem) : val :=
+ match (eval_condition0 cond vselect m), v0, v1 with
+ | Some bval, Vint i0, Vint i1 => Vint (if bval then i1 else i0)
+ | _,_,_ => Vundef
+ end.
+
+Lemma eval_select_to2: forall cond v0 v1 vselect m,
+ (eval_select cond v0 v1 vselect m) =
+ (eval_select2 cond v0 v1 vselect m).
+Proof.
+ intros.
+ unfold eval_select2.
+ destruct v0; destruct v1; simpl; destruct (eval_condition0 cond vselect m); simpl; reflexivity.
+Qed.
+
Definition eval_selectl (v0 : val) (v1 : val) (vselect : val) : val :=
match vselect with
| Vint iselect =>