From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: X-Archive-Original-Message-ID: <9703181310.AA03085@halfpint.rtp.avanticorp.com> Date: Tue, 18 Mar 1997 14:30:27 +0100 (CET) From: Andreas Johansson Subject: Re: Interesting gcc to cc comparison In-Reply-To: <9703181310.AA03085@halfpint.rtp.avanticorp.com> On Tue, 18 Mar 1997, Jim Nance wrote: > Hello All, > I have a program here that I thought you all might be interested in. > [...] > two 400x400 matrices 3 times: > > Simple 2x2 4x4 > cc 8.016346 2.849886 4.199832 > gcc -O2 12.232844 3.833180 10.182926 > gcc -O3 12.032852 3.383198 10.116262 > > The most interesting result is probably for the 4x4 matrices. Gcc really > does poorly here, and I think I might know why. For the 4x4 case there > are some for loops of the form for(ii=0; ii<4; ii++) which I am counting > on the compiler to unroll so the math inside the loops can be done in > parallel. It suspect that this is not happening. This is not supposed to happend unless you specify -funroll-loops, I believe. Anyway, I tried it on Linux with gcc 2.7.2.1. The timing is screwed up (about 1000 times wrong :), but you can still see the relative speed: (256x256 matrix) gcc -O2 0.038493 0.011104 0.011817 gcc -O3 0.036401 0.010734 0.011687 gcc -O2 -funroll-loops 0.037359 0.010688 0.010967 gcc -O3 -funroll-loops 0.035515 0.010243 0.010812 So, with gcc 2.7.2.1 on Linux I don't see the phenomenon you are describing. This is my system for reference: Noname axppci 266MHz 15ns, 256k cache. -- <-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-> : E-mail: ajo@wopr.campus.luth.se : : S-mail: Andreas Johansson, Karhusvagen 5 6:618, 977 54 Lulea, SWEDEN : : Have you had your dose of 261.62 BogoMIPS today? - Run Alpha! : <-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-> -- To unsubscribe: send e-mail to axp-list-request@redhat.com with 'unsubscribe' as the subject. Do not send it to axp-list@redhat.com