From 49342474c19558709c8cea6d70eaba9a4dd7a150 Mon Sep 17 00:00:00 2001 From: Xavier Leroy Date: Mon, 15 Apr 2019 17:50:30 +0200 Subject: Implement a `Osel` operation for ARM The operation comples down to conditional moves. Both integer and floating-point conditional moves are supported. --- arm/SelectOpproof.v | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'arm/SelectOpproof.v') diff --git a/arm/SelectOpproof.v b/arm/SelectOpproof.v index d4aac9b6..f281f7ce 100644 --- a/arm/SelectOpproof.v +++ b/arm/SelectOpproof.v @@ -735,6 +735,20 @@ Proof. intros; red; intros. unfold compfs. TrivialExists. 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; inv H. rewrite <- H3; TrivialExists. +Qed. + Theorem eval_cast8signed: unary_constructor_sound cast8signed (Val.sign_ext 8). Proof. red; intros until x. unfold cast8signed; case (cast8signed_match a); intros. -- cgit From b7e0d70de2ace6f0a22f9f65cc244d875ee48496 Mon Sep 17 00:00:00 2001 From: Xavier Leroy Date: Sat, 1 Jun 2019 08:48:20 +0200 Subject: ARM: select is not supported at type Tlong --- arm/SelectOpproof.v | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'arm/SelectOpproof.v') diff --git a/arm/SelectOpproof.v b/arm/SelectOpproof.v index f281f7ce..8b546971 100644 --- a/arm/SelectOpproof.v +++ b/arm/SelectOpproof.v @@ -746,7 +746,9 @@ Theorem eval_select: eval_expr ge sp e m le a v /\ Val.lessdef (Val.select (Some b) v1 v2 ty) v. Proof. - unfold select; intros; inv H. rewrite <- H3; TrivialExists. + unfold select; intros. + destruct (match ty with Tint | Tfloat | Tsingle => true | _ => false end); inv H. + rewrite <- H3; TrivialExists. Qed. Theorem eval_cast8signed: unary_constructor_sound cast8signed (Val.sign_ext 8). -- cgit