|
From: Douglas V. <dou...@dy...> - 2006-03-16 15:01:53
|
>Douglas Vechinski wrote: > > > >> 1) gcc -o spdtst spdtst.c -lm >> 2) gcc -O -o spdtst spdtst.c -lm >> 3) gcc -O2 -o spdtst spdtst.c -lm >> 4) gcc -O2 -ffast-math -o spdtst spdtst.c -lm >> >> > >You didn't specify -march or -mtune anywhere. Without those gcc is >going to be rather conservative about the kind of code it generates, so >it's probably not really a fair judge of its optimization capability >verses other compilers. Try giving -march to reflect the CPU of the >system. I'm not sure why the mingw and cygwin gcc doesn't line up >against the linux compiled version of gcc very well, but it could be >that those packages have different defaults "baked in" for -march and/or >-mtune. > >gcc 4.2 will have -mtune=generic which does a somewhat better job of >optimizing in a generic way for modern CPUs, but that is many versions >removed from 3.3. > >Also, -lm is not necessary and does nothing under both mingw and Cygwin. > >Brian > > > I tried what you suggested. I added a -march=pentium4 to all the command lines and reran them. (I added the -mtune on the Msys/Mingw one also. The cygwin one didn't recognize -mtune (maybe because of the version difference?) ) It did not make a difference worth mentioning. Resulted in similar run times for Cygwin, Cygwin -mno-cygwin, and Msys/Mingw as reported previously. Douglas |