Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

-msse, -Xhost...

kfsone
New Contributor I
504 Views
It's really not clear to me how the following options interact...
icpc -march=pentium4 -mtune=pentium4 -Xhost -msse -msse2 -msse3 -mssse3 -msse4.1
I'm building a local binary on an i7 CPU. Which, if any, of the above should I use? Will
icpc -Xhost
get my everything I need?
0 Kudos
2 Replies
TimP
Honored Contributor III
504 Views
If you "need" the maximum number of code paths for different architectures, -xhost won't do that; it will make only the -xsse4.2 path. Remember that ssse3 path is likely to be slower than the others when running on i7, and the compilers which support these notations don't support sse without sse2. -march=pentium4 should be a synonym for -msse2. If -mtune=pentium4 were observed, it would be detrimental on i7. I agree it's hard to predict the effect of specifying an excessive number of architecture options.
0 Kudos
Dale_S_Intel
Employee
504 Views
To clarify, If you're really building a binary to run only on the machine that you're building on (or other machines of the same type), just use "-xHost" and that should be your best bet in general. As Tim points out, there's no point in specifying a bunch of other architectures as that could confuse things while not adding anything.

Dale
0 Kudos
Reply