Yes you can.
Just as you specify -xARCH
(like -xAVX
, -xHost
) you can specify -axARCH
to compile for two architectures
Example:
icc -xHost -axSSE2 ...
Will compile a default executable for the host architecture and optional code for SSE2 in case it's used on an older processor. Sadly only one additional architecture may be used. At runtime the most advanced code will be used.
In my icc 12.0.2
the valid options are: SSE2, SSE3, SSE4.1, SSE4.2, AVX, Host (-xHost
only)
Modern AMD machines support SSE3 in all modern CPUs. SSE2 is by the way the standard lowest common denominator and is the default option if no -x
option is specified. You can not make icc
generate AMD 3DNow! code.