aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-04-04 21:31:36 +0200
committerDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2019-04-04 21:31:36 +0200
commit71c38724bee43fe1a2ce67ee51f09478cd167929 (patch)
tree60eaeefe805f8829b833cea6d966ee79ccf08dea
parent60ff9fd4c1387bf46fa702d564cfbba44a4f83ea (diff)
downloadcompcert-kvx-71c38724bee43fe1a2ce67ee51f09478cd167929.tar.gz
compcert-kvx-71c38724bee43fe1a2ce67ee51f09478cd167929.zip
Oselect
-rw-r--r--mppa_k1c/Asmblockgen.v12
-rw-r--r--mppa_k1c/Asmblockgenproof1.v9
2 files changed, 16 insertions, 5 deletions
diff --git a/mppa_k1c/Asmblockgen.v b/mppa_k1c/Asmblockgen.v
index ad01ff89..722c4acc 100644
--- a/mppa_k1c/Asmblockgen.v
+++ b/mppa_k1c/Asmblockgen.v
@@ -729,7 +729,17 @@ Definition transl_op
do rd <- ireg_of res;
transl_cond_op cmp rd args k
- | Oselect, a0 :: a1 :: aS :: nil
+ | Oselect cond, a0 :: a1 :: aS :: nil =>
+ assertion (mreg_eq a0 res);
+ do r0 <- ireg_of a0;
+ do r1 <- ireg_of a1;
+ do rS <- ireg_of aS;
+ (match cond with
+ | Ccomp0 cmp =>
+ OK (Pcmove (btest_for_cmpswz cmp) r0 rS r1 ::i k)
+ | _ => Error (msg "Asmblockgen Oselect")
+ end)
+
| Oselectl, a0 :: a1 :: aS :: nil
| Oselectf, a0 :: a1 :: aS :: nil
| Oselectfs, a0 :: a1 :: aS :: nil =>
diff --git a/mppa_k1c/Asmblockgenproof1.v b/mppa_k1c/Asmblockgenproof1.v
index 698d64d6..e8e04019 100644
--- a/mppa_k1c/Asmblockgenproof1.v
+++ b/mppa_k1c/Asmblockgenproof1.v
@@ -1638,17 +1638,18 @@ Opaque Int.eq.
exploit transl_cond_op_correct; eauto. intros (rs' & A & B & C).
exists rs'; split. eexact A. eauto with asmgen.
- (* Oselect *)
+ destruct cond in *; simpl in *; try congruence; injection EQ3; clear EQ3; intro Hrew; rewrite <- Hrew in *.
econstructor; split.
+
+ eapply exec_straight_one.
simpl; reflexivity.
+ split.
* unfold eval_select.
- destruct (rs x1) eqn:eqX1; try constructor.
destruct (rs x) eqn:eqX; try constructor.
destruct (rs x0) eqn:eqX0; try constructor.
- simpl.
- rewrite int_eq_comm.
- destruct (Int.eq i Int.zero); simpl; rewrite Pregmap.gss; constructor.
+ destruct c0 in *; simpl;
+ destruct (Val.cmp_bool _ _); simpl; try constructor;
+ destruct b; simpl; rewrite Pregmap.gss; constructor.
* intros.
rewrite Pregmap.gso; congruence.
- (* Oselectl *)