diff options
author | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2019-05-02 10:21:09 +0200 |
---|---|---|
committer | David Monniaux <david.monniaux@univ-grenoble-alpes.fr> | 2019-05-02 10:21:09 +0200 |
commit | c56f9a47fe1837b7afb73c2c24aed9228bc0db08 (patch) | |
tree | 7a54af89b5b284512a4ff116c3c596db669cb1b3 | |
parent | 8058d6a89fe0cfda16f685ef5a96793b95cc4156 (diff) | |
download | compcert-kvx-c56f9a47fe1837b7afb73c2c24aed9228bc0db08.tar.gz compcert-kvx-c56f9a47fe1837b7afb73c2c24aed9228bc0db08.zip |
allow disabling + xx global symbols
-rw-r--r-- | mppa_k1c/SelectLong.vp | 5 | ||||
-rw-r--r-- | mppa_k1c/SelectLongproof.v | 8 |
2 files changed, 9 insertions, 4 deletions
diff --git a/mppa_k1c/SelectLong.vp b/mppa_k1c/SelectLong.vp index 3b9e5bf9..717b0120 100644 --- a/mppa_k1c/SelectLong.vp +++ b/mppa_k1c/SelectLong.vp @@ -70,7 +70,10 @@ Nondetfunction addlimm (n: int64) (e: expr) := if Int64.eq n Int64.zero then e else match e with | Eop (Olongconst m) Enil => longconst (Int64.add n m) - | Eop (Oaddrsymbol s m) Enil => Eop (Oaddrsymbol s (Ptrofs.add (Ptrofs.of_int64 n) m)) Enil + | Eop (Oaddrsymbol s m) Enil => + (if Compopts.optim_fglobaladdroffset tt + then Eop (Oaddrsymbol s (Ptrofs.add (Ptrofs.of_int64 n) m)) Enil + else Eop (Oaddlimm n) (e ::: Enil)) | Eop (Oaddrstack m) Enil => Eop (Oaddrstack (Ptrofs.add (Ptrofs.of_int64 n) m)) Enil | Eop (Oaddlimm m) (t ::: Enil) => Eop (Oaddlimm(Int64.add n m)) (t ::: Enil) | _ => Eop (Oaddlimm n) (e ::: Enil) diff --git a/mppa_k1c/SelectLongproof.v b/mppa_k1c/SelectLongproof.v index cf8eed2b..3b724c01 100644 --- a/mppa_k1c/SelectLongproof.v +++ b/mppa_k1c/SelectLongproof.v @@ -127,9 +127,11 @@ Proof. destruct x; simpl; rewrite ?Int64.add_zero, ?Ptrofs.add_zero; auto. destruct (addlimm_match a); InvEval. - econstructor; split. apply eval_longconst. rewrite Int64.add_commut; auto. -- econstructor; split. EvalOp. simpl; eauto. - unfold Genv.symbol_address. destruct (Genv.find_symbol ge s); simpl; auto. - destruct Archi.ptr64; auto. rewrite Ptrofs.add_commut; auto. +- destruct (Compopts.optim_fglobaladdroffset _). + + econstructor; split. EvalOp. simpl; eauto. + unfold Genv.symbol_address. destruct (Genv.find_symbol ge s); simpl; auto. + destruct Archi.ptr64; auto. rewrite Ptrofs.add_commut; auto. + + TrivialExists. repeat econstructor. simpl. trivial. - econstructor; split. EvalOp. simpl; eauto. destruct sp; simpl; auto. destruct Archi.ptr64; auto. rewrite Ptrofs.add_assoc, (Ptrofs.add_commut m0). auto. |