This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/17236] inefficient code for long long multiply on x86
- From: "ubizjak at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Dec 2007 13:11:50 -0000
- Subject: [Bug rtl-optimization/17236] inefficient code for long long multiply on x86
- References: <bug-17236-1008@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #22 from ubizjak at gmail dot com 2007-12-19 13:11 -------
(In reply to comment #21)
> Indeed, if I only use the regclass.c and local-alloc.c hunks, I get only one
> spill!
>
> pushl %ebx
> movl 8(%esp), %edx
> movl 16(%esp), %eax
> movl 20(%esp), %ecx
> imull %edx, %ecx
> movl 12(%esp), %ebx
> imull %eax, %ebx
> addl %ebx, %ecx
> mull %edx
> leal (%ecx,%edx), %edx
> popl %ebx
>
> and no reg-reg move.
Excellent!
I think that we should fwprop stack arguments into the insns to further
optimize the code. According to pentopt.pdf, there is no penalty at all (at
least for P4+) when one of the insn operands is a memory reference. This would
relieve register pressure considerably.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17236