By using march=native,e you leave it to the compiler’s intelligence to figure
out the underlying arch.
The compiler tries to identify the underlying arch using the cpuid flags.
Compiler then tries to generate best code for that arch.
By using march=<archname>, the user takes the responsibility of advising
the compiler to generate best code for the arch that he has selected.
For example,
· Bdver1 architecture has fma4 support.
· Bdver2 architecture has fma3 and fma4 support.
If you use march=bdver1 on a bdver2 machine, compiler generates code which
doesn’t have fma3.
If you use march=native on bdver2 machine, the compiler may generate both fma3
and fma4 code.
-Ganesh
From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On
Behalf Of Dave
Sent: Sunday, March 15, 2015 8:20 AM
To: llvmdev at cs.uiuc.edu
Subject: [LLVMdev] march= question
Good Evening All.
When building for a particular known arch (bdver2 for example)....What is the
difference (if any) of "march=native" vs "march=bdver2"?
I ask, because my peers on the FreeBSD forums were unable to answer.
Sincerely and respectfully,
Dave
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20150315/e37302c5/attachment.html>