Article View: gnu.gcc.help
Article #42912[Q:] GCC 2.7.0, -mips2, performance
From: Pierre P. Tremblay
Date: Tue, 17 Oct 1995 00:00
Date: Tue, 17 Oct 1995 00:00
49 lines
1771 bytes
1771 bytes
Hello,
We use GCC 2.7.0 to compile binaries for R4400-based SGI IRIX 5.2
machines.
Performance of GCC 2.7.0-compiled binaries with compilation flags
-O2 -mips2 -mcpu=r4400 is well below that of binaries compiled with
/bin/cc -O2 -mips2. For example, the following small matrix
multiplication code:
----------------------------------------------------------------------
#include <stdio.h>
#define MAT_SIZE 256
int main()
{
register i,j,k;
double A[MAT_SIZE][MAT_SIZE];
double B[MAT_SIZE][MAT_SIZE];
double C[MAT_SIZE][MAT_SIZE];
for (i=0; i<MAT_SIZE; i++)
for (j=0; j<MAT_SIZE; j++)
for (C[i][j]=k=0; k<MAT_SIZE; k++)
C[i][j] += A[i][k]*B[k][j];
}
----------------------------------------------------------------------
tcsh's builtin time reports:
/home/zola/.../tmp> time mmult.sgi
3.846u 0.473s 0:04.52 95.3% 0+0k 1+0io 0pf+0w
/home/zola/.../tmp> time mmult.gnu
6.033u 0.060s 0:06.34 96.0% 0+0k 1+0io 0pf+0w
We have seen this order of magnitude performance difference
(i.e. ~50%) in other floating-point intensive code as well. Is the
GNU C port (or, more likely, GNU assembler port) to MIPS instruction sets
known to be not as effective as the SGI compiler/assembler?
GNU as reports GNU assembler version 2.5.2 (mips-sgi-irix5.2), using
BFD version 2.5.
Thanks,
Pierre
--
Pierre P. Tremblay ppt@cae.ca
Technical Details
Message-ID:
<4608le$gn1@web.cae.ca>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 11318c,4fe4823859034751,start X-Google-Attributes: gid11318c,public From: ppt@cae.ca (Pierre P. Tremblay) Subject: [Q:] GCC 2.7.0, -mips2, performance Date: 1995/10/17 Message-ID: <4608le$gn1@web.cae.ca> X-Deja-AN: 117695109 organization: CAE Electronics reply-to: ppt@cae.ca newsgroups: gnu.gcc.help