From 7afc85c95aaec5cc0935733cac487e13f114cc46 Mon Sep 17 00:00:00 2001 From: David Monniaux Date: Tue, 2 Feb 2021 13:07:56 +0100 Subject: cmov on integers --- riscV/SelectOp.vp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'riscV/SelectOp.vp') diff --git a/riscV/SelectOp.vp b/riscV/SelectOp.vp index 0596ebf6..0e82f8ba 100644 --- a/riscV/SelectOp.vp +++ b/riscV/SelectOp.vp @@ -421,11 +421,17 @@ Definition floatofsingle (e: expr) := Eop Ofloatofsingle (e ::: Enil). Definition select (ty: typ) (cond: condition) (args: exprlist) (e1 e2: expr) : option expr - := match ty with + := if Archi.ptr64 then + match ty with | Tlong => Some (Eop Oselectl ((Eop (Ocmp cond) args) ::: e1 ::: e2 ::: Enil)) + | Tint => Some (Eop Olowlong ((Eop Oselectl + ((Eop (Ocmp cond) args) ::: + (Eop Ocast32signed (e1 ::: Enil)) ::: + (Eop Ocast32signed (e2 ::: Enil)) ::: Enil)) ::: Enil)) | _ => None - end. + end + else None. (** ** Recognition of addressing modes for load and store operations *) -- cgit