ifc -ftz

ifc -ftz

Greetings,

After experimenting with SUN Forte compiler (forte has an implemented flush to zero option) we have established that gradual underflow seriously hurts the performance of our application. g77 has an optimization option which should turn the gradual underflow off. However, that feature, although announced, was never implemented.

We have tried our luck with the noncommercial version of Intel Fortran Compiler for Linux*, and the following code, when compiled with ifc -ftz or ifc -O3 (which should include -ftz option) returns denormalized number R2.

PROGRAM underflow
REAL :: T,R,R2
T=tiny;
R=real(1.0d-19,kind)
R2=R*R
print *,'T=',T
print *,'R=',R
print *,'R*R=',R2
END PROGRAM underflow

Does this mean that -ftz (flush to zero) is not yet implemented for ifc 7.1 (version of the compiler, we are using) or is this feature not available in the noncommercial version, only?

Thanks in advance for any feedback,

Luka Grubisic

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

If your compiler says

ignoring unknown option '-ftz'

then I would agree that it's not implemented.

Your example would not necessarily prove it, as -ftz does not guarantee consistent implementation of abrupt underflow. In this case, the result could be calculated at compile time.

The most reliable way to set abrupt underflow is with a C function call, using the SSE intrinsic _MM_SET_FLUSH_ZERO_MODE. Current gcc supports this. Of course, it will still have an effect only on SSEx instructions.

The latest processors should have cut the penalty for gradual underflow in half, but it remains substantial, as you point out.

Login to leave a comment.