aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-05-12 13:01:06 +0200
committerDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-05-12 13:01:06 +0200
commit26428dbaa2f3fec4b8fd121fc6e53a22a5cc5c5d (patch)
tree0616fd301849bf52871be031ccd8b70cd3c4eef6
parent644814b1b266f5492e6ffd24776fc87c30acd57b (diff)
downloadcompcert-kvx-26428dbaa2f3fec4b8fd121fc6e53a22a5cc5c5d.tar.gz
compcert-kvx-26428dbaa2f3fec4b8fd121fc6e53a22a5cc5c5d.zip
standardization of expressions
-rw-r--r--mppa_k1c/Op.v8
-rw-r--r--mppa_k1c/ValueAOp.v10
2 files changed, 8 insertions, 10 deletions
diff --git a/mppa_k1c/Op.v b/mppa_k1c/Op.v
index 98635677..4df157b0 100644
--- a/mppa_k1c/Op.v
+++ b/mppa_k1c/Op.v
@@ -408,8 +408,8 @@ Definition eval_operation
| Oneg, v1 :: nil => Some (Val.neg v1)
| Osub, v1 :: v2 :: nil => Some (Val.sub v1 v2)
| Orevsubimm n, v1 :: nil => Some (Val.sub (Vint n) v1)
- | Orevsubx shift, v1 :: v2 :: nil => Some (Val.sub v2 (Val.shl v1 (Vint (int_of_shift1_4 shift))))
- | Orevsubximm shift n, v1 :: nil => Some (Val.sub (Vint n) (Val.shl v1 (Vint (int_of_shift1_4 shift))))
+ | Orevsubx shift, v1 :: v2 :: nil => Some (ExtValues.revsubx (int_of_shift1_4 shift) v1 v2)
+ | Orevsubximm shift n, v1 :: nil => Some (ExtValues.revsubx (int_of_shift1_4 shift) v1 (Vint n))
| Omul, v1 :: v2 :: nil => Some (Val.mul v1 v2)
| Omulimm n, v1 :: nil => Some (Val.mul v1 (Vint n))
| Omulhs, v1::v2::nil => Some (Val.mulhs v1 v2)
@@ -459,8 +459,8 @@ Definition eval_operation
| Onegl, v1::nil => Some (Val.negl v1)
| Osubl, v1::v2::nil => Some (Val.subl v1 v2)
| Orevsublimm n, v1 :: nil => Some (Val.subl (Vlong n) v1)
- | Orevsubxl shift, v1 :: v2 :: nil => Some (Val.subl v2 (Val.shll v1 (Vint (int_of_shift1_4 shift))))
- | Orevsubxlimm shift n, v1 :: nil => Some (Val.subl (Vlong n) (Val.shll v1 (Vint (int_of_shift1_4 shift))))
+ | Orevsubxl shift, v1 :: v2 :: nil => Some (ExtValues.revsubxl (int_of_shift1_4 shift) v1 v2)
+ | Orevsubxlimm shift n, v1 :: nil => Some (ExtValues.revsubxl (int_of_shift1_4 shift) v1 (Vlong n))
| Omull, v1::v2::nil => Some (Val.mull v1 v2)
| Omullimm n, v1::nil => Some (Val.mull v1 (Vlong n))
| Omullhs, v1::v2::nil => Some (Val.mullhs v1 v2)
diff --git a/mppa_k1c/ValueAOp.v b/mppa_k1c/ValueAOp.v
index 10f25701..f41dae63 100644
--- a/mppa_k1c/ValueAOp.v
+++ b/mppa_k1c/ValueAOp.v
@@ -371,12 +371,11 @@ Theorem eval_static_operation_sound:
list_forall2 (vmatch bc) vargs aargs ->
vmatch bc vres (eval_static_operation op aargs).
Proof.
- unfold eval_operation, eval_static_operation, eval_static_select, eval_static_selectl, eval_static_selectf, eval_static_selectfs; intros.
+ unfold eval_operation, eval_static_operation, eval_static_select, eval_static_selectl, eval_static_selectf, eval_static_selectfs, addx, revsubx, addxl, revsubxl; intros.
destruct op; InvHyps; eauto with va.
- destruct (propagate_float_constants tt); constructor.
- destruct (propagate_float_constants tt); constructor.
- rewrite Ptrofs.add_zero_l; eauto with va.
- - unfold addx. eauto with va.
- replace(match Val.shl a1 (Vint (int_of_shift1_4 shift)) with
| Vint n2 => Vint (Int.add n n2)
| Vptr b2 ofs2 =>
@@ -389,12 +388,11 @@ Proof.
+ destruct a1; destruct shift; reflexivity.
- (*revsubimm*) inv H1; constructor.
- replace (match Val.shl a1 (Vint (int_of_shift1_4 shift)) with
- | Vint n2 => Vint (Int.sub n n2)
- | _ => Vundef
+ | Vint n2 => Vint (Int.sub n n2)
+ | _ => Vundef
end) with (Val.sub (Vint n) (Val.shl a1 (Vint (int_of_shift1_4 shift)))).
+ eauto with va.
- + destruct a1; destruct shift; reflexivity.
- - unfold addxl. eauto with va.
+ + destruct n; destruct shift; reflexivity.
- replace (match Val.shll a1 (Vint (int_of_shift1_4 shift)) with
| Vlong n2 => Vlong (Int64.add n n2)
| Vptr b2 ofs2 =>