diff options
author | Cyril SIX <cyril.six@kalray.eu> | 2020-01-22 16:42:23 +0100 |
---|---|---|
committer | Cyril SIX <cyril.six@kalray.eu> | 2020-01-22 16:42:23 +0100 |
commit | 89e029310d175ee7ddbb157494bac46a08304b19 (patch) | |
tree | bd516047d1cea2be0141d00c1a18e440f4f368aa /arm | |
parent | 60c15c9d1105dc2e53c17b3fb28ee9cc4716cbc6 (diff) | |
parent | fd2181ce5f6a3a5ba27349d1642ee4c59a6d9b34 (diff) | |
download | compcert-kvx-89e029310d175ee7ddbb157494bac46a08304b19.tar.gz compcert-kvx-89e029310d175ee7ddbb157494bac46a08304b19.zip |
Merge branch 'mppa-work' into mppa-duplicate-oracle
Diffstat (limited to 'arm')
-rw-r--r-- | arm/Asmgen.v | 3 | ||||
-rw-r--r-- | arm/Asmgenproof1.v | 24 |
2 files changed, 24 insertions, 3 deletions
diff --git a/arm/Asmgen.v b/arm/Asmgen.v index 016a1c5a..f428feea 100644 --- a/arm/Asmgen.v +++ b/arm/Asmgen.v @@ -481,6 +481,9 @@ Definition transl_op do r <- ireg_of res; do r1 <- ireg_of a1; if Int.eq n Int.zero then OK (Pmov r (SOreg r1) :: k) + else if Int.eq n Int.one then + OK (Padd IR14 r1 (SOlsr r1 (Int.repr 31)) :: + Pmov r (SOasr IR14 n) :: k) else OK (Pmov IR14 (SOasr r1 (Int.repr 31)) :: Padd IR14 r1 (SOlsr IR14 (Int.sub Int.iwordsize n)) :: diff --git a/arm/Asmgenproof1.v b/arm/Asmgenproof1.v index 7ef7b776..cdac697e 100644 --- a/arm/Asmgenproof1.v +++ b/arm/Asmgenproof1.v @@ -1264,15 +1264,32 @@ Local Transparent destroyed_by_op. destruct (rs x0) eqn: X0; simpl in H0; try discriminate. destruct (Int.ltu i (Int.repr 31)) eqn: LTU; inv H0. revert EQ2. predSpec Int.eq Int.eq_spec i Int.zero; intros EQ2. + { (* i = 0 *) inv EQ2. econstructor. split. apply exec_straight_one. simpl. reflexivity. auto. split. Simpl. unfold Int.shrx. rewrite Int.shl_zero. unfold Int.divs. change (Int.signed Int.one) with 1. rewrite Z.quot_1_r. rewrite Int.repr_signed. auto. intros. Simpl. - (* i <> 0 *) - inv EQ2. - assert (LTU': Int.ltu (Int.sub Int.iwordsize i) Int.iwordsize = true). + } + { (* i <> 0 *) + revert EQ2. predSpec Int.eq Int.eq_spec i Int.one; intros EQ2. + { + inv EQ2. + econstructor; split. + eapply exec_straight_two; simpl; reflexivity. + split. + { rewrite X0. + rewrite Int.shrx1_shr by reflexivity. + Simpl. + } + { intros. + Simpl. + } + } + clear H0. + inv EQ2. + assert (LTU': Int.ltu (Int.sub Int.iwordsize i) Int.iwordsize = true). { generalize (Int.ltu_inv _ _ LTU). intros. unfold Int.sub, Int.ltu. rewrite Int.unsigned_repr_wordsize. @@ -1306,6 +1323,7 @@ Local Transparent destroyed_by_op. rewrite LTU'; simpl. rewrite LTU''; simpl. f_equal. symmetry. apply Int.shrx_shr_2. assumption. intros. unfold rs3; Simpl. unfold rs2; Simpl. unfold rs1; Simpl. + } (* intoffloat *) econstructor; split. apply exec_straight_one; simpl. rewrite H0; simpl. eauto. auto. Transparent destroyed_by_op. |