From e9cca9c8166fadb16c64df0fbb0b9ca640c0f594 Mon Sep 17 00:00:00 2001 From: Xavier Leroy Date: Fri, 12 Apr 2019 15:47:49 +0200 Subject: PowerPC: make sure evaluation of conditions do not destroy any register This will be useful to implement a "select" (conditional move) operation later. - Introduce `Asmgen.loadimm64_notemp` to load a 64-bit integer constant into a register without going through memory and without needing a temporary register. - Use `Asmgen.loadimm64_notemp` instead of `Asmgen.loadimm64` in the compilation of conditions, so that GPR12 is no longer needed as a temporary. - Share code and proofs common to the two `Asmgen.loadimm64_` functions as the `Asmgen.loadimm64_32s` function. --- powerpc/Asmgenproof.v | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'powerpc/Asmgenproof.v') diff --git a/powerpc/Asmgenproof.v b/powerpc/Asmgenproof.v index 8ad28aea..d0d82cb5 100644 --- a/powerpc/Asmgenproof.v +++ b/powerpc/Asmgenproof.v @@ -179,14 +179,28 @@ Proof. Qed. Hint Resolve rolm_label: labels. +Remark loadimm64_32s_label: + forall r n k, tail_nolabel k (loadimm64_32s r n k). +Proof. + unfold loadimm64_32s; intros. destruct Int64.eq; TailNoLabel. +Qed. +Hint Resolve loadimm64_32s_label: labels. + Remark loadimm64_label: forall r n k, tail_nolabel k (loadimm64 r n k). Proof. - unfold loadimm64; intros. - destruct Int64.eq. TailNoLabel. destruct Int64.eq; TailNoLabel. + unfold loadimm64; intros. destruct Int64.eq; TailNoLabel. Qed. Hint Resolve loadimm64_label: labels. +Remark loadimm64_notemp_label: + forall r n k, tail_nolabel k (loadimm64_notemp r n k). +Proof. + unfold loadimm64_notemp; intros. destruct Int64.eq; TailNoLabel. + eapply tail_nolabel_trans; TailNoLabel. +Qed. +Hint Resolve loadimm64_notemp_label: labels. + Remark loadind_label: forall base ofs ty dst k c, loadind base ofs ty dst k = OK c -> tail_nolabel k c. -- cgit