[gfortran] Front-end and library calls for large kinds
FX Coudert
fxcoudert@gmail.com
Sun Jun 26 15:28:00 GMT 2005
[This mail is long, but you can read the first paragraph and then skip
to the last one if you don't want the details]
Attached patch adds front-end and library support for mathematical
functions taking real(10), real(16) and integer(16) argument(s). Right
now, we do have minimal support for these kinds (can declare such
variables, add/substract/multiply and divide them) and I/O support. What
is missing is to be able to build function calls with them, such as:
real(10) :: x = 2
x = sqrt(x)
This requires modifications of the front-end, and library support (for
functions other than those in libm). Attached patch provides front-end
support for all such constructions, but library support is limited to
some functions (set_exponent, fraction, ...). But, when this first patch
will be reviewed, accepted and commited, adding other functions will be
fairly easy.
An example on what we can now do on i686-linux can be found in attached
file real10.f90.
Some details on the patch:
* For the library part, functions for all kinds are now protected by
preprocessor directives such as "#if defined (HAVE_GFC_REAL_16)" to
ensure that only code for available kinds is compiled
* For the front-end part, a choice had to be made. Attached patch adds
support for all possible kinds, constructs all possible trees, while
only those related to available kinds will ever be used on a given
system. I modified the gfc_get_int_type and other gfc_get_*_type
functions so that they don't issue an internal error if the kind does
not exist, but return NULL.
This patch was regtesting on i686-linux. Could someone review it? I'm
not asking for commit approval yet; since I don't know the guts of the
front-end very well, I'd like someone familiar with it to tell me if the
way I do it is right. Steven, Paul or Steven, you seem to be the ones
for this job, can one of you do it?
FX
PS: I will be out of town, with no internet access, from July 6th until
the end of August. I do hope we can get this in good form before that.
Otherwise, anybody is welcome to use this small piece of work any way
they like to contribute large kinds support for gfortran!
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: allkinds.diff
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20050626/ce509399/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: real10.f90
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20050626/ce509399/attachment.f90>
More information about the Fortran
mailing list