aboutsummaryrefslogtreecommitdiffstats
path: root/arm/Asmgenproof1.v
diff options
context:
space:
mode:
authorDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2020-01-14 23:37:20 +0100
committerDavid Monniaux <david.monniaux@univ-grenoble-alpes.fr>2020-01-14 23:37:20 +0100
commit9475c5637c5d650f43955abe8f995797893affe1 (patch)
treea2993fa705e3d069ce280958df5e10f6f52d15fa /arm/Asmgenproof1.v
parentb92d5a32c314eee0c68a70c33f1847545aabeb19 (diff)
downloadcompcert-kvx-9475c5637c5d650f43955abe8f995797893affe1.tar.gz
compcert-kvx-9475c5637c5d650f43955abe8f995797893affe1.zip
ARM generation of 2-instruction signed division by 2 (as opposed to 3-instruction)
Diffstat (limited to 'arm/Asmgenproof1.v')
-rw-r--r--arm/Asmgenproof1.v24
1 files changed, 21 insertions, 3 deletions
diff --git a/arm/Asmgenproof1.v b/arm/Asmgenproof1.v
index 807e069d..2b125cda 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.