24.05.2014 Views

XL Fortran Enterprise Edition for AIX : User's Guide - IBM

XL Fortran Enterprise Edition for AIX : User's Guide - IBM

XL Fortran Enterprise Edition for AIX : User's Guide - IBM

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The following example shows the difference between using the norndsngl and the<br />

rndsngl suboptions:<br />

REAL(4) a,b,c,d<br />

...<br />

a = b + c + d<br />

With norndsngl, the compiler does the following:<br />

1. Per<strong>for</strong>ms the intermediate computation of b + c in double precision without<br />

rounding.<br />

2. Adds the double-precision result to d.<br />

3. Rounds the final double-precision result and then stores it into variable a.<br />

With rndsngl, the compiler follows the same steps except that it per<strong>for</strong>ms<br />

rounding in the first step. Note that norndsngl maintains increased precision <strong>for</strong><br />

intermediate results and improves per<strong>for</strong>mance, but you may need to specify<br />

rndsngl to produce results that are bit-<strong>for</strong>-bit identical to those computed on other<br />

systems.<br />

norndsngl is the default when you use -qarch to target a POWER, a POWER2, or a<br />

common architecture. rndsngl is the default when you target a PowerPC<br />

architecture. You can also explicitly set the rndsngl suboption <strong>for</strong> any target<br />

architecture.<br />

Invalid Operation Exceptions <strong>for</strong> SQRT Operations on POWER<br />

Processors<br />

The POWER architecture does not include a hardware status flag to indicate IEEE<br />

invalid operation exceptions that are caused by attempting to compute the square<br />

root of a negative number. Instead, the operating system must handle those<br />

exceptions by using a software mechanism. There<strong>for</strong>e, using SQRT <strong>for</strong> a negative<br />

number may not reliably generate invalid operation exceptions on POWER<br />

plat<strong>for</strong>ms, depending on the level of the operating system installed on the<br />

computer.<br />

The POWER2 architecture and many PowerPC architectures each has a hardware<br />

status flag <strong>for</strong> invalid SQRT operations, and each reliably generates exceptions.<br />

304 <strong>XL</strong> <strong>Fortran</strong> <strong>Enterprise</strong> <strong>Edition</strong> <strong>for</strong> <strong>AIX</strong> : User’s <strong>Guide</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!