diff options
author | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2019-09-24 16:51:11 +0200 |
---|---|---|
committer | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2019-09-24 16:51:11 +0200 |
commit | d315994f2d3dbec0bf66a430284eab00dd1d4a18 (patch) | |
tree | c9bcc65bbb1216260b1cf1967e9491ee1d2de53f /powerpc/Op.v | |
parent | fc163ce14ade2df04c55cce6475eb12738157fb6 (diff) | |
download | compcert-kvx-d315994f2d3dbec0bf66a430284eab00dd1d4a18.tar.gz compcert-kvx-d315994f2d3dbec0bf66a430284eab00dd1d4a18.zip |
trapping ops
Diffstat (limited to 'powerpc/Op.v')
-rw-r--r-- | powerpc/Op.v | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/powerpc/Op.v b/powerpc/Op.v index cbd0291b..b73cb14b 100644 --- a/powerpc/Op.v +++ b/powerpc/Op.v @@ -581,6 +581,30 @@ 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 | Odivl | Odivu | Odivlu + | Oshrximm _ | Oshrxlimm _ + | Ointoffloat | Ointuoffloat + | Ofloatofint | Ofloatofintu + | Olongoffloat + | Ofloatoflong => 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 *) |