Using:
Intel(R) Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 16.0.3.210 Build 20160415
Processor: Intel(R) Core(TM) i7-4960X
Fedora Linux 24
According to Intel's specifications for this processor in:
http://ark.intel.com/products/77779/Intel-Core-i7-4960X-Processor-Extrem...
it suports Instruction Set Extensions SSE4.2, AVX, AES
Hence, according to the Intel® Fortran Compiler 16.0 User and Reference Guide, if I compile with "-fma" and "-march=core-avx2" or "-xHost" the compiler should create code with fused multiply-add (FMA) instructions.
I decided to test if this is the case for me. I've found a simple test program in:
https://www.pgroup.com/lit/articles/insider/v3n3a4.htm
which I adapted as
program testfma3 implicit none double precision :: a, b, c, d !a = Z'3c54c9b71a0e6500' ! 4.507E-018 a = z'bF1A28A5F3777D60' b = Z'bf43a04556d864ae' ! -5.989E-004 c = Z'bfc55364b6b08299' ! -0.166 d = 0.0d0 d= a + b*c write(6,100) "Result: ",d,"(",d,")" 100 format ("",a15,Z,a1,e22.16,a1) end program testfma3
I compiled the code with
ifort -march=core-avx2 -fma testfma3.f90 -o testfma3x
and
ifort -xHost -fma testfma3.f90 -o testfma3x
In both cases I got the result:
Result: 0(0.0000000000000000E+00)
when, according to the test, I should have obtained
BBBAD89127ADE008(-.5684854190555145E-20)
Does it mean that my processor does not generate FMA instructions after all?
Thanks.