aboutsummaryrefslogtreecommitdiffstats
path: root/arm
diff options
context:
space:
mode:
authorDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-09-23 19:48:20 +0200
committerDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-09-23 19:48:20 +0200
commitc7156a4fd9c449c7610942a2fbf1e0908459b7f6 (patch)
tree50460a87be5baffd5aa8e32c71d4be3ccb980c8d /arm
parenta8e2039a772da0fcfd484b7445de8cc093be5d2b (diff)
downloadcompcert-kvx-c7156a4fd9c449c7610942a2fbf1e0908459b7f6.tar.gz
compcert-kvx-c7156a4fd9c449c7610942a2fbf1e0908459b7f6.zip
add: non trapping ops
Diffstat (limited to 'arm')
-rw-r--r--arm/Op.v26
1 files changed, 26 insertions, 0 deletions
diff --git a/arm/Op.v b/arm/Op.v
index 9de365e9..671bdbe4 100644
--- a/arm/Op.v
+++ b/arm/Op.v
@@ -518,6 +518,32 @@ Proof with (try exact I; try reflexivity).
unfold Val.select. destruct (eval_condition c vl m). apply Val.normalize_type. exact I.
Qed.
+
+Definition is_trapping_op (op : operation) :=
+ match op with
+ | Odiv | Odivu
+ | Oshrximm _
+ | Ointoffloat | Ointuoffloat
+ | Ointofsingle | Ointuofsingle
+ | Ofloatofint | Ofloatofintu
+ | Osingleofint | Osingleofintu => true
+ | _ => false
+ end.
+
+
+Lemma is_trapping_op_sound:
+ forall op vl sp m,
+ op <> Omove ->
+ is_trapping_op op = false ->
+ (List.length vl) = (List.length (fst (type_of_operation op))) ->
+ eval_operation genv sp op vl m <> None.
+Proof.
+ destruct op; intros; simpl in *; try congruence.
+ all: try (destruct vl as [ | vh1 vl1]; try discriminate).
+ all: try (destruct vl1 as [ | vh2 vl2]; try discriminate).
+ all: try (destruct vl2 as [ | vh3 vl3]; try discriminate).
+ all: try (destruct vl3 as [ | vh4 vl4]; try discriminate).
+Qed.
End SOUNDNESS.
(** * Manipulating and transforming operations *)