Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm running an Athlon64 server with LFS and would like to have a local copy of the server in a virtual machine for testing purposes and building software.

My PC uses an i7 and the existing server software was built with -march=athlon64. Despite the optimizations am I able to run this on my hardware?

share|improve this question

migrated from serverfault.com Jan 29 '13 at 21:53

This question came from our site for professional system and network administrators.

2 Answers 2

up vote 6 down vote accepted

The -march flag permits the compiler to use instructions that are not supported by other CPUs. There are a few instructions that are legal to use with -march=athlon64 that your i7 does not support. These are the 3DNow! and Enhanced 3DNow! instructions that weren't included in MMX or integer SSE. If the code uses instructions like PFPNACC it will fault on your i7.

That said, it's extremely unlikely that it actually does use any such instructions because those instructions have generally been found to be of little use -- the useful 3DNow! instructions were incorporated into MMX or iSSE, which your CPU does support.

So it's not guaranteed to work, but it probably will.

-march=cpu-type: Generate instructions for the machine type cpu-type. ... -march=cpu-type allows GCC to generate code that may not run at all on processors other than the one indicated.

share|improve this answer
    
Do you know if Qemu is capable of emulating Athlon64 instruction sets? –  thpetrus Jan 29 '13 at 23:03
    
I know that support was developed in 2008. I don't know whether it got merged into the main distribution though. –  David Schwartz Jan 29 '13 at 23:08

You will be able to run it, although with a small performance penalty.

share|improve this answer
    
How do you figure? What if it uses enhanced 3DNow instructions like PFPNACC? –  David Schwartz Jan 29 '13 at 19:07
    
The basic architecture is the same (x86 64-bit), so it will run. But since the binary is optimized for an Athlon, with its specific instructions, it won't run as well as if it were compiled optimized for an i7. –  schaiba Jan 29 '13 at 19:09
    
The question was if it will run. My answer is yes, it will. –  schaiba Jan 29 '13 at 19:11
    
He's asking about -march, not -mtune. It's not "optimized" for athlon64, it set to use the athlon64's instruction set. This includes instructions like PFPNACC that the i7 does not support. –  David Schwartz Jan 29 '13 at 19:11
    
Quoting from the manual: -march=cpu-type Generate instructions for the machine type cpu-type. The choices for cpu-type are the same as for -mtune. Moreover, specifying -march=cpu-type implies -mtune=cpu-type. . And -mtune=cpu-type Tune to cpu-type everything applicable about the generated code, except for the ABI and the set of available instructions. –  schaiba Jan 29 '13 at 19:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.