This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[fortran, patch] Add Fortran 2003 IEEE intrinsic modules


Hi all,

Here’s my patch submission for adding IEEE intrinsic modules (following Fortran 2003 and 2008 standards) to gfortran. It implements the item 1, and part of item 2, of my initial plan [1]. All the IEEE modules, types, named constants, procedures are defined and fully working. The patch comes of course with plenty of testcases, and I can add some more if you can think of things I’ve forgotten. I’ve bootstrapped and regtested the patch on:

  – x86_64-darwin (both 32-bit and 64-bit); this uses 387/SSE assembler in config/fpu-387.h
  – x86_64-linux (both 32-bit and 64-bit); this also uses 387/SSE assembler
  – x86_64-linux with tweaked configure.host to force it to use glibc functions in config/fpu-glibc.h (both 32-bit and 64-bit) [3]

I would like to get testing from:

  – a Solaris target (to test config/fpu-sysv.h)
  – an AIX target (to test config/fpu-aix.h)

Note:  Gradual underflow control is implemented as "not supported by the processor" (its SUPPORT function returns false, and the GET and SET procedures abort if you call them), because we probably don’t have targets where it would work (and I don’t think people use it much, if at all). That’s explicitly allowed by the standard.



** What’s missing

 – Documenting the flags necessary for full IEEE compatibility: it seems that "-fno-unsafe-math-optimizations -frounding-math -fsignaling-nans” is good, but I’ll have to check that with the floating-point middle-end experts. That’s next on my list: documenting our support, and interaction with compilation flags.

 – Saving/restoring FPU state on procedure entry/exit. That’s #2 on my list, it’s almost independent of the rest of the patch. It’ll happen in the front-end (emitting calls to the library functions).

 – A review of the patch!


Thanks for the help,
FX



[1] http://gcc.gnu.org/ml/fortran/2013-11/msg00055.html
[2] http://gcc.gnu.org/ml/fortran/2013-11/msg00061.html
[3] On 64-bit x86_64-linux with glibc, the IEEE_GET_STATUS test (ieee_6.f90) fails, due to a platform-specific bug in glibc: https://sourceware.org/bugzilla/show_bug.cgi?id=16198


Attachment: ieee.ChangeLog
Description: Binary data

Attachment: ieee.diff
Description: Binary data

Attachment: ieee_regenerated.diff
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]