diff options
author | Xavier Leroy <xavier.leroy@inria.fr> | 2016-10-04 15:52:16 +0200 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@inria.fr> | 2016-10-04 15:52:16 +0200 |
commit | d2af79a77ed2936ff0ed90cadf8e48637d774d4c (patch) | |
tree | 09300943e12a98ae80598c79d455b31725271ead /ia32/Asmgenproof1.v | |
parent | a44893028eb1dd434c68001234ad56d030205a8e (diff) | |
download | compcert-d2af79a77ed2936ff0ed90cadf8e48637d774d4c.tar.gz compcert-d2af79a77ed2936ff0ed90cadf8e48637d774d4c.zip |
Turn 64-bit integer division and modulus by constants into multiply-high
This trick was already implemented for 32-bit integer division and modulus. Here we extend it to the 64-bit case.
For 32-bit target processors, the runtime library must implement 64-bit multiply-high (signed and unsigned). Tentative implementations are provided for IA32 and PowerPC, but need testing.
Diffstat (limited to 'ia32/Asmgenproof1.v')
-rw-r--r-- | ia32/Asmgenproof1.v | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ia32/Asmgenproof1.v b/ia32/Asmgenproof1.v index 4effe7c9..05b3176a 100644 --- a/ia32/Asmgenproof1.v +++ b/ia32/Asmgenproof1.v @@ -1312,6 +1312,10 @@ Transparent destroyed_by_op. (* lea *) exploit transl_addressing_mode_32_correct; eauto. intros EA. TranslOp. rewrite nextinstr_inv; auto with asmgen. rewrite Pregmap.gss. rewrite normalize_addrmode_32_correct; auto. +(* mullhs *) + apply SAME. TranslOp. destruct H1. Simplifs. +(* mullhu *) + apply SAME. TranslOp. destruct H1. Simplifs. (* divl *) apply SAME. exploit (divls_modls_exists (rs RAX) (rs RCX)). left; congruence. |