#
d02b318a |
| 19-Nov-2021 |
Peter Klausler <pklausler@nvidia.com> |
[flang] Remove typo that affected complex namelist input
A recent patch to real/complex formatted input included what must have been an editing hiccup: "++ ++p" instead of "++p". This compiles, and
[flang] Remove typo that affected complex namelist input
A recent patch to real/complex formatted input included what must have been an editing hiccup: "++ ++p" instead of "++p". This compiles, and it broke the consumption of the trailing ')' of a complex value in namelist input by skipping over the character.
Extend existing test to cover this case.
Differential Revision: https://reviews.llvm.org/D114297
show more ...
|
#
da25f968 |
| 02-Nov-2021 |
Peter Klausler <pklausler@nvidia.com> |
[flang] Runtime performance improvements to real formatted input
Profiling a basic internal real input read benchmark shows some hot spots in the code used to prepare input for decimal-to-binary con
[flang] Runtime performance improvements to real formatted input
Profiling a basic internal real input read benchmark shows some hot spots in the code used to prepare input for decimal-to-binary conversion, which is of course where the time should be spent. The library that implements decimal to/from binary conversions has been optimized, but not the code in the Fortran runtime that calls it, and there are some obvious light changes worth making here.
Move some member functions from *.cpp files into the class definitions of Descriptor and IoStatementState to enable inlining and specialization.
Make GetNextInputBytes() the new basic input API within the runtime, replacing GetCurrentChar() -- which is rewritten in terms of GetNextInputBytes -- so that input routines can have the ability to acquire more than one input character at a time and amortize overhead.
These changes speed up the time to read 1M random reals using internal I/O from a character array from 1.29s to 0.54s on my machine, which on par with Intel Fortran and much faster than GNU Fortran.
Differential Revision: https://reviews.llvm.org/D113697
show more ...
|
#
b83242e2 |
| 21-Oct-2021 |
peter klausler <pklausler@nvidia.com> |
[flang] Support legacy usage of 'A' edit descriptors for integer & real
The 'A' edit descriptor once served as a form of raw I/O of bytes to/from variables that weren't of type CHARACTER (which itse
[flang] Support legacy usage of 'A' edit descriptors for integer & real
The 'A' edit descriptor once served as a form of raw I/O of bytes to/from variables that weren't of type CHARACTER (which itself didn't exist until F'77). This usage was especially common for output of numeric variables that had been initialized with Hollerith.
Differential Revision: https://reviews.llvm.org/D112346
show more ...
|
#
b8452dba |
| 20-Oct-2021 |
peter klausler <pklausler@nvidia.com> |
[flang] Support NAMELIST input of short arrays
NAMELIST array input does not need to fully define an array. If another input item begins after at least one element, it ends input into the array and
[flang] Support NAMELIST input of short arrays
NAMELIST array input does not need to fully define an array. If another input item begins after at least one element, it ends input into the array and the remaining items are not modified.
The tricky part of supporting this feature is that it's not always easy to determine whether the next non-blank thing in the input is a value or the next item's name, esp. in the case of logical data where T and F can be names. E.g.,
&group logicalArray = t f f t = 1 /
should read three elements into "logicalArray" and then read an integer or real variable named "t".
So the I/O runtime has to do some look-ahead to determine whether the next thing in the input is a name followed by '=', '(', or '%'. Since the '=' may be on a later record, possibly with intervening NAMELIST comments, the runtime has to support a general form of saving and restoring its current position. The infrastructure in the I/O runtime already has to support repositioning for list-directed repetition, even on non-positionable input sources like terminals and sockets; this patch adds an internal RAII API to make it easier to save a position and then do arbitrary look-ahead.
Differential Revision: https://reviews.llvm.org/D112245
show more ...
|
#
f63dafeb |
| 29-Sep-2021 |
peter klausler <pklausler@nvidia.com> |
[flang] runtime: fix formatted real input regression w/ spaces
Blank input fields must be interpreted as zero, including the case of virutal space characters generated from record padding at the end
[flang] runtime: fix formatted real input regression w/ spaces
Blank input fields must be interpreted as zero, including the case of virutal space characters generated from record padding at the end of an input record. This stopped working sometime in the past few months for real input (not sure when); here's a fix.
This bug was breaking FCVS test fm111.
Differential Revision: https://reviews.llvm.org/D110765
show more ...
|
#
4393e377 |
| 20-Sep-2021 |
peter klausler <pklausler@nvidia.com> |
[flang] Implement READ(SIZE=) and INQUIRE(IOLENGTH=) in runtime
Count input characters corresponding to formatted edit descriptors for READ(SIZE=); count output bytes for INQUIRE(IOLENGTH=).
The I/
[flang] Implement READ(SIZE=) and INQUIRE(IOLENGTH=) in runtime
Count input characters corresponding to formatted edit descriptors for READ(SIZE=); count output bytes for INQUIRE(IOLENGTH=).
The I/O APIs GetSize() and GetLength() were adjusted to return std::size_t as function results.
Basic unit tests were added (and others fixed).
Differential Revision: https://reviews.llvm.org/D110291
show more ...
|
#
651f58bf |
| 02-Sep-2021 |
Diana Picus <diana.picus@linaro.org> |
[flang] Remove *- C++ -* incantation from runtime .cpp files. NFC
We should only need to spell the language out in .h files.
Differential Revision: https://reviews.llvm.org/D109138
|
#
4d42e16e |
| 22-Jul-2021 |
peter klausler <pklausler@nvidia.com> |
[flang] runtime: fix problems with I/O around EOF & delimited characters
When a WRITE overwrites an endfile record, we need to forget that there was an endfile record. When doing a BACKSPACE after
[flang] runtime: fix problems with I/O around EOF & delimited characters
When a WRITE overwrites an endfile record, we need to forget that there was an endfile record. When doing a BACKSPACE after an explicit ENDFILE statement, the position afterwards must be upon the endfile record.
Attempts to join list-directed delimited character input across record boundaries was due to a bad reading of the standard and has been deleted, now that the requirements are better understood. This problem would cause a read attempt past EOF if a delimited character input value was at the end of a record.
It turns out that delimited list-directed (and NAMELIST) character output is required to emit contiguous doubled instances of the delimiter character when it appears in the output value. When fixed-size records are being emitted, as is the case with internal output, this is not possible when the problematic character falls on the last position of a record. No two other Fortran compilers do the same thing in this situation so there is no good precedent to follow.
Because it seems least wrong, with this patch we now emit one copy of the delimiter as the last character of the current record and another as the first character of the next record. (The second-least-wrong alternative might be to flag a runtime error, but that seems harsh since it's not an explicit error in the standard, and the output may not have to be usable later as input anyway.) Consequently, the output is not suitable for use as list-directed or NAMELIST input.
If a later standard were to clarify this case, this behavior will of course change as needed to conform.
Differential Revision: https://reviews.llvm.org/D106695
show more ...
|
#
6a1c3efa |
| 05-May-2021 |
peter klausler <pklausler@nvidia.com> |
[flang] Implement NAMELIST I/O in the runtime
Add InputNamelist and OutputNamelist as I/O data transfer APIs to be used with internal & external list-directed I/O; delete the needless original namel
[flang] Implement NAMELIST I/O in the runtime
Add InputNamelist and OutputNamelist as I/O data transfer APIs to be used with internal & external list-directed I/O; delete the needless original namelist-specific Begin... calls. Implement NAMELIST output and input; add basic tests.
Differential Revision: https://reviews.llvm.org/D101931
show more ...
|
#
d56fdc8e |
| 02-Oct-2020 |
peter klausler <pklausler@nvidia.com> |
[flang][msvc] Avoid dependence on long double
MSVC does not support a distinct 80-bit extended precision "long double" type. Rework the I/O runtime to avoid using native C/C++ type names. Centrali
[flang][msvc] Avoid dependence on long double
MSVC does not support a distinct 80-bit extended precision "long double" type. Rework the I/O runtime to avoid using native C/C++ type names. Centralize the mappings between the KIND= type parameters of REAL and their binary precisions in the common real.h header file, and use KIND type parameter values rather than binary precisions for clarity where appropriate.
This patch, if successful, should obviate the need for Differential review D88511.
(This patch anticipates a successful review of D88688, which fixes the function that maps each kind of real to its maximum number of significant decimal digits.)
Differential revision: https://reviews.llvm.org/D88752
show more ...
|
#
b2cf572b |
| 14-Sep-2020 |
peter klausler <pklausler@nvidia.com> |
[flang] Respect BZ mode in exponent parts, too
The Fortran standard discusses BZ mode (treat blanks as zero digits) explicitly in its effect on the editing of the digits prior to the exponent part,
[flang] Respect BZ mode in exponent parts, too
The Fortran standard discusses BZ mode (treat blanks as zero digits) explicitly in its effect on the editing of the digits prior to the exponent part, but doesn't mention it in description of the exponent part. Other compilers honor BZ mode in the exponent, so we should do so too. So "1 e 1 " is 1.E11 in BZ mode.
Differential Revision: https://reviews.llvm.org/D87653
show more ...
|
#
7c5630fe |
| 03-Aug-2020 |
peter klausler <pklausler@nvidia.com> |
[flang] Handle spaces (more) correctly in REAL input
Fixes problems in FCVS test fm110.f. Add more comments, too.
Differential Revision: https://reviews.llvm.org/D85163
|
#
3bc2ae95 |
| 23-Jul-2020 |
peter klausler <pklausler@nvidia.com> |
[flang] Add runtime I/O APIs for COMPLEX formatted input
It turns out that COMPLEX formatted input needs its own runtime APIs so that null values in list-directed input skip the entire COMPLEX datum
[flang] Add runtime I/O APIs for COMPLEX formatted input
It turns out that COMPLEX formatted input needs its own runtime APIs so that null values in list-directed input skip the entire COMPLEX datum rather than just a real or imaginary part thereof.
Reviewed By: sscalpone
Differential Revision: https://reviews.llvm.org/D84370
show more ...
|
#
9bb091a8 |
| 22-Jul-2020 |
peter klausler <pklausler@nvidia.com> |
[flang] Handle leading zeroes after decimal in REAL formatted input
Leading zero digits after the decimal mark were being dropped.
Reviewed By: sscalpone
Differential Revision: https://reviews.llv
[flang] Handle leading zeroes after decimal in REAL formatted input
Leading zero digits after the decimal mark were being dropped.
Reviewed By: sscalpone
Differential Revision: https://reviews.llvm.org/D84282
show more ...
|
#
8305a92a |
| 17-Jul-2020 |
peter klausler <pklausler@nvidia.com> |
[flang] Treat tabs like spaces in formatted input.
Reviewed By: sscalpone
Differential Revision: https://reviews.llvm.org/D84078
|
#
8dbc86ad |
| 14-Jul-2020 |
peter klausler <pklausler@nvidia.com> |
[flang] Fix list-directed input (repeated nulls and LOGICAL)
Allow repeated nulls in list-directed input (e.g., "4*,") and ignore excess characters in list-directed LOGICAL input after the T or F.
[flang] Fix list-directed input (repeated nulls and LOGICAL)
Allow repeated nulls in list-directed input (e.g., "4*,") and ignore excess characters in list-directed LOGICAL input after the T or F.
Fixes FCVS test fm923.f.
Reviewed By: sscalpone
Differential Revision: https://reviews.llvm.org/D83810
show more ...
|
#
4e958c17 |
| 02-Jul-2020 |
peter klausler <pklausler@nvidia.com> |
[flang] External I/O runtime work, repackaged (part 2)
Clean up the input editing path so external input works better when combined with further changes. List-directed input needed to allow for adv
[flang] External I/O runtime work, repackaged (part 2)
Clean up the input editing path so external input works better when combined with further changes. List-directed input needed to allow for advancement to following records.
Reviewed By: tskeith, sscalpone
Differential Revision: https://reviews.llvm.org/D83104
show more ...
|
#
1f879005 |
| 29-Mar-2020 |
Tim Keith <tkeith@nvidia.com> |
[flang] Reformat with latest clang-format and .clang-format
Original-commit: flang-compiler/f18@9fe84f45d7fd685051004678d6b5775dcc4c6f8f Reviewed-on: https://github.com/flang-compiler/f18/pull/1094
|
#
231fae90 |
| 12-Mar-2020 |
Isuru Fernando <isuruf@gmail.com> |
[flang] Need <algorithm> for std::min and std::max (flang-compiler/f18#1063)
Original-commit: flang-compiler/f18@d0f9ef7742132a5f9f7173b773aaac934484c7c1 Reviewed-on: https://github.com/flang-compil
[flang] Need <algorithm> for std::min and std::max (flang-compiler/f18#1063)
Original-commit: flang-compiler/f18@d0f9ef7742132a5f9f7173b773aaac934484c7c1 Reviewed-on: https://github.com/flang-compiler/f18/pull/1063
show more ...
|
#
3b635714 |
| 13-Feb-2020 |
peter klausler <pklausler@nvidia.com> |
[flang] Use hash table for UnitMap, avoid C++ STL binary dependence
Scan FORMAT strings locally to avoid C++ binary runtime dependence when computing deepest parenthesis nesting
Remove a dependency
[flang] Use hash table for UnitMap, avoid C++ STL binary dependence
Scan FORMAT strings locally to avoid C++ binary runtime dependence when computing deepest parenthesis nesting
Remove a dependency on ostream from runtime
Remove remaining direct external references from runtime to C++ library binaries
Remove runtime dependences on lib/common
SetPos() and SetRec()
Instantiate templates for input
Begin input; rearrange locking, deal with CLOSE races
View()
Update error message in test to agree with compiler change
First cut at real input
More robust I/O runtime error handling
Debugging of REAL input
Add iostat.{h,cpp}
Rename runtime/numeric-* to runtime/edit-*
Move templates around, templatize integer output editing
Move LOGICAL and CHARACTER output from io-api.cpp to edit-output.cpp
Change pointer argument to reference
More list-directed input
Complex list-directed input
Use enum class Direction rather than bool for templates
Catch up with changes to master
Undo reformatting of Lower code
Use record number instead of subscripts for internal unit
Unformatted sequential backspace
Testing and debugging
Dodge bogus GCC warning
Add <cstddef> for std::size_t to fix CI build
Address review comments
Original-commit: flang-compiler/f18@50406b349609efdde76e48bf2caa039d031dd1c4 Reviewed-on: https://github.com/flang-compiler/f18/pull/1053
show more ...
|