diff options
author | Léo Gourdin <leo.gourdin@lilo.org> | 2021-11-02 10:10:34 +0100 |
---|---|---|
committer | Léo Gourdin <leo.gourdin@lilo.org> | 2021-11-02 10:10:34 +0100 |
commit | 173e6c25b2937d6e6941973aa7b116e1d6405513 (patch) | |
tree | e5f63f343a3d1a1341dc2e8a09f6cdb706226de3 /backend/RTLTunnelingproof.v | |
parent | f9e4d91431334d88992e62a232a9e2ff2f6fcdc9 (diff) | |
download | compcert-kvx-173e6c25b2937d6e6941973aa7b116e1d6405513.tar.gz compcert-kvx-173e6c25b2937d6e6941973aa7b116e1d6405513.zip |
Porting the BTL non-trap loads approach to RTL
Diffstat (limited to 'backend/RTLTunnelingproof.v')
-rw-r--r-- | backend/RTLTunnelingproof.v | 78 |
1 files changed, 41 insertions, 37 deletions
diff --git a/backend/RTLTunnelingproof.v b/backend/RTLTunnelingproof.v index 0861143b..2cef08e2 100644 --- a/backend/RTLTunnelingproof.v +++ b/backend/RTLTunnelingproof.v @@ -452,43 +452,47 @@ Proof. rewrite <- EVAL. apply eval_operation_preserved. apply symbols_preserved. + apply match_states_intro; eauto. apply set_reg_lessdef. apply LD. apply RS. - (* Iload *) - exploit eval_addressing_lessdef; try eassumption. - apply reglist_lessdef. apply RS. - intros (ta & EVAL & LD). - exploit Mem.loadv_extends; try eassumption. - intros (tv & LOAD & LD'). - left. eexists. split. - + eapply exec_Iload. - * exploit instruction_type_preserved; (simpl; eauto)||congruence. - * rewrite <- EVAL. apply eval_addressing_preserved. apply symbols_preserved. - * apply LOAD. - + apply match_states_intro; try assumption. apply set_reg_lessdef. apply LD'. apply RS. - - (* Iload NOTRAP1 *) - exploit eval_addressing_lessdef_none; try eassumption. - apply reglist_lessdef; apply RS. - left. eexists. split. - + eapply exec_Iload_notrap1. - * exploit instruction_type_preserved; (simpl; eauto)||congruence. - * rewrite <- H1. apply eval_addressing_preserved. apply symbols_preserved. - + apply match_states_intro; try assumption. apply set_reg_lessdef. apply Val.lessdef_undef. apply RS. - - (* Iload NOTRAP2 *) - exploit eval_addressing_lessdef; try eassumption. - apply reglist_lessdef; apply RS. - intros (ta & EVAL & LD). - (* TODO: on peut sans doute factoriser ça *) - destruct (Mem.loadv chunk tm ta) eqn:Htload. - + left; eexists; split. - eapply exec_Iload. - * exploit instruction_type_preserved; (simpl; eauto)||congruence. - * rewrite <- EVAL. apply eval_addressing_preserved. apply symbols_preserved. - * apply Htload. - * apply match_states_intro; try assumption. apply set_reg_lessdef; eauto. - + left; eexists; split. - eapply exec_Iload_notrap2. - * exploit instruction_type_preserved; (simpl; eauto)||congruence. - * rewrite <- EVAL. apply eval_addressing_preserved. apply symbols_preserved. - * apply Htload. - * apply match_states_intro; try assumption. apply set_reg_lessdef; eauto. + inv H0. + + exploit eval_addressing_lessdef; try eassumption. + apply reglist_lessdef. apply RS. + intros (ta & EVAL' & LD). + exploit Mem.loadv_extends; try eassumption. + intros (tv & LOAD' & LD'). + left. eexists. split. + * eapply exec_Iload. + -- exploit instruction_type_preserved; (simpl; eauto)||congruence. + -- eapply has_loaded_normal; eauto. rewrite <- EVAL'. apply eval_addressing_preserved. apply symbols_preserved. + * apply match_states_intro; try assumption. apply set_reg_lessdef. apply LD'. apply RS. + + destruct (eval_addressing) eqn:EVAL in LOAD. + * specialize (LOAD v). + exploit eval_addressing_lessdef; try eassumption. + apply reglist_lessdef; apply RS. + intros (ta & ADDR & LD). + (* TODO: on peut sans doute factoriser ça *) + destruct (Mem.loadv chunk tm ta) eqn:Htload. + -- left; eexists; split. + eapply exec_Iload. + ++ exploit instruction_type_preserved; (simpl; eauto)||congruence. + ++ eapply has_loaded_normal; eauto. rewrite <- ADDR. apply eval_addressing_preserved. apply symbols_preserved. + ++ apply match_states_intro; try assumption. apply set_reg_lessdef; eauto. + -- left; eexists; split. + eapply exec_Iload. + ++ exploit instruction_type_preserved; (simpl; eauto)||congruence. + ++ eapply has_loaded_default; eauto. + rewrite eval_addressing_preserved with (ge1:=ge). + intros a EVAL'; rewrite ADDR in EVAL'; inv EVAL'. auto. + apply symbols_preserved. + ++ apply match_states_intro; try assumption. apply set_reg_lessdef; eauto. + * exploit eval_addressing_lessdef_none; try eassumption. + apply reglist_lessdef; apply RS. + left. eexists. split. + -- eapply exec_Iload. + ++ exploit instruction_type_preserved; (simpl; eauto)||congruence. + ++ eapply has_loaded_default; eauto. + rewrite eval_addressing_preserved with (ge1:=ge). + intros a EVAL'; rewrite H0 in EVAL'; inv EVAL'. + apply symbols_preserved. + -- apply match_states_intro; try assumption. apply set_reg_lessdef. apply Val.lessdef_undef. apply RS. - (* Lstore *) exploit eval_addressing_lessdef; try eassumption. apply reglist_lessdef; apply RS. |