Community
cancel
Showing results for 
Search instead for 
Did you mean: 
SDeut
Beginner
96 Views

How to avoid unsupported instructions?

I compile this inline asm line with Intel compiler:

_asm
{
  vpxor  ymm0, ymm0, ymm0
}

compiles ok, but is an AVX2 instruction, that will not run on my older i5 CPU and give an illegal instruction exception.

How can I tell the compiler to disable specific SIMD instructions? E.g. like this: /disable:AVX2 ?

0 Kudos
2 Replies
TimP
Black Belt
96 Views

You might consider the processor dispatching feature, or avx compatible intrinsic which might be promoted according to /arch:

Or guarding with #if __AVX2__

areid2
New Contributor I
96 Views

The Intel compiler has a number of options to control the instruction sets to target and possibly generate multiple auto-dispatch code paths for different different processors, but that only applies to compiling C/C++ code:

https://software.intel.com/en-us/node/522821

When you compile inline assembly you are specifying the exact instructions to use in the object files. I'm not aware of any Intel tools to translate instructions at the assembly level. You'll likely have to modify the code in one of the ways Tim suggested above in order to avoid the AVX instructions.

Reply