Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
PPC CFLAGS for GCC 3.4?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC
View previous topic :: View next topic  
Author Message
Hydraulix
Guru
Guru


Joined: 12 Dec 2003
Posts: 447
Location: Baltimore, Maryland

PostPosted: Thu Nov 04, 2004 9:07 pm    Post subject: PPC CFLAGS for GCC 3.4? Reply with quote

It's been a while since the cflags have been updated on the Gentoo wiki. I was wondering what cflags work for GCC 3.4? Here's what I'm using now but it's kinda slow. And I want things to fly.


Code:
CFLAGS="-O2 -mcpu=750 -fno-strict-aliasing -fsigned-char -mpowerpc-gfxopt -pipe"
CHOST="powerpc-unknown-linux-gnu"
CXXFLAGS="${CFLAGS}"
MAKEOPTS="-j2"



I heard somewhere that mcpu is depreacated. So I'm trying to get a feel of what everyone is using.
_________________
It is the fate of operating systems to become free.
- Neal Stephenson

If only You and Dead people can read hex, how many people can read hex?
Back to top
View user's profile Send private message
toojays
Apprentice
Apprentice


Joined: 21 Jul 2002
Posts: 150
Location: Adelaide, Australia

PostPosted: Fri Nov 05, 2004 6:57 am    Post subject: Reply with quote

Although I've come to believe that fretting about CFLAGS for general-case optimisations is pretty wanky, I do have a couple of things to say:

You could drop -mpowerpc-gfxopt, because it is set optimally by -mcpu=750 anyway.

Why do you have -fsigned-char?

Also, -fno-strict-aliasing seems to me to be a pesimisation . . .

You could try and use -O3 instead of -O2 . . .
Back to top
View user's profile Send private message
iTux
Guru
Guru


Joined: 07 Sep 2004
Posts: 586
Location: Toronto

PostPosted: Fri Nov 05, 2004 8:19 pm    Post subject: Reply with quote

Agree with toojays. To summarize, I have been using:

CFLAGS="-O3 -mcpu=750 -pipe"

for several months without problems.

The only thing is once, I had to use -fno-strict-aliasing for some lib, otherwise XFree would not compile. But I think these should be added by the ebuild maintainer if required and some ebuilds do add them.

The thing is that strict-aliasing is enabled by default in -O2. So basically people using all the times are reducing opportunities for optimizations. Also, since its added by -O2 (considered a "safe" level of optimization), then I would consider the software that breaks as buggy...

If you chose Gentoo, you need to be ready that sometimes, things do break. :)

iTux
Back to top
View user's profile Send private message
Hydraulix
Guru
Guru


Joined: 12 Dec 2003
Posts: 447
Location: Baltimore, Maryland

PostPosted: Sat Nov 06, 2004 11:35 pm    Post subject: Reply with quote

-fsigned-char just came with the make.conf so I decided to use it. I'll switch to 03 just to check it but in the past I've heard about 03 breaking everything. I've also noticed that PPC users don't have that aggressive CFLAGS like the X86 community. Why is that? I really don't know what half of the options mean. But I'd love to speed things up.
_________________
It is the fate of operating systems to become free.
- Neal Stephenson

If only You and Dead people can read hex, how many people can read hex?
Back to top
View user's profile Send private message
toojays
Apprentice
Apprentice


Joined: 21 Jul 2002
Posts: 150
Location: Adelaide, Australia

PostPosted: Sun Nov 07, 2004 1:48 am    Post subject: Reply with quote

When I had my old Powerbook G3 I used to use O3, and the only breakage I remember was in one of the Gnucash dependencies (maybe guile or slib?).

I know you often see people talk about CFLAGS and whatnot, but a lot of it is just wanking . . . the kind of talk which gives justification to the Gentoo is Rice website, etc.

Okay, so sometimes there is some justification for x86 people having longer CFLAGS. For instance, on newer x86 chips, you can choose to do all floating point ops using the vector unit instead of the the FPU. Actually GCC should do this automatically if you just set -march=xxx, but many people are confused about what does and does not get set.

But the reality is that -Os, -O2, -O3 are only what seems to be best in general. For a particular application, -O2 might actually be faster than -O3, likewise -Os might produce bigger or faster programs than -O3. So really the slogan "we can optimise everything for our CPU" is a bit of a myth, because to optimise properly you need to do benchmarking, profiling etc, and each app is going to have different results.

I guess the main point is to stop stressing about trying to use CFLAGS to make your computer faster. If you really want things to be faster, you probably have to make larger scale changes, e.g. use Mutt instead of KMail, reiserfs instead of ext3.

Some interesting sites related to this area are SPEC Testing for GCC, and Analysis of Compiler Options via Evolutionary Algorithm. Also Jakub Jelinek has written some interesting papers about linker optimisations, but I can't find the most recent one atm.
Back to top
View user's profile Send private message
Scorched
n00b
n00b


Joined: 24 Dec 2003
Posts: 13

PostPosted: Sat Dec 18, 2004 8:29 pm    Post subject: Reply with quote

What about altivec flags?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum