This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/44382] Slow integer multiply
- From: "wschmidt at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 12 Jul 2011 17:34:41 +0000
- Subject: [Bug middle-end/44382] Slow integer multiply
- Auto-submitted: auto-generated
- References: <bug-44382-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44382
William J. Schmidt <wschmidt at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |wschmidt at gcc dot gnu.org
--- Comment #7 from William J. Schmidt <wschmidt at gcc dot gnu.org> 2011-07-12 17:33:06 UTC ---
The test case from bug 45671 is as follows:
int myfunction (int a, int b, int c, int d, int e, int f, int g, int h) {
int ret;
ret = a + b + c + d + e + f + g + h;
return ret;
}
Compiling with -O3 results in a series of dependent add instructions to
accumulate the sum.
add 4,3,4
add 4,4,5
add 4,4,6
add 4,4,7
add 4,4,8
add 4,4,9
add 4,4,10
If we regrouped to (a+b)+(c+d)+... we can do multiple adds in parallel on
different execution units.