Skip to content

Commit 0b927a1

Browse files
author
xleroy
committed
ia32/Select*: complete the modifications to shifts.
Makefile: missing "clean" actions. Makefile/pg/coq: honor $COQBIN if set (as suggested by P. Boutillier) to facilitate testing with different Coq versions. git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2453 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
1 parent 336a1f9 commit 0b927a1

File tree

5 files changed

+30
-21
lines changed

5 files changed

+30
-21
lines changed

Diff for: Makefile

+8-7
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ COQINCLUDES=$(foreach d, $(RECDIRS), -R $(d) -as compcert.$(d)) \
2626

2727
CAMLINCLUDES=$(patsubst %,-I %, $(DIRS)) -I extraction -I cparser
2828

29-
COQC=coqc -q $(COQINCLUDES)
30-
COQDEP=coqdep $(COQINCLUDES)
31-
COQDOC=coqdoc
32-
COQEXEC=coqtop $(COQINCLUDES) -batch -load-vernac-source
33-
COQCHK=coqchk $(COQINCLUDES)
29+
COQC="$(COQBIN)coqc" -q $(COQINCLUDES)
30+
COQDEP="$(COQBIN)coqdep" $(COQINCLUDES)
31+
COQDOC="$(COQBIN)coqdoc"
32+
COQEXEC="$(COQBIN)coqtop" $(COQINCLUDES) -batch -load-vernac-source
33+
COQCHK="$(COQBIN)coqchk" $(COQINCLUDES)
3434

3535
OCAMLBUILD=ocamlbuild
3636
OCB_OPTIONS=\
@@ -243,10 +243,11 @@ clean:
243243
rm -f ccomp ccomp.byte cchecklink cchecklink.byte clightgen clightgen.byte
244244
rm -rf _build
245245
rm -rf doc/html doc/*.glob
246-
rm -f doc/coq2html.ml doc/coq2html
246+
rm -f doc/coq2html.ml doc/coq2html doc/*.cm? doc/*.o
247247
rm -f driver/Configuration.ml
248248
rm -f extraction/STAMP extraction/*.ml extraction/*.mli
249-
rm -f tools/ndfun
249+
rm -f tools/ndfun tools/*.cm? tools/*.o
250+
rm -f $(ARCH)/ConstpropOp.v $(ARCH)/SelectOp.v backend/SelectDiv.v backend/SelectLong.v
250251
$(MAKE) -C runtime clean
251252
$(MAKE) -C test clean
252253

Diff for: coq

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ make -q ${1}o || {
1212
done)
1313
}
1414

15-
coqide $INCLUDES $1 && make ${1}o
15+
"${COQBIN}coqide" $INCLUDES $1 && make ${1}o

Diff for: ia32/SelectOp.vp

+4-4
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,9 @@ Definition shift_is_scale (n: int) : bool :=
144144
Int.eq n (Int.repr 1) || Int.eq n (Int.repr 2) || Int.eq n (Int.repr 3).
145145

146146
Nondetfunction shlimm (e1: expr) (n: int) :=
147-
if Int.eq n Int.zero then e1
147+
if Int.eq n Int.zero then e1 else
148148
if negb (Int.ltu n Int.iwordsize) then
149-
Eop Oshl (e1:::Eop (Ointconst n):::Enil)
149+
Eop Oshl (e1:::Eop (Ointconst n) Enil:::Enil)
150150
else
151151
match e1 with
152152
| Eop (Ointconst n1) Enil =>
@@ -168,7 +168,7 @@ Nondetfunction shlimm (e1: expr) (n: int) :=
168168
Nondetfunction shruimm (e1: expr) (n: int) :=
169169
if Int.eq n Int.zero then e1 else
170170
if negb (Int.ltu n Int.iwordsize) then
171-
Eop Oshru (e1:::Eop (Ointconst n):::Enil)
171+
Eop Oshru (e1:::Eop (Ointconst n) Enil:::Enil)
172172
else
173173
match e1 with
174174
| Eop (Ointconst n1) Enil =>
@@ -184,7 +184,7 @@ Nondetfunction shruimm (e1: expr) (n: int) :=
184184
Nondetfunction shrimm (e1: expr) (n: int) :=
185185
if Int.eq n Int.zero then e1 else
186186
if negb (Int.ltu n Int.iwordsize) then
187-
Eop Oshr (e1:::Eop (Ointconst n):::Enil)
187+
Eop Oshr (e1:::Eop (Ointconst n) Enil:::Enil)
188188
else
189189
match e1 with
190190
| Eop (Ointconst n1) Enil =>

Diff for: ia32/SelectOpproof.v

+16-8
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,10 @@ Proof.
213213
red; intros until x. unfold shlimm.
214214
predSpec Int.eq Int.eq_spec n Int.zero.
215215
intros; subst. exists x; split; auto. destruct x; simpl; auto. rewrite Int.shl_zero; auto.
216+
destruct (Int.ltu n Int.iwordsize) eqn:LT; simpl.
216217
destruct (shlimm_match a); intros; InvEval.
217218
exists (Vint (Int.shl n1 n)); split. EvalOp.
218-
simpl. destruct (Int.ltu n Int.iwordsize); auto.
219+
simpl. rewrite LT. auto.
219220
destruct (Int.ltu (Int.add n n1) Int.iwordsize) eqn:?.
220221
exists (Val.shl v1 (Vint (Int.add n n1))); split. EvalOp.
221222
subst. destruct v1; simpl; auto.
@@ -227,14 +228,16 @@ Proof.
227228
simpl. auto.
228229
subst. destruct (shift_is_scale n).
229230
econstructor; split. EvalOp. simpl. eauto.
230-
destruct v1; simpl; auto. destruct (Int.ltu n Int.iwordsize); auto.
231+
destruct v1; simpl; auto. rewrite LT.
231232
rewrite Int.shl_mul. rewrite Int.mul_add_distr_l. rewrite (Int.shl_mul n1). auto.
232233
TrivialExists. econstructor. EvalOp. simpl; eauto. constructor. auto.
233234
destruct (shift_is_scale n).
234235
econstructor; split. EvalOp. simpl. eauto.
235-
destruct x; simpl; auto. destruct (Int.ltu n Int.iwordsize); auto.
236+
destruct x; simpl; auto. rewrite LT.
236237
rewrite Int.add_zero. rewrite Int.shl_mul. auto.
237238
TrivialExists.
239+
intros; TrivialExists. constructor. eauto. constructor. EvalOp. simpl; eauto. constructor.
240+
auto.
238241
Qed.
239242

240243
Theorem eval_shruimm:
@@ -244,19 +247,21 @@ Proof.
244247
red; intros until x. unfold shruimm.
245248
predSpec Int.eq Int.eq_spec n Int.zero.
246249
intros; subst. exists x; split; auto. destruct x; simpl; auto. rewrite Int.shru_zero; auto.
250+
destruct (Int.ltu n Int.iwordsize) eqn:LT; simpl.
247251
destruct (shruimm_match a); intros; InvEval.
248252
exists (Vint (Int.shru n1 n)); split. EvalOp.
249-
simpl. destruct (Int.ltu n Int.iwordsize); auto.
253+
simpl. rewrite LT; auto.
250254
destruct (Int.ltu (Int.add n n1) Int.iwordsize) eqn:?.
251255
exists (Val.shru v1 (Vint (Int.add n n1))); split. EvalOp.
252256
subst. destruct v1; simpl; auto.
253257
rewrite Heqb.
254258
destruct (Int.ltu n1 Int.iwordsize) eqn:?; simpl; auto.
255-
destruct (Int.ltu n Int.iwordsize) eqn:?; simpl; auto.
256-
rewrite Int.add_commut. rewrite Int.shru_shru; auto. rewrite Int.add_commut; auto.
259+
rewrite LT. rewrite Int.add_commut. rewrite Int.shru_shru; auto. rewrite Int.add_commut; auto.
257260
subst. TrivialExists. econstructor. EvalOp. simpl; eauto. constructor.
258261
simpl. auto.
259262
TrivialExists.
263+
intros; TrivialExists. constructor. eauto. constructor. EvalOp. simpl; eauto. constructor.
264+
auto.
260265
Qed.
261266

262267
Theorem eval_shrimm:
@@ -266,19 +271,22 @@ Proof.
266271
red; intros until x. unfold shrimm.
267272
predSpec Int.eq Int.eq_spec n Int.zero.
268273
intros; subst. exists x; split; auto. destruct x; simpl; auto. rewrite Int.shr_zero; auto.
274+
destruct (Int.ltu n Int.iwordsize) eqn:LT; simpl.
269275
destruct (shrimm_match a); intros; InvEval.
270276
exists (Vint (Int.shr n1 n)); split. EvalOp.
271-
simpl. destruct (Int.ltu n Int.iwordsize); auto.
277+
simpl. rewrite LT; auto.
272278
destruct (Int.ltu (Int.add n n1) Int.iwordsize) eqn:?.
273279
exists (Val.shr v1 (Vint (Int.add n n1))); split. EvalOp.
274280
subst. destruct v1; simpl; auto.
275281
rewrite Heqb.
276282
destruct (Int.ltu n1 Int.iwordsize) eqn:?; simpl; auto.
277-
destruct (Int.ltu n Int.iwordsize) eqn:?; simpl; auto.
283+
rewrite LT.
278284
rewrite Int.add_commut. rewrite Int.shr_shr; auto. rewrite Int.add_commut; auto.
279285
subst. TrivialExists. econstructor. EvalOp. simpl; eauto. constructor.
280286
simpl. auto.
281287
TrivialExists.
288+
intros; TrivialExists. constructor. eauto. constructor. EvalOp. simpl; eauto. constructor.
289+
auto.
282290
Qed.
283291

284292
Lemma eval_mulimm_base:

Diff for: pg

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ make -q ${1}o || {
1313
done)
1414
}
1515

16-
COQPROGNAME="coqtop"
16+
COQPROGNAME="${COQBIN}coqtop"
1717

1818
COQPROGARGS=""
1919
for arg in $INCLUDES; do

0 commit comments

Comments
 (0)