Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Inline assembler

kt_mic
Beginner
1,098 Views
I have noticed that the Fortran compiler can compile the assembler files it can generate with the output assembler options. This is also true if these files are modified. This leads to the following questions:

1. Is inline assembler a possibility with the Fortran compiler and, in case, what is the syntax?

2. It seems that in .asm files SSE3 instructions like haddpd xmm0, xmm1 are not reckognised. Why?

Michael
0 Kudos
4 Replies
Steven_L_Intel1
Employee
1,098 Views
The Intel Fortran compiler cannot process assembler files. It does have the ability to generate them, and you can build them with the Microsoft Assembler (MASM). Visual Studio knows how to invoke MASM, so if you have it installed, then this may explain your belief that the Fortran compiler understands them.

Intel Fortran does not support inline assembler. If you really want to do this sort of thing, Intel C++ supports intrinsics for many SSE instructions.

You would need a MASM that was updated to support SSE3. I believe that this is a free download for Visual Studio users from Microsoft.
0 Kudos
kt_mic
Beginner
1,098 Views
It does a good job of making me believe it can, then.
I do have visual studio installed (as required), but I do all work from the command line, involving the compiler with IFORTVARS.BAT

IFORT -c vv.asm

produces the ifort message, continues with

assembling vv.asm

and produces the compiled file.

Anyhow, I shall check up on MASM to see if a SSE3 update is available.

Michael
0 Kudos
Steven_L_Intel1
Employee
1,098 Views
If you add /watch to the ifort command line, you'll see that it invokes ml to "compile" the .asm file.
0 Kudos
kt_mic
Beginner
1,098 Views
Thanks, I shall remember that. And, in addition, a macro found somewhere on the Intel website provided me with the SSE3-instructions the current version of MASM was missing. So, thank you for the help.

Michael
0 Kudos
Reply