summaryrefslogtreecommitdiff
path: root/powerpc/SelectOp.vp
diff options
context:
space:
mode:
Diffstat (limited to 'powerpc/SelectOp.vp')
-rw-r--r--powerpc/SelectOp.vp7
1 files changed, 7 insertions, 0 deletions
diff --git a/powerpc/SelectOp.vp b/powerpc/SelectOp.vp
index 290704b..943c400 100644
--- a/powerpc/SelectOp.vp
+++ b/powerpc/SelectOp.vp
@@ -460,3 +460,10 @@ Nondetfunction addressing (chunk: memory_chunk) (e: expr) :=
| _ => (Aindexed Int.zero, e:::Enil)
end.
+(** ** Turning an expression into a condition *)
+
+Nondetfunction cond_of_expr (e: expr) :=
+ match e with
+ | Eop (Oandimm n) (t1:::Enil) => (Cmasknotzero n, t1:::Enil)
+ | _ => (Ccompuimm Cne Int.zero, e:::Enil)
+ end.