aboutsummaryrefslogtreecommitdiffstats
path: root/riscV/SelectOp.vp
diff options
context:
space:
mode:
authorDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2021-02-02 13:07:56 +0100
committerDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2021-02-02 13:07:56 +0100
commit7afc85c95aaec5cc0935733cac487e13f114cc46 (patch)
tree7570beb0341a7bf2f2ecf923848552a7d8bfc3e3 /riscV/SelectOp.vp
parent5afebe369cea7f2746dec7c64514822562e9100e (diff)
downloadcompcert-kvx-7afc85c95aaec5cc0935733cac487e13f114cc46.tar.gz
compcert-kvx-7afc85c95aaec5cc0935733cac487e13f114cc46.zip
cmov on integers
Diffstat (limited to 'riscV/SelectOp.vp')
-rw-r--r--riscV/SelectOp.vp10
1 files changed, 8 insertions, 2 deletions
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 *)