Oracle® Solaris Studio 12.4: Numerical Computation Guide

Exit Print View

Updated: January 2015
 
 

5.5.5 Implicit Higher Precision

In some situations, expressions might be evaluated in higher precision than is explicit in the source code. This can happen when x87 extended precision registers are used to evaluate expressions involving single or double precision variables. It can also happen when fused multiply-add operations are substituted for pairs of multiplications and additions.

  • Avoid optimizing multiply-add pairs as fused multiply-add operations. Use –fma=none after –fast.

  • If –xarch=386 must be used and there is no explicit use of long double types, then it might be possible to mitigate the effects of extended-precision expression evaluation by compiling with –fprecision=single if all variables are float, or –fprecision=double if all variables are double. However if Fortran complex*8 variables are in use under –xarch=386, then there is no way to insure that all expression evaluations occur in single precision. Using –m64 is preferable to –m32 because function values are passed in registers of the same precision as the functions.