aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arm/SelectOp.vp9
-rw-r--r--arm/SelectOpproof.v4
-rw-r--r--backend/Selectionaux.ml5
3 files changed, 14 insertions, 4 deletions
diff --git a/arm/SelectOp.vp b/arm/SelectOp.vp
index 61ea6283..d04832d6 100644
--- a/arm/SelectOp.vp
+++ b/arm/SelectOp.vp
@@ -383,7 +383,14 @@ Definition compfs (c: comparison) (e1: expr) (e2: expr) :=
Eop (Ocmp (Ccompfs c)) (e1 ::: e2 ::: Enil).
Definition select (ty: typ) (cond: condition) (args: exprlist) (e1 e2: expr) :=
- Some (Eop (Osel cond ty) (e1 ::: e2 ::: args)).
+ if match ty with
+ | Tint => true
+ | Tfloat => true
+ | Tsingle => true
+ | _ => false
+ end
+ then Some (Eop (Osel cond ty) (e1 ::: e2 ::: args))
+ else None.
(** ** Integer conversions *)
diff --git a/arm/SelectOpproof.v b/arm/SelectOpproof.v
index f281f7ce..8b546971 100644
--- a/arm/SelectOpproof.v
+++ b/arm/SelectOpproof.v
@@ -746,7 +746,9 @@ Theorem eval_select:
eval_expr ge sp e m le a v
/\ Val.lessdef (Val.select (Some b) v1 v2 ty) v.
Proof.
- unfold select; intros; inv H. rewrite <- H3; TrivialExists.
+ unfold select; intros.
+ destruct (match ty with Tint | Tfloat | Tsingle => true | _ => false end); inv H.
+ rewrite <- H3; TrivialExists.
Qed.
Theorem eval_cast8signed: unary_constructor_sound cast8signed (Val.sign_ext 8).
diff --git a/backend/Selectionaux.ml b/backend/Selectionaux.ml
index 1b92f5fe..52ddd799 100644
--- a/backend/Selectionaux.ml
+++ b/backend/Selectionaux.ml
@@ -68,9 +68,10 @@ let rec cost_expr = function
let fast_cmove ty =
match Configuration.arch, Configuration.model with
- | "arm", _ -> true
+ | "arm", _ ->
+ (match ty with Tint | Tfloat | Tsingle -> true | _ -> false)
| "powerpc", "e5500" ->
- (match ty with Tint -> true | Tlong -> true | _ -> false)
+ (match ty with Tint | Tlong -> true | _ -> false)
| "powerpc", _ -> false
| "riscV", _ -> false
| "x86", _ ->