Thread: gcc 3.2 slows down athlon?
-
February 9th, 2003, 03:50 PM #1
gcc 3.2 slows down athlon?
Ok, I know little about compilation, but I was still running the old core I compiled for ecc2 under redhat 7.3 (gcc 2.96) with the defaults (I don't know how to change them or what to change them to). It was getting about 930kit/s.
So I just realized, hey, gcc 3.x is supposed to compile better for athlons, I recompiled it (still with defaults) and now I get 665 kit/s.
HELP! (note, I failed to back up the old core). How do I optimize this better???
Sam
-
February 9th, 2003, 03:54 PM #2
hi sam,
what flags did you pass in? gcc3x slowed down pure C a bit but sped up C++ progies, in either case dropping that much is much much worse than can be accounted for by going from 2.96 to 3.2Odds are very good there are several spelling mistakes in this post.
-
February 9th, 2003, 06:02 PM #3
-
February 9th, 2003, 06:13 PM #4
i use these:
w/o out them your compiler will used default glibc i think, which is i386 under rhCode:export CFLAGS=$'-O2 -march=athlon' export CXXFLAGS=$'-O2 -march=athlon'
Odds are very good there are several spelling mistakes in this post.
-
February 9th, 2003, 06:29 PM #5
So you just type the exports before compiling?
Where does this add/change things?
Is there a way to edit this directly with vim/kate/gedit or something?
Sam
That's what I get when I try it.make -C ./src client
make[1]: Entering directory `/home/samwich/Desktop/ecc2/src'
nasm -felf mult109_mmx.asm
gcc -Wall -Wno-unused -O3 -funroll-loops -fomit-frame-pointer -fexpensive-optimizations -I../include -o client client.c ecc2-109.c sq109_mmx.c mult109_mmx.o
client.c:41:15: warning: multi-line string literals are deprecated
mv client ..
make[1]: Leaving directory `/home/samwich/Desktop/ecc2/src'
EDIT: it's also just as slow.Last edited by samwichse; February 9th, 2003 at 06:44 PM.
-
February 9th, 2003, 07:01 PM #6
Put/edit these lines in /etc/profile
export CFLAGS="02 -march=athlon"
export CXXFLAGS=$CFLAGS
then further down the file, make sure those 2 from above are in the gereral export line:
export CFLAGS CXXFLAGS PATH MANPATH........etc
gotta reboot then. You can use more flags than the above, but those'll give you most of the benefits.Last edited by BFlurie; February 9th, 2003 at 07:08 PM.
-
February 9th, 2003, 07:23 PM #7
Ok, after adding the code, this is what it looks like:
But, it didn't seem to change anything when I did a make on the core. The file size of the executible was identical, and the speed is the same.
Code:# /etc/profile # System wide environment and startup programs, for login setup # Functions and aliases go in /etc/bashrc export CFLAGS="02 -march=athlon" export CXXFLAGS=$CFLAGS pathmunge () { if ! echo $PATH | /bin/egrep -q "(^|:)$1($|:)" ; then if [ "$2" = "after" ] ; then PATH=$PATH:$1 else PATH=$1:$PATH fi fi } # Path manipulation if [ `id -u` = 0 ]; then pathmunge /sbin pathmunge /usr/sbin pathmunge /usr/local/sbin fi pathmunge /usr/X11R6/bin after unset pathmunge # No core files by default ulimit -S -c 0 > /dev/null 2>&1 USER="`id -un`" LOGNAME=$USER MAIL="/var/spool/mail/$USER" HOSTNAME=`/bin/hostname` HISTSIZE=1000 if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ]; then INPUTRC=/etc/inputrc fi export CFLAGS CXXFLAGS PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC for i in /etc/profile.d/*.sh ; do if [ -r "$i" ]; then . $i fi done unset i
-
February 9th, 2003, 07:36 PM #8
Sorry, I didn't realize it was the kernel. Add -march=athlon -malign-functions=4 -mpreferred-stack-boundary=2
to the file /usr/src/linux..../Makefile, on this line near the top:
HOSTCFLAGS = -Wall -Wstrict-prototypes.....
-
February 9th, 2003, 08:55 PM #9
No, it's not the kernel, it's the ecc2-109 core I'm trying to compile here.
Can I add those options to /etc/profile ?
-
February 9th, 2003, 09:07 PM #10
i just type them when i need to, if ya want them everywhere you can add them there. what were the orginal ones made with?
Odds are very good there are several spelling mistakes in this post.
-
February 9th, 2003, 10:22 PM #11
The original core I was using was made with all the defaults in RedHat 7.3 with gcc 2.96, it got 930-940k it/s.
But when I compile now (even after adding all those to the profile, or just doing the "export" thing... I still get the same problem... about 665k it/s.
Any other ideas?
-
February 10th, 2003, 10:01 AM #12
While compiling, are you seeing the:
-02 -march=athlon -mpreferred-stack-boundary=2......
in the compilation lines as they pass by? Also, -fomit-frame-pointer should appear by default for a -02 level or above compilation.
Also, do you "make clean" before recompiling to start fresh?Last edited by BFlurie; February 10th, 2003 at 10:18 AM.
-
February 10th, 2003, 10:29 AM #13
No, I'm seeing this exactly (this is a very small program):
And no, no "make clean" I'm just deleting the whole source and re-unpacking it.Code:make -C ./src client make[1]: Entering directory `/home/samwich/Desktop/ecc2/src' nasm -felf mult109_mmx.asm gcc -Wall -Wno-unused -O3 -funroll-loops -fomit-frame-pointer -fexpensive-optimizations -I../include -o client client.c ecc2-109.c sq109_mmx.c mult109_mmx.o client.c:41:15: warning: multi-line string literals are deprecated mv client .. make[1]: Leaving directory `/home/samwich/Desktop/ecc2/src'
-
February 10th, 2003, 11:37 AM #14
Then for some reason GCC isn't importing your profile settings. Compiling as root?
Try adding the flags:
-march=athlon -malign-functions=4 -mpreferred-stack-boundary=2
to the appropriate line in the install's makefile before running configure. Check it again before running "make" to be sure it didn't change.
Personally, the -fexpensive-optimizations gains very little -- I'd drop that. I've also heard a fair bit of warning on using GCC 3xx, tho the newest stuff prb'ly requires it.Last edited by BFlurie; February 10th, 2003 at 11:39 AM.
-
February 10th, 2003, 12:31 PM #15
Yep - I've tried various optimisations and have comprehensively failed to push it over 650 kIt/s (gcc 3.2, Athlon XP 1800) whereas the gcc 2.96 core gets 880 kIt/s.
Get a gcc 2.96 compiled core from Sven Geier's page - http://www.its.caltech.edu/~sgeier/code/ecc2.html
(Sven is in Ars Technica Team Vodka Martini, and has written a couple of cool shells for ecc2)
-
February 10th, 2003, 09:41 PM #16
Oooooh... so this isn't just my stupidity perhaps?
Oh well, downloading the precompiled one put it back up to about 910k it/s on a 1700+ (running at 2000+), so I guess the simplest solution is the best in this case.
Thanks to everyone for their help though, I learned something anyway
Sam
-
February 11th, 2003, 08:49 PM #17
Yeah, but I can't help but be disappointed here to know that the latest version of GCC puts out slower code than the one that came before it.. Or is this just an anomoly? (I know very little of compilers and there affects on performance).
Where's Lunch?
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)



LinkBack URL
About LinkBacks



Reply With Quote



Fully action and Little comdey movie with lot of fun. You are also watch it's previous part Iron Man & Iron Man 2 they are fantastic. Now watch Iron Man 3 which are super fantastic as compare with...
! Full HD !! Watch Iron Man 3...