From c36514ac4b05f78dd2e02fab3f8886cab8234925 Mon Sep 17 00:00:00 2001 From: Xavier Leroy Date: Sun, 26 May 2019 18:44:46 +0200 Subject: PowerPC: add SelectOp.select function This function and its proof should have been part of commit 43e7b67. They are already there for the other ports. --- powerpc/SelectOpproof.v | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'powerpc/SelectOpproof.v') diff --git a/powerpc/SelectOpproof.v b/powerpc/SelectOpproof.v index 5f87d9b9..5bf25722 100644 --- a/powerpc/SelectOpproof.v +++ b/powerpc/SelectOpproof.v @@ -1000,6 +1000,26 @@ Proof. exists (Val.singleoffloat v); split. EvalOp. inv D; auto. Qed. +Theorem eval_select: + forall le ty cond al vl a1 v1 a2 v2 a b, + select ty cond al a1 a2 = Some a -> + eval_exprlist ge sp e m le al vl -> + eval_expr ge sp e m le a1 v1 -> + eval_expr ge sp e m le a2 v2 -> + eval_condition cond vl m = Some b -> + exists v, + eval_expr ge sp e m le a v + /\ Val.lessdef (Val.select (Some b) v1 v2 ty) v. +Proof. + unfold select; intros. + destruct (match ty with Tint => true | Tlong => Archi.ppc64 | _ => false end); inv H. + exists (Val.select (Some b) v1 v2 ty); split. + apply eval_Eop with (v1 :: v2 :: vl). + constructor; auto. constructor; auto. + simpl. rewrite H3; auto. + auto. +Qed. + Theorem eval_addressing: forall le chunk a v b ofs, eval_expr ge sp e m le a v -> -- cgit From e10555313645cf3c35f244f42afa5a03fba2bac1 Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Tue, 28 May 2019 10:33:34 +0200 Subject: Provide a float select operation for PowerPC. (#173) The FP select for PowerPC stores both addresses in two subsequent stack slots and loads them using an offset created from the result of the comparison. --- powerpc/SelectOpproof.v | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'powerpc/SelectOpproof.v') diff --git a/powerpc/SelectOpproof.v b/powerpc/SelectOpproof.v index 5bf25722..5d7cd52b 100644 --- a/powerpc/SelectOpproof.v +++ b/powerpc/SelectOpproof.v @@ -1007,12 +1007,13 @@ Theorem eval_select: eval_expr ge sp e m le a1 v1 -> eval_expr ge sp e m le a2 v2 -> eval_condition cond vl m = Some b -> - exists v, + + exists v, eval_expr ge sp e m le a v /\ Val.lessdef (Val.select (Some b) v1 v2 ty) v. Proof. unfold select; intros. - destruct (match ty with Tint => true | Tlong => Archi.ppc64 | _ => false end); inv H. + destruct (match ty with Tint => true | Tfloat => true | Tsingle => true | Tlong => Archi.ppc64 | _ => false end); inv H. exists (Val.select (Some b) v1 v2 ty); split. apply eval_Eop with (v1 :: v2 :: vl). constructor; auto. constructor; auto. -- cgit