aboutsummaryrefslogtreecommitdiffstats
path: root/powerpc/NeedOp.v
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@college-de-france.fr>2019-04-14 10:47:14 +0200
committerXavier Leroy <xavierleroy@users.noreply.github.com>2019-05-20 18:00:46 +0200
commit43e7b6702a76306f20687bc9aba93ae465d6e4be (patch)
tree48531b9f57986b01315d2b3f87f8ac43b72c4c42 /powerpc/NeedOp.v
parent72ab6ad1dcf13dd61d3bdb896660b0f399e9f8a5 (diff)
downloadcompcert-kvx-43e7b6702a76306f20687bc9aba93ae465d6e4be.tar.gz
compcert-kvx-43e7b6702a76306f20687bc9aba93ae465d6e4be.zip
Implement a `Osel` operation for PowerPC
This operation compiles down to an `isel` instruction (conditional move). The semantics is given by `Val.select`.
Diffstat (limited to 'powerpc/NeedOp.v')
-rw-r--r--powerpc/NeedOp.v5
1 files changed, 5 insertions, 0 deletions
diff --git a/powerpc/NeedOp.v b/powerpc/NeedOp.v
index 9a579cc5..5ea09bd8 100644
--- a/powerpc/NeedOp.v
+++ b/powerpc/NeedOp.v
@@ -65,6 +65,7 @@ Definition needs_of_operation (op: operation) (nv: nval): list nval :=
| Ofloatofwords | Omakelong => op2 (default nv)
| Olowlong | Ohighlong => op1 (default nv)
| Ocmp c => needs_of_condition c
+ | Osel c ty => nv :: nv :: needs_of_condition c
end.
Definition operation_is_redundant (op: operation) (nv: nval): bool :=
@@ -147,6 +148,10 @@ Proof.
erewrite needs_of_condition_sound by eauto.
subst v; simpl. auto with na.
subst v; auto with na.
+- destruct (eval_condition c args m) as [b|] eqn:EC.
+ erewrite needs_of_condition_sound by eauto.
+ apply select_sound; auto.
+ simpl; auto with na.
Qed.
Lemma operation_is_redundant_sound: