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: "bonzini at gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Dec 2007 07:53:28 -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 #8 from bonzini at gnu dot org 2007-12-18 07:53 -------
For -mregparm=2 the code is this:
pushl %ebx
movl 8(%esp), %ebx
movl 12(%esp), %ecx
imull %ebx, %edx
imull %eax, %ecx
addl %edx, %ecx
mull %ebx
popl %ebx
leal (%ecx,%edx), %edx
ret
It is better only for luck: the low part of "a" is already in %eax, so that
regclass decides for the "right" preference.
Register 64 pref AREG, else GENERAL_REGS
Paolo
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17236