Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
amd64 and core 2 duo
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on AMD64
View previous topic :: View next topic  
Author Message
alshain
Apprentice
Apprentice


Joined: 02 Aug 2002
Posts: 202
Location: London, UK

PostPosted: Fri Dec 08, 2006 5:21 pm    Post subject: amd64 and core 2 duo Reply with quote

Hello, I'm just about to upgrade my machine from an Athlon X2 to a Core 2 Duo. Until recently I'd assumed that this would be a matter of compiling a new kernel and away we go, but I've been thinking about how I've compiled my system. Everything is compiled as march=amd64 what with the C2D not supporting 3dNow! I'm wondering whether any packages would even run. I'm not familiar about how gcc goes about optimizing for amd64 architecture and if it uses 3dNow functions for everything so has anyone had any experience of this?

Some searching has suggested that the ideal march settings for the C2D (until gcc 4.2 comes along) is nocona but there don't appear to be any generic 64-bit options like there is for x86. I heard that simply leaving out the march option and setting -m64 disables all usage of 3dNow, SSE and the like. Can anyone confirm, and whether the 64-bit liveCD is compiled with basic settings? I see it boots on (some) Core 2 Duo machines, so it would be useful to know how. If march=amd64 software won't run, then I could simply build a new kernel with generic 64-bit options, emerge system, and recompile everything with march=nocona when I've got the new machine running.

Thanks for listening to the rambling! :?

Andrew
Back to top
View user's profile Send private message
erik258
Advocate
Advocate


Joined: 12 Apr 2005
Posts: 2650
Location: Twin Cities, Minnesota, USA

PostPosted: Fri Dec 08, 2006 8:40 pm    Post subject: Reply with quote

this post originally wrote:
i'm fairly sure your packages won't even run, even if they don't use 3dnow and friends.

it was my understanding that core2 duos are not compatible with amd64 in that they use ia64 and amd64s use x86_64 instruction sets.

so i am not sure whether you can run even the same binaries on them both.

of course, they can both do 32bit x86.


EDIT: this is evidently quite incorrect. Read on !
_________________
Configuring a Firewall? Try my iptables configuration
LinuxCommando.com is my blog for linux-related scraps and tidbits. Stop by for a visit!


Last edited by erik258 on Sat Dec 09, 2006 2:31 pm; edited 2 times in total
Back to top
View user's profile Send private message
kill
Apprentice
Apprentice


Joined: 25 Dec 2004
Posts: 179

PostPosted: Fri Dec 08, 2006 9:33 pm    Post subject: Reply with quote

erik258 wrote:
it was my understanding that core2 duos are not compatible with amd64 in that they use ia64 and amd64s use x86_64 instruction sets.

100% wrong. The 64 bit instruction set used by the Athlon64 chips is interchangeable with the instructions used by the Core 2 Duo. The older 64 bit server chips made by Intel used ia64 not the Core 2 Duos.

alshain wrote:
there don't appear to be any generic 64-bit options like there is for x86.

There are but not for -march because that would defeat the purpose. -mtune=generic can be used for generic tuning for the 64 bit extensions used by both chips.

alshain wrote:
setting -m64

Don't do that ever! It will break your system.

Try to boot with your current disk. It should run but you will need to recompile because anything that actually uses 3dNow will not work correctly.
Back to top
View user's profile Send private message
thedude0001
Arch/Herd Tester
Arch/Herd Tester


Joined: 16 Jan 2005
Posts: 69

PostPosted: Sat Dec 09, 2006 5:09 am    Post subject: Reply with quote

If you build a new kernel configured for generic x86_64 systems and remerge system without any -march you should be safe. From there you should be able to boot that disk on a Core2 and pick everything up. You will have to "emerge -e world" though.

With current gcc versions the best thing you can do is -march=nocona (I read something about that on one of our MLs with a reference to gcc devs and what they say to use for now, but I just can't find it any more, sorry...). If you don't use any -march your binaries won't be optimized for mmx & sse, but you can enable that by adding "-mmmx -mmmxext -msse -msse2 -msse3" to your CFLAGS. -march=nocona implies everything but the -msse3. However that has no influence on the use of special asm code in programs like mplayer.

There won't be a -march for core2 in gcc-4.2 (that much I remember from the email I can't find any longer), but it has been added to the development trunk and should be present in gcc-4.3.

-m64 is bad, don't do it, it will break your system.

The live CDs are built without any optimization, so they should be running fine on any core2 box. The problems people are experiencing are mostly due to the whole Core2 architecture being new, with new chipsets etc. That always causes problems until all (or at least most) quirks have been evened out and new installation media have been released.

As a final note: IA64 (Itanium) systems aren't "older" server chips by intel, they are aimed at a completely different target group than core2/athlon64 CPUs.
_________________
Das Schlimme auf dieser Welt ist
daß die Dummen so selbstsicher sind
und die Gescheiten so voller Zweifel.
Back to top
View user's profile Send private message
alshain
Apprentice
Apprentice


Joined: 02 Aug 2002
Posts: 202
Location: London, UK

PostPosted: Sat Dec 09, 2006 10:20 am    Post subject: Reply with quote

Thanks everyone, that pretty much confirmed what I've been thinking/hoping. Emerge system without the march=amd64, upgrade with new kernel and emerge -e world. Should be a good test of the new machine! :P

Andrew
Back to top
View user's profile Send private message
kill
Apprentice
Apprentice


Joined: 25 Dec 2004
Posts: 179

PostPosted: Sat Dec 09, 2006 10:04 pm    Post subject: Reply with quote

thedude0001 wrote:
IA64 (Itanium) systems aren't "older" server chips by intel

They are older in the sense that they were released, time wise, before the Core 2 architecture and the only Intel chips that used it were the Itanium server chips which are being replaced by the Core 2 Xeons.
Back to top
View user's profile Send private message
thedude0001
Arch/Herd Tester
Arch/Herd Tester


Joined: 16 Jan 2005
Posts: 69

PostPosted: Sun Dec 10, 2006 1:53 am    Post subject: Reply with quote

kill wrote:

They are older in the sense that they were released, time wise, before the Core 2 architecture

True.
Quote:
and the only Intel chips that used it were the Itanium server chips which are being replaced by the Core 2 Xeons.


Wrong. Xeon CPUs have existed for quite a while alongside the Itanium architecture and will keep on doing that. Xeons are Intels low-end server chips that are compatible to i386 / amd64 in newer times (competing with AMDs Opteron), the IA64 architecture is targeted at the higher-end server market, competing with architectures like SPARC, alpha or HPPA (where the last two have been discontinued in favor of the IA64 architecture).
_________________
Das Schlimme auf dieser Welt ist
daß die Dummen so selbstsicher sind
und die Gescheiten so voller Zweifel.
Back to top
View user's profile Send private message
thedude0001
Arch/Herd Tester
Arch/Herd Tester


Joined: 16 Jan 2005
Posts: 69

PostPosted: Sun Dec 10, 2006 7:13 am    Post subject: Reply with quote

I just found the post I was referring to earlier. It wasn't on a ML I was on (that's why I couldn't find it) but rather a blog post on http://planet.gentoo.org.

For the lazy ones:

dirtyepic wrote:

GCC and Intel Core
Thanks to H.J. Lu at Intel, I finally got an answer to something that's been bugging me for a while now. What CFLAGS do you use with an Intel Core or Core 2 processor? -march=pentium-m, or -march=prescott/nocona?

On Fri, Dec 01, 2006 at 06:43:46AM -0800, H. J. Lu wrote:
> On Fri, Dec 01, 2006 at 03:36:59AM -0600, Ryan Hill wrote:
> > So anyways, should -m{arch,tune}=native be setting pentium-m for Core
> > CPU's, or is prescott really the better choice in the end?
>
> It should be -march=prescott -mtune=generic. I will look into it.

I opened

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30040


H.J.



So, final answer. If you're using GCC 4.1, use -march=prescott for Intel Core Solo/Duo and -march=nocona (and an amd64 profile) for Core 2 Solo/Duo. For GCC 4.2, a Core Solo/Duo should use -march=prescott -mtune=generic, and Core 2 Solo/Duo should be set to -march=nocona -mtune=generic. GCC trunk adds -march=core2 and support for the SSSE3 instruction set, but that won't be out for quite a while yet.

If you do happen to be using GCC 4.2, check out the very cool -march=native, which will autodetect the host processor(s) and set -march and -mtune accordingly. For Core CPU's you'll also need the patch from GCC PR #30040.

dirtyepic@tycho ~ $ cat /proc/cpuinfo | grep name
model name : Genuine Intel(R) CPU T2300 @ 1.66GHz
model name : Genuine Intel(R) CPU T2300 @ 1.66GHz
dirtyepic@tycho ~ $ gcc -v -c test.c -o test -O2 -march=native
[...]
gcc version 4.2.0-pre20061203 (prerelease) (rev. 119470)
/usr/libexec/gcc/i686-pc-linux-gnu/4.2.0-pre20061203/cc1 -quiet -v test.c -march=prescott -mtune=generic -quiet -dumpbase test.c -auxbase-strip test -O2 -version -o /tmp/cclzri4i.s



You can find the backported patch here:
http://dev.gentoo.org/~dirtyepic/overlay/sys-devel/gcc/files/4.2.0/gcc-4.2-pr30040-mtune-native-core-duo.patch


Here's the link to the original post: http://psykil.livejournal.com/2006/12/03/

Can we maybe have this thread pinned as this question comes up from time to time?
_________________
Das Schlimme auf dieser Welt ist
daß die Dummen so selbstsicher sind
und die Gescheiten so voller Zweifel.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on AMD64 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