This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/21395] Performance degradation when building code that uses MMX intrinsics with gcc-4.0.0
- From: "michaelni at gmx dot at" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Mar 2008 02:51:44 -0000
- Subject: [Bug rtl-optimization/21395] Performance degradation when building code that uses MMX intrinsics with gcc-4.0.0
- References: <bug-21395-10358@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #7 from michaelni at gmx dot at 2008-03-22 02:51 -------
You can also replace the inner loop by:
"2: \n\t"
"pxor %%mm1, %%mm1 \n\t"
"movq (%%eax, %%ecx), %%mm0\n\t"
"psubw (%%esi, %%ecx), %%mm0\n\t"
"pcmpgtw %%mm0, %%mm1 \n\t"
"por %%mm6, %%mm1 \n\t"
"pmaddwd %%mm1, %%mm0 \n\t"
"paddd %%mm0, %%mm7 \n\t"
"addl $8, %%ecx \n\t"
" jnz 2b \n\t"
Which has one instruction less, its a hair faster on my p3 but a little slower
on my duron.
And of course the most obvious optimization is to unroll this and do a bunch of
them at once.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21395