This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/44382] New: Slow integer multiply
- From: "hjl dot tools at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Jun 2010 15:04:09 -0000
- Subject: [Bug middle-end/44382] New: Slow integer multiply
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
For
---
extern int a, b, c, d, e, f;
void
foo ()
{
a = f * b * c * d;
}
---
on Linux/x86-64, gcc generates:
movl b(%rip), %eax
imull f(%rip), %eax
imull c(%rip), %eax
imull d(%rip), %eax
movl %eax, a(%rip)
ret
Icc generates:
movl c(%rip), %eax #6.15
movl f(%rip), %edx #6.7
imull d(%rip), %eax #6.19
imull b(%rip), %edx #6.11
imull %eax, %edx #6.15
movl %edx, a(%rip) #6.3
ret #7.1
Icc version is faster since 2 multiplications may
be issued at the same time.
--
Summary: Slow integer multiply
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Severity: enhancement
Priority: P3
Component: middle-end
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: hjl dot tools at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44382