Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
AMD Fusion - What GCC CFlags should I use?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
ryszardzonk
Apprentice
Apprentice


Joined: 18 Dec 2003
Posts: 225
Location: Rzeszów, POLAND

PostPosted: Fri Mar 04, 2011 7:34 pm    Post subject: AMD Fusion - What GCC CFlags should I use? Reply with quote

Hi all,

I have started building new MediaPC with shiny new http://en.wikipedia.org/wiki/AMD_Fusion Zacate processor (Bobcat core) ang I found out that http://en.gentoo-wiki.com/wiki/Safe_Cflags/AMD page does not have information about my new processor. Therefore question is what flags are safe with it

cat /proc/cpuinfo
Code:
processor       : 1
vendor_id       : AuthenticAMD
cpu family      : 20
model           : 1
model name      : AMD E-350 Processor
stepping        : 0
cpu MHz         : 1599.796
cache size      : 512 KB
physical id     : 0
siblings        : 2
core id         : 1
cpu cores       : 2
apicid          : 1
initial apicid  : 1
fpu             : yes
fpu_exception   : yes
cpuid level     : 6
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nonstop_tsc extd_apicid aperfmperf pni monitor ssse3 cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch ibs skinit wdt npt lbrv svm_lock nrip_save
bogomips        : 3200.00
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management: ts ttp tm stc 100mhzsteps hwpstate


gcc 4.4.5 present in stage3
Code:
cc -march=native -E -v - </dev/null 2>&1 | grep cc1


outputs
Code:
/usr/libexec/gcc/x86_64-pc-linux-gnu/4.4.5/cc1 -E -quiet -v - -D_FORTIFY_SOURCE=2 -march=amdfam10 -mcx16 -msahf -mpopcnt --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=512 -mtune=amdfam10


my question is would this work? Please notice that this processor has no 3dnow instructions present in all previous cores
_________________
Sky is not the limit...
Back to top
View user's profile Send private message
Ant P.
Watchman
Watchman


Joined: 18 Apr 2009
Posts: 6920

PostPosted: Fri Mar 04, 2011 10:26 pm    Post subject: Reply with quote

Quote:
amdfam10, barcelona
AMD Family 10h core based CPUs with x86-64 instruction set support. (This supersets MMX, SSE, SSE2, SSE3, SSE4A, 3dNOW!, enhanced 3dNOW!, ABM and 64-bit instruction set extensions.)

No, you definitely don't want that in -march, use "generic" and manually enable the instruction sets with -m* switches, or use -mno-3dnow (but beware broken ebuilds might filter this out). It should be safe for -mtune though.
Back to top
View user's profile Send private message
truekaiser
l33t
l33t


Joined: 05 Mar 2004
Posts: 801

PostPosted: Thu Jul 14, 2011 6:38 pm    Post subject: Reply with quote

Ant P. wrote:
Quote:
amdfam10, barcelona
AMD Family 10h core based CPUs with x86-64 instruction set support. (This supersets MMX, SSE, SSE2, SSE3, SSE4A, 3dNOW!, enhanced 3dNOW!, ABM and 64-bit instruction set extensions.)

No, you definitely don't want that in -march, use "generic" and manually enable the instruction sets with -m* switches, or use -mno-3dnow (but beware broken ebuilds might filter this out). It should be safe for -mtune though.


just a fyi, i have one of these and did basically that. I have also been experiencing odd program behavior, xfce4 refuses to draw window boarders or titles and can't see multiple workspaces. kde4.x has a high chance of kernel panic when using ati-drivers. using xf86-video-ati causes xorg to just sit there in a black screen and cursor when quitting or logging out or just loosing display completely forcing a ssh in to shut it down.

edit: using -mno-3dnow 'doesn't' work. most if not all ebuilds ignore it.
Back to top
View user's profile Send private message
wrc1944
Advocate
Advocate


Joined: 15 Aug 2002
Posts: 3435
Location: Gainesville, Florida

PostPosted: Thu Jul 14, 2011 9:05 pm    Post subject: Reply with quote

From reading about the questions discussed on this thread, and having built many hundreds of highly tuned kernels for various amd cpus over the years, I'd definitely try updating to at least gcc-4.5.2 and probably gcc-4.6.1 with march=native if I was building a new system with the new amd cpus.

IMO, any gcc-4.4.x is probably completely outdated and doesn't have the needed support. Until more info is avaible, I'm even wondering if gcc-4.6.1 and later will actually have updated full support for these new cpus any time soon.
_________________
Main box- AsRock x370 Gaming K4
Ryzen 7 3700x, 3.6GHz, 16GB GSkill Flare DDR4 3200mhz
Samsung SATA 1000GB, Radeon HD R7 350 2GB DDR5
OpenRC Gentoo ~amd64 plasma, glibc-2.36-r7, gcc-13.2.1_p20230304
kernel-6.8.4 USE=experimental python3_11
Back to top
View user's profile Send private message
truekaiser
l33t
l33t


Joined: 05 Mar 2004
Posts: 801

PostPosted: Thu Jul 14, 2011 10:44 pm    Post subject: Reply with quote

wrc1944 wrote:
From reading about the questions discussed on this thread, and having built many hundreds of highly tuned kernels for various amd cpus over the years, I'd definitely try updating to at least gcc-4.5.2 and probably gcc-4.6.1 with march=native if I was building a new system with the new amd cpus.

IMO, any gcc-4.4.x is probably completely outdated and doesn't have the needed support. Until more info is avaible, I'm even wondering if gcc-4.6.1 and later will actually have updated full support for these new cpus any time soon.


looking through the gcc site. the 4.6.1 branch will have bobcat support which is what these chips are.
Back to top
View user's profile Send private message
chithanh
Developer
Developer


Joined: 05 Aug 2006
Posts: 2158
Location: Berlin, Germany

PostPosted: Thu Jul 14, 2011 11:40 pm    Post subject: Reply with quote

Zacate doesn't support 3dnow natively.
The correct CFLAGS are -march=btver1 (supported since gcc-4.6).
Back to top
View user's profile Send private message
truekaiser
l33t
l33t


Joined: 05 Mar 2004
Posts: 801

PostPosted: Thu Jul 14, 2011 11:58 pm    Post subject: Reply with quote

chithanh wrote:
Zacate doesn't support 3dnow natively.
The correct CFLAGS are -march=btver1 (supported since gcc-4.6).


just posted that :P
anyway that branch of gcc looks like it lacks a keyword so that means it won't compile a decent amount of packages. I'll wait till it at least gets to unstable.
Back to top
View user's profile Send private message
wrc1944
Advocate
Advocate


Joined: 15 Aug 2002
Posts: 3435
Location: Gainesville, Florida

PostPosted: Fri Jul 15, 2011 1:37 am    Post subject: Reply with quote

FWIW, I've been running gcc-4.6.0 on both 32bit ~x86 and 64bit ~amd64 installations (both with full kde-4.6.2 through 4.6.5) without any more compiling problems than with gcc-4.5.2. Just went to gcc-4.6.1 from 4.6.0. I'm currently not using graphite or -flto stuff to avoid the associated problems still there, but if you just want to update to 4.6.1 to get the new cpu support it shouldn't be too much of a problem for experienced users.

I'd first rebuild the toolchain with the new gcc and flags, and then try and get cleanly through an emerge -e @system before trying an optional @world. If one is wary of gcc-4.6.x and still running any gcc-4.4.x version on Gentoo stable, I'd move to 4.5.2 first and then do an emerge -e @system, then 4.6.1. I read of some users having problems going from 4.4.x straight to 4.6.x. Might be some problems if you want to still run Gentoo stable and just move to ~Arch versions of gcc and thetoolchain packages- I wouldn't think it's a good idea. Better to go ~Arch on the entire system rather than mix stable and ~Arch packages. That can lead to a big confused mess.
_________________
Main box- AsRock x370 Gaming K4
Ryzen 7 3700x, 3.6GHz, 16GB GSkill Flare DDR4 3200mhz
Samsung SATA 1000GB, Radeon HD R7 350 2GB DDR5
OpenRC Gentoo ~amd64 plasma, glibc-2.36-r7, gcc-13.2.1_p20230304
kernel-6.8.4 USE=experimental python3_11
Back to top
View user's profile Send private message
truekaiser
l33t
l33t


Joined: 05 Mar 2004
Posts: 801

PostPosted: Fri Jul 15, 2011 4:03 am    Post subject: Reply with quote

it's not that i don't know how to do it. it's just that sometimes it's less hassle to go bleeding edge. still i want to rid myself of the kludge cflag's i have been using. the same idea as above. -march=generic and enableing all the cpu flags.
Back to top
View user's profile Send private message
FizzyWidget
Veteran
Veteran


Joined: 21 Nov 2008
Posts: 1133
Location: 127.0.0.1

PostPosted: Fri Jul 15, 2011 8:24 am    Post subject: Reply with quote

i always thought -march=native would find all the usable flags for your CPU without you having to now what they are, i use -march=native and -mtune=native, never had any issues here, am considering upgrading to gcc-4.6.1, but on a laptop with about 600 packages it will take a while.

When I have updated GCC in the past i found the simplest option is to (this is only for major version jumps)

emerge -uav gcc
gcc-config (place your version here)
env-update && source /etc/profile
emerge -e system
emerge -e world

takes a while but normally goes okay :)
_________________
I know 43 ways to kill with a SKITTLE, so taste my rainbow bitch.
Back to top
View user's profile Send private message
Veldrin
Veteran
Veteran


Joined: 27 Jul 2004
Posts: 1945
Location: Zurich, Switzerland

PostPosted: Fri Jul 15, 2011 1:31 pm    Post subject: Reply with quote

In the normal case, a new CPU gets more instruction, and not less like a Zacate.
And GCC just tries to get a close a possible (amdfam10/barcelona) as it is a amd cpu, expecting, that it supports at least the old instruction set.
_________________
read the portage output!
If my answer is too concise, ask for an explanation.
Back to top
View user's profile Send private message
truekaiser
l33t
l33t


Joined: 05 Mar 2004
Posts: 801

PostPosted: Fri Jul 15, 2011 6:24 pm    Post subject: Reply with quote

Veldrin wrote:
In the normal case, a new CPU gets more instruction, and not less like a Zacate.
And GCC just tries to get a close a possible (amdfam10/barcelona) as it is a amd cpu, expecting, that it supports at least the old instruction set.

that's part of the problem. the rest is due to certain ebuilds here automatically assuming 3dnow support if a amd cpu is present. qt-gui did this for me for amdfam10 even if i used -mno-3dnow. using -march=generic or -march=btver1 gets around that.
as a former owner of a via cpu(great little things btw) i always ran into similar things due to the cpu having support for most, but not all the stuff that the class of cpu it is should have.
Back to top
View user's profile Send private message
hujuice
Guru
Guru


Joined: 16 Oct 2007
Posts: 336
Location: Rome, Italy

PostPosted: Thu Oct 27, 2011 12:45 pm    Post subject: Reply with quote

Hello everybody.

I would like to build a Gentoo Linux system for this CPU (AMD Fusion APU E-350 Dual) on another machine.
I cannot investigate the target CPU at this moment.

The thread is very clear, but I'm unable to reach a definitive march to set for gcc 4.5.3. :roll:

Please, may anybody - having this CPU working - copy and paste her/his setting?
(I don't care if I loose some flag for now, I care to have everything working.)

Thanks a lot in advance.
HUjuice
_________________
Who hasn't a spine, should have a method.
Chi non ha carattere, deve pur avere un metodo.
Back to top
View user's profile Send private message
chithanh
Developer
Developer


Joined: 05 Aug 2006
Posts: 2158
Location: Berlin, Germany

PostPosted: Thu Oct 27, 2011 1:05 pm    Post subject: Reply with quote

You can set "-march=amdfam10 -mno-3dnow" for best results. However some packages (mostly qt related) get confused and may fail to compile with these flags.

You can leave 3dnow enabled, but performance will not be optimal in that case.
Back to top
View user's profile Send private message
hujuice
Guru
Guru


Joined: 16 Oct 2007
Posts: 336
Location: Rome, Italy

PostPosted: Thu Oct 27, 2011 1:12 pm    Post subject: Reply with quote

Thansk a lot :)
I don't need any DE, so a qt related issue does not create any problem.

I can start the job... :)

Thanks again,
HUjuice
_________________
Who hasn't a spine, should have a method.
Chi non ha carattere, deve pur avere un metodo.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming 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