aboutsummaryrefslogtreecommitdiffstats
path: root/mppa_k1c/ValueAOp.v
diff options
context:
space:
mode:
authorDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-03-25 07:36:46 +0100
committerDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-03-25 07:36:46 +0100
commitea45404a7ad40e952e0e4c415bdd1b7670ee515a (patch)
tree4d57cae700025f1aa49bf67e8686664903208c2c /mppa_k1c/ValueAOp.v
parentf9b5ef305997c22b505865f2a2334b56115426b6 (diff)
downloadcompcert-kvx-ea45404a7ad40e952e0e4c415bdd1b7670ee515a.tar.gz
compcert-kvx-ea45404a7ad40e952e0e4c415bdd1b7670ee515a.zip
progressing on select/selectl
Diffstat (limited to 'mppa_k1c/ValueAOp.v')
-rw-r--r--mppa_k1c/ValueAOp.v11
1 files changed, 11 insertions, 0 deletions
diff --git a/mppa_k1c/ValueAOp.v b/mppa_k1c/ValueAOp.v
index fb1977ea..7f599840 100644
--- a/mppa_k1c/ValueAOp.v
+++ b/mppa_k1c/ValueAOp.v
@@ -41,6 +41,15 @@ Definition eval_static_addressing (addr: addressing) (vl: list aval): aval :=
| _, _ => Vbot
end.
+Definition select (v0 v1 vselect : aval) : aval :=
+ match vselect with
+ | I iselect =>
+ if Int.eq iselect Int.zero
+ then v0
+ else v1
+ | _ => Vbot
+ end.
+
Definition eval_static_operation (op: operation) (vl: list aval): aval :=
match op, vl with
| Omove, v1::nil => v1
@@ -165,6 +174,8 @@ Definition eval_static_operation (op: operation) (vl: list aval): aval :=
| Osingleoflong, v1::nil => singleoflong v1
| Osingleoflongu, v1::nil => singleoflongu v1
| Ocmp c, _ => of_optbool (eval_static_condition c vl)
+ | Oselect, v0::v1::vselect::nil => select v0 v1 vselect
+ | Oselectl, v0::v1::vselect::nil => select v0 v1 vselect
| _, _ => Vbot
end.