This is the mail archive of the gcc@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]

gcc4.0 recent >15% runtime performance regression


Starting from the gcc-4.0-20041219 snapshot (still valid for
gcc-4.0-20050102), i'm seeing a significant performance regression
compared to gcc-4.0-20041205 (with 2 SSE related patches) on x86/SSE.

That happens in the mono-ray part of a coherent raytracer (tight loop,
no explicit SSE) and while gcc-4.0-20041205 never touches the fpu
later versions do (that's the only obvious difference in the generated
code).

Here's an excerpt from the triangle intersection:
gcc-4.0-20041205
  4010d9:       movss  (%ecx,%esi,4),%xmm0
  4010de:       movss  %xmm0,(%esp)
  4010e3:       movaps %xmm0,%xmm1
  4010e6:       movaps %xmm2,%xmm0
  4010e9:       mulss  %xmm3,%xmm1
  4010ed:       subss  (%edx,%ebx,4),%xmm6
  4010f2:       movss  (%edx,%esi,4),%xmm4
  4010f7:       mulss  %xmm4,%xmm3
  4010fb:       movss  (%edx,%eax,4),%xmm5
  401100:       movss  (%ecx,%eax,4),%xmm7
  401105:       mulss  %xmm5,%xmm2
  401109:       addss  (%ecx,%ebx,4),%xmm1
  40110e:       mulss  %xmm7,%xmm0
  401112:       subss  %xmm3,%xmm6
  401116:       xorps  %xmm3,%xmm3

gcc-4.0-20050102
  4010d4:       movss  (%ecx,%esi,4),%xmm0
  4010d9:       movss  %xmm0,0x4(%esp)
  4010df:       movaps %xmm0,%xmm1
  4010e2:       movaps %xmm2,%xmm0
  4010e5:       flds   (%edx,%ebx,4)
  4010e8:       mulss  %xmm3,%xmm1
  4010ec:       movss  (%edx,%esi,4),%xmm4
  4010f1:       fsubrs 0xc(%edi)
  4010f4:       mulss  %xmm4,%xmm3
  4010f8:       movss  (%edx,%eax,4),%xmm5
  4010fd:       movss  (%ecx,%eax,4),%xmm7
  401102:       addss  (%ecx,%ebx,4),%xmm1
  401107:       mulss  %xmm5,%xmm2
  40110b:       mulss  %xmm7,%xmm0
  40110f:       fstps  (%esp)
  401112:       movss  (%esp),%xmm6
  401117:       addss  %xmm0,%xmm1
  40111b:       subss  %xmm3,%xmm6
  40111f:       xorps  %xmm3,%xmm3

It's even worse in other places... Seems like recent versions have
troubles with the register pressure.

It's hard to provide a test case, but i could give more evidence.


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