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]

[RFC] Generalizing the library to arbitrary floating-point modes


Hi all,

I have had the following in mind for some time, and obviously this is
the right moment to make it work and get it into the 4.2 branch, so
I'm asking for comments/questions/ideas here:

I'd like to make the library much more general in the way it handles
floating-point modes. Right now, it's limited to the intersection of
{real kinds 4, 8, 10 and 16 (but not both 10 and 16)} and {C types
float, double, long double}. Moreover, it's done in a very ad hoc way.
What I'd like to have is the following:

  1. a configury that recognizes which fortran kinds the front-end
makes available, match them with C floating points types and library
routines. Example: real(kind=16) means "long double", which means
library suffix "l" (as in sqrtl), and printf format "%L". This would
go into a generated file, like we currently have kinds.h. The main
part of this is already working, somewhere on my harddrive.

  2. we define general macros, so that only the kind is used
throughout the library code. Example: LIB_FUNC(sqrt,16) is expanded
into sqrtl.

  3. we convert the library to use all of the above.

  4. (optionnal) the files generated from m4 are reworked so that
there aren't so many files (I can tell you, on systems with slow shell
or slow forking, libgfortran takes *ages* to compile). Moreover, we
would then only have one place to change when adding a new real kind.

This is not so big a project, but as it involves a lot of
code-handling, I'd rather get most ideas and objections before I
actually get into writing the patch :)

Thanks,
FX


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