This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug rtl-optimization/21395] Performance degradation when building code that uses MMX intrinsics with gcc-4.0.0



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]