Community
cancel
Showing results for 
Search instead for 
Did you mean: 
unrue
Beginner
120 Views

FMA illegal instruction

Dear Intel developers,

I'm using Intel 15 on Intel(R) Xeon(R) CPU E5-2670 processor. I have a problem using FMA instrinsic instruction. My compiler flags are -O3 -xHost. Compilation ends well but when I run my program I get: Program Exception - illegal instruction

I have to suppose FMA is not available on that processor? If yes, why the compiler does not advice me during compilation phase?

Thanks.

0 Kudos
6 Replies
TimP
Black Belt
120 Views

The original 2670 did not support fma. If xhost is mistaking it for -v2 you would need to specify avx until a compiler upgrade fixes it.

TimP
Black Belt
120 Views

The current compiler doesn't expand fma intrinsic so you will need plain c++ source for automatic instruction selection.

unrue
Beginner
120 Views

Tim Prince wrote:

The current compiler doesn't expand fma intrinsic so you will need plain c++ source for automatic instruction selection.

Thanks Tim. How can I check at compile time if FMA is supported?

Bernard
Black Belt
120 Views

You may read the following link:  https://software.intel.com/en-us/articles/how-to-detect-new-instruction-support-in-the-4th-generation-intel-core-processor-family

TimP
Black Belt
120 Views

Your xhost option should result in __AVX2__ being set when your build platform supports  Fma. so you can use that macro symbol to choose fma at compile time.  There is also CPU dispatch facility to choose code path at run time.

unrue
Beginner
120 Views

Ok, thanks to everybody.

Reply