comparing the default compilr with gcc-4.2

Gary Kline kline at tao.thought.org
Mon Apr 2 22:51:55 UTC 2007


	Enclosed is one of the first comparsions of gcc-3.4 with no
	additional switches and gcc-4.2 with the flags -O3 and
	loop-unrolling set.  I'll post a couple more of these; but the
	nutshell is that is most cases, gcc-4.x seems to be quite an
	improvment.  In this test, I did not try gcc-3.4 with any
	optimization or loop tweaking.  Some people may not care about
	efficieency.  I'll submit my own runs of a floating point test,
	and another of basicly integer and function call tests.

	gary



/*
     system gcc, no CFLAGS:

gcc -v
Using built-in specs.
Configured with: FreeBSD/i386 system compiler
Thread model: posix
gcc version 3.4.6 [FreeBSD] 20060305
 
 */


   FLOPS C Program (Double Precision), V2.0 18 Dec 1992

   Module     Error        RunTime      MFLOPS
                            (usec)
     1      4.0146e-13      0.0511    273.8293
     2     -1.4166e-13      0.0461    151.8889
     3      4.7184e-14      0.0500    339.8183
     4     -1.2557e-13      0.0482    311.0951
     5     -1.3800e-13      0.1006    288.2295
     6      3.2380e-13      0.0743    390.0978
     7     -8.4583e-11      0.1231     97.5168
     8      3.4867e-13      0.0791    379.4285

   Iterations      =  512000000
   NullTime (usec) =     0.0040
   MFLOPS(1)       =   185.4108
   MFLOPS(2)       =   186.1495
   MFLOPS(3)       =   277.3309
   MFLOPS(4)       =   361.6132


/*
  gcc42 with CFLAGF -O3 -funroll-loops

gcc version 4.2.0 20070228 (prerelease)
 
 */
    


   FLOPS C Program (Double Precision), V2.0 18 Dec 1992

   Module     Error        RunTime      MFLOPS  RT inc/(dec)
                            (usec)
     1      4.0146e-13      0.0422    332.1242 	21.09%
     2     -1.4166e-13      0.0399    175.5128  15.54%
     3      4.7184e-14      0.0435    391.0462  14.94%
     4     -1.2557e-13      0.0436    343.7848  10.55%
     5     -1.3800e-13      0.1144    253.5990  31.65%
     6      3.2380e-13      0.0818    354.6371  17.20%
     7     -8.4583e-11      0.1223     98.1568  01.83%
     8      3.4867e-13      0.0912    329.0118  (-27.75%)

   Iterations      =  512000000
   NullTime (usec) =     0.0003
   MFLOPS(1)       =   214.0898
   MFLOPS(2)       =   186.6407
   MFLOPS(3)       =   270.9620
   MFLOPS(4)       =   349.9180

-- 
  Gary Kline  kline at thought.org   www.thought.org  Public Service Unix



More information about the freebsd-questions mailing list