public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/17647] New: [4.0 regression] Missing i386 addressing modes
@ 2004-09-24  7:03 uros at kss-loka dot si
  2004-09-24 13:19 ` [Bug tree-optimization/17647] " pinskia at gcc dot gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: uros at kss-loka dot si @ 2004-09-24  7:03 UTC (permalink / raw)
  To: gcc-bugs

This testcase (from scimark2.0, LU.c) shows missing i386 addressing modes:

void LU_copy_matrix(int M, int N, double **lu, double **A)
{
    int i;
    int j;

    for (i=0; i<M; i++)
        for (j=0; j<N; j++)
            lu[i][j] = A[i][j];
}

With gcc -O2 -ffast-math -fomit-frame-pointer -march=pentium4 LU.c following ASM
code is produced:

GCC: (GNU) 3.2 20020903 (Red Hat Linux 8.0 3.2-7):
LU_copy_matrix:
        pushl   %ebp
        pushl   %edi
        pushl   %esi
        pushl   %ebx
        xorl    %ebx, %ebx
        movl    20(%esp), %edi
        movl    24(%esp), %esi
        movl    32(%esp), %ebp
        cmpl    %edi, %ebx
        jge     .L13
.L11:
        xorl    %eax, %eax
        cmpl    %esi, %eax
        jge     .L15
        movl    28(%esp), %edx
        movl    (%edx,%ebx,4), %ecx
        movl    (%ebp,%ebx,4), %edx
.L10:
        fldl    (%edx,%eax,8)
        fstpl   (%ecx,%eax,8)
        addl    $1, %eax
        cmpl    %esi, %eax
        jl      .L10
.L15:
        addl    $1, %ebx
        cmpl    %edi, %ebx
        jl      .L11
.L13:
        popl    %ebx
        popl    %esi
        popl    %edi
        popl    %ebp
        ret

gcc 4.0 regressed in this area and produces:
LU_copy_matrix:
      pushl    %ebp
      pushl    %edi
      pushl    %esi
      pushl    %ebx
      movl     24(%esp), %ebp
      movl     20(%esp), %eax
      testl    %eax, %eax
      jle      .L8
      movl     32(%esp), %esi
      movl     28(%esp), %ebx
      xorl     %edi, %edi
.L4:
      testl    %ebp, %ebp
      jle      .L6
      movl     (%esi), %ecx
      movl     (%ebx), %edx
      xorl     %eax, %eax
.L5:
      fldl     (%ecx)
      fstpl    (%edx)
      addl     $1, %eax
      addl     $8, %ecx
      addl     $8, %edx
      cmpl     %eax, %ebp
      jg       .L5
.L6:
      addl     $1, %edi
      addl     $4, %esi
      addl     $4, %ebx
      cmpl     %edi, 20(%esp)
      jg       .L4
.L8:
      popl     %ebx
      popl     %esi
      popl     %edi
      popl     %ebp
      ret

The problem is in .L5 loop. gcc-4.0 uses a simple addressing scheme, but gcc-3.2
can use complex SIB addressing schemes, shown in corresponding .L10 loop. This
problem is also present in integer instructions.

IMHO this could be the cause of unbeliveably bad benchmark results in
scimark-2.0 (http://www.coyotegulch.com/reviews/linux_compilers/)

Uros.

-- 
           Summary: [4.0 regression] Missing i386 addressing modes
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: uros at kss-loka dot si
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-linuc-gnu
  GCC host triplet: i686-linux-gnu
GCC target triplet: i686-linuc-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17647


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2004-12-05  4:29 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-24  7:03 [Bug target/17647] New: [4.0 regression] Missing i386 addressing modes uros at kss-loka dot si
2004-09-24 13:19 ` [Bug tree-optimization/17647] " pinskia at gcc dot gnu dot org
2004-09-27  8:52 ` bonzini at gcc dot gnu dot org
2004-11-04  9:33 ` uros at kss-loka dot si
2004-11-05  8:00 ` uros at kss-loka dot si
2004-11-13 20:15 ` [Bug rtl-optimization/17647] " pinskia at gcc dot gnu dot org
2004-11-25 23:37 ` [Bug tree-optimization/17647] " pinskia at gcc dot gnu dot org
2004-11-26  8:50 ` uros at gcc dot gnu dot org
2004-11-26 15:40 ` pinskia at gcc dot gnu dot org
2004-12-05  4:29 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).