Hello,
I am trying a demo version of the PGI compiler (vers5.2-1 on RedHat 7.2). The code works with gcc or icc. With pgcc, I cannot use the standard _FPU_SETCW macro described in fpu_control.h. It results in a syntax error.
Example:
#include <fpu_control.h>
void init_float()
{
fpu_control_t cw = 0x037f;
_FPU_SETCW(cw);
}
The result is:
PGC-S-0035-Syntax error: Recovery attempted by replacing ‘:’ by ‘?’
PGC-W-0089-Array name used in logical expression
PGC-S-0056-Attempt to call non-function
What can I do ?
Using the “-P” flag, we see that the marco “_FPU_SETCW(cw);” is actually an extended inline assembly statement.
__asm__ ( "fldcw %0" : : "m" ( * & cw ) ) ;
While pgcc supports basic inline asm statements (see -Masmkeyword in the user’s guide) in the form of
asm("statement");
where the statement is a legal assembly-language statement, pgcc does not support extended inline assembly statements. While I wouldn’t really recommend it except as an experiment, it would be interesting to convert the extend to the basic form. Anyone willing to try it?