Support for IEEE extended and Quad precision in Fortran

Support for IEEE extended and Quad precision in Fortran

Hello,

I am using Composer XE for Fortran (12.1 and 13) . I am trying to determine if the IEEE extended presicion (80 bits) and quad precision (128 bits) formats are supported in versions 12.1 or 13 of the Fortran compiler.

I have been going over the manual but the only relevant information I ran into "Using Efficient Data Types"  where it states that "Extended-precision real, expressed explicitly as REAL (KIND=16) or REAL*16"

What is real(kind=16) for Intel Fortran then? Is it what IEEE calls the 128 bit quad precision ? Is extended precision supported as such and how can we declare it ?

Thanks

Michael

R/D High-Performance Computing and Engineering
11 post / 0 nuovi
Ultimo contenuto
Per informazioni complete sulle ottimizzazioni del compilatore, consultare l'Avviso sull'ottimizzazione

Yes, REAL(16) is the same as IEEE 128-bit quad precision. No, Intel Fortran does not support 80-bit extended precision.

Steve - Intel Developer Support

Thanks for the quick reply.

Onto the FP issues: Looking at the man page for ifort (12.1) at the -fp-model options with argument precise, fast=[1|2], strict and source, etc. Further down it reads

-fp-model source or /fp:source
                                This option causes intermediate results to be rounded to the precision defined in
                                the  source  code.  It  also implies keyword precise unless it is overridden by a
                                keyword from Group A.

              long double: 64-bit precision; 80-bit data type; 15-bit exponent

              double: 53-bit precision; 64-bit data type; 11-bit exponent; on Windows systems using IA-32  archi-
              tecture, the exponent may be 15-bit if an x87 register is used to hold the value.

              float: 24-bit precision; 32-bit data type; 8-bit exponent

Is the discussion on double, long double, extended just a cut and paste (:-) error from the corresponding C/C++ man page? Or does it imply that intermediate results are using the 80-bit extended ? Incidentally in C/C++ long double occupies 128 bits which hopefully corresponds to the IEEE Quad....

I think these documentain bits need to become a little more consistent. Documentation maybe should explicitly state the underlying implementation format that each declaration corresponds to.

thanks

Michael

R/D High-Performance Computing and Engineering

The only case in which expressions may be evaluated with 80-bit extended precision format is in the ia32 (32-bit) compiler, with -mia32 -pc80 options, as ifort doesn't support a real(10) data type.  There is lack of compatibility between the usual linux C or C++ 80-bit long double and the Fortran real(16) IEEE quad data type.

I believe that the text you cite is just copied from C++. It does not appear in the 13.0 documentation.

Steve - Intel Developer Support

Quote:

TimP (Intel) wrote:

The only case in which expressions may be evaluated with 80-bit extended precision format is in the ia32 (32-bit) compiler, with -mia32 -pc80 options, as ifort doesn't support a real(10) data type.  There is lack of compatibility between the usual linux C or C++ 80-bit long double and the Fortran real(16) IEEE quad data type.

Thanks for the clarification,

Michael

R/D High-Performance Computing and Engineering

Quote:

Steve Lionel (Intel) wrote:

I believe that the text you cite is just copied from C++. It does not appear in the 13.0 documentation.

This excerpt is from "man ifort" for the 12.1 compiler. I just checked the public HTML Users Guide for Fortran 12.1 and this is not there, indeed.

Incidentally, the man ifort for Fortran 13.1 under option  "-fp-model source" also mentions:

 -fp-model source or /fp:source
                                This  option  causes  intermediate  results  to  be rounded to the precision
                                defined in the source code. It also implies keyword  precise  unless  it  is
                                overridden by a keyword from Group A.

              long double: 64-bit precision; 80-bit data type; 15-bit exponent

              double:  53-bit  precision;  64-bit data type; 11-bit exponent; on Windows systems using IA-32
              architecture, the exponent may be 15-bit if an x87 register is used to hold the value.

The reason I am nit-picking on these details is that I would like to provide definite statements in an upcomming class concerning Intel compilers on our systems. I have a discussion on FP operations, semantics and limits so it would be great to have precise information concerning what Intel Fortran and C/C++ support and what high-level data types map to wrt to IEEE binary formats.

Timothy helped me out by pointing that the 80-bit formats are used in the IA32 and windwoes systems only, so I am OK since we are exclusively doing Intel64.

V -fp-model source or /fp:source
                                This  option  causes  intermediate  results  to  be rounded to the precision
                                defined in the source code. It also implies keyword  precise  unless  it  is
                                overridden by a keyword from Group A.

              long double: 64-bit precision; 80-bit data type; 15-bit exponent

              double:  53-bit  precision;  64-bit data type; 11-bit exponent; on Windows systems using IA-32
              architecture, the exponent may be 15-bit if an x87 register is used to hold the value.

Michael

R/D High-Performance Computing and Engineering

Quote:

Steve Lionel (Intel) wrote:

I believe that the text you cite is just copied from C++. It does not appear in the 13.0 documentation.

Steve,

for Fortran 12.1 and 13.x  when the target is Inte64, the real*16 is an actual 128 bit IEEE quad or is it emulated by an 80-bit extended? I assume that it is handled exlusively in S/W , correct?

thanks

R/D High-Performance Computing and Engineering

It is an actual 128-bit IEEE quad, emulated in software.

I don't see the text you quote in the 13.0 manual's description of -fp-model.  See here,

I've attached a presentation we give to customers on the FP model.

Allegati: 

AllegatoDimensione
Download 03-fp-consistency-2012.pdf821.43 KB
Steve - Intel Developer Support

Quote:

Steve Lionel (Intel) wrote:

It is an actual 128-bit IEEE quad, emulated in software.

I don't see the text you quote in the 13.0 manual's description of -fp-model.  See here,

I've attached a presentation we give to customers on the FP model.

Steve,

This text appears only in the man pages for Linux (12.1 and 13.0). The text on actual Users Guides is consistent.

Thanks for the presentation! I have been going through the Fortran (and C/C++) User Guides, Martyn Gorden's articles and Kahan's papers. This rounds out nicely everything.

Michael

R/D High-Performance Computing and Engineering

Ok - I'll get the man pages corrected.

The presentation is Martyn Corden's.

Steve - Intel Developer Support

Lascia un commento

Eseguire l'accesso per aggiungere un commento. Non siete membri? Iscriviti oggi