[Patch, fortran] First steps to array descriptor reform
Paul Richard Thomas
paul.richard.thomas@gmail.com
Sun Jun 7 17:42:00 GMT 2009
The enclosed patch is a first step towards the implementation of the
gfortran array descriptor reform. However, this patch does nothing
than to rearrange the API to the present array descriptor by replacing
gfc_conv_descriptor_xxx with gfc_conv_descriptor_xxx_get and
gfc_conv_descriptor_xxx_set for xxx = [offset, stride, lbound,
ubound].
The reason for doing this is to permit a rather simple transition form
the present dimension triplet of [stride, lbound, ubound] to the new
triplet [stride measure, lbound, extent] and to change the offset from
words to bytes. The descriptor dimensions can be modified and, in the
first instance, the access functions convert from one form to the
other. Later on, such optimization as is necessary can be done by
converting stretches of code that use the old form to make use of the
new.
At the same time, that the dimension triplet is changed, the other
changes will be made to the body of the descriptor; eg. to add size,
rank, type and flag fields, instead of the present dtype. As long as
there is a negligible performance hit, it should be possible to
perform a load of PR fixes in one fell swoop.
The order of play that I see is:
(i) Apply the attached patch;
(ii) Modify the descriptor in the frontend and the library.
(iii) Ensure that there is no runtime performance loss and submit at
this stage so that the API change occurs as early as possible; and
(iv) FIx all the associated PRs.
The attached bootstraps and regtests on FC9/x86_64 - OK for trunk?
Paul
2009-06-07 Paul Thomas <pault@gcc.gnu.org>
* trans-array.h : Replace prototypes for
gfc_conv_descriptor_offset, gfc_conv_descriptor_stride,
gfc_conv_descriptor_lbound, gfc_conv_descriptor_ubound with new
prototypes of the same names with _get or _set appended.
* trans-array.c : Make the originals of the above static and
new functions for the _get and _set functions. Update all the
references to these descriptor access functions.
* trans-expr.c : Update references to the above descriptor
access functions.
* trans-intrinsic.c : The same.
* trans-openmp.c : The same.
* trans-stmt.c : The same.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: submit1.diff
Type: text/x-patch
Size: 26257 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20090607/a4af55e1/attachment.bin>
More information about the Fortran
mailing list